C Numbers 34: Print the first 20 numbers of the Pell series [C Programming]

Опубликовано: 31 Январь 2025
на канале: JLabs
2,423
40

Write a program in C to print the first 20 numbers of the Pell series.

Expected Output :
The first 20 numbers of the Pell series are :
0 1 2 5 12 29 70 169 408 985 ...

What is a Pell Number?

Pell numbers are numbers that are similar to the Fibonacci numbers and are generated by below formula:

P(n) = (2 * P(n-1)) + P(n-2)
with seeds P(0) = 0 and P(1) = 1

=================================================

   • C Programming - Numbers  

Website : http://www.jlabstech.com
Like us on Facebook :   / jlabstechnology  
Follow on Twitter :   / _jlabs_