A004090 Sum of digits of Fibonacci numbers.
0, 1, 1, 2, 3, 5, 8, 4, 3, 7, 10, 17, 9, 8, 17, 7, 24, 22, 19, 14, 24, 20, 17, 28, 27, 19, 19, 29, 21, 23, 17, 31, 30, 34, 37, 35, 27, 35, 44, 43, 24, 31, 46, 41, 33, 29, 35, 37, 54, 55, 46, 29, 48, 41, 53, 58, 48, 52, 73, 44, 54, 53, 62, 61, 51, 67, 73, 59
Offset: 0
Links
- T. D. Noe, Table of n, a(n) for n = 0..10000
- T. D. Noe, Plot of a(n)-n for n = 0..100000
Crossrefs
Programs
-
Haskell
a004090 = a007953 . a000045 -- Reinhard Zumkeller, Nov 17 2014
-
Magma
[&+Intseq(Fibonacci(n)): n in [0..80] ]; // Vincenzo Librandi, Jun 18 2015
-
Mathematica
Table[Plus@@IntegerDigits@(Fibonacci[n]), {n, 0, 90}] (* Vincenzo Librandi, Jun 18 2015 *)
-
PARI
a(n)=sumdigits(fibonacci(n)) \\ Charles R Greathouse IV, Feb 03 2014
-
Python
A004090 = lambda n: sum(int(d)for d in str(A000045(n))) # M. F. Hasler, Jul 07 2025
Formula
a(n) = Fibonacci(n) - 9*Sum_{k>0} floor(Fibonacci(n)/10^k). - Hieronymus Fischer, Jun 25 2007
Comments