A004092 Sum of digits of even numbers.
0, 2, 4, 6, 8, 1, 3, 5, 7, 9, 2, 4, 6, 8, 10, 3, 5, 7, 9, 11, 4, 6, 8, 10, 12, 5, 7, 9, 11, 13, 6, 8, 10, 12, 14, 7, 9, 11, 13, 15, 8, 10, 12, 14, 16, 9, 11, 13, 15, 17, 1, 3, 5
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..10000
- Diophante, A1762, Des chiffres à la moulinette (in French).
Programs
-
Mathematica
Table[Sum[DigitCount[2*n][[i]]*i, {i, 9}], {n, 0, 100}] (* G. C. Greubel, Jun 19 2016 *)
-
PARI
a(n)=sumdigits(2*n) \\ Charles R Greathouse IV, Jun 19 2016
Formula
a(n) = 2n - 9*Sum_{k=1..1+floor(log_10(2n))} floor( n/(5*10^(k-1)) ). - Anthony Browne, Jun 18 2016
a(n) = A007953(2n). - Alois P. Heinz, Apr 11 2018
Comments