login
A089343
Sum of all digits in all even numbers from 0 to 6(10^(k+1)-1)/9 (with (k+1) 6's).
1
0, 12, 231, 3735, 52239, 672243, 8222247, 97222251, 1122222255, 12722222259, 142222222263, 1572222222267, 17222222222271, 187222222222275, 2022222222222279, 21722222222222283, 232222222222222287, 2472222222222222291, 26222222222222222295
OFFSET
0,2
FORMULA
a(k+1) = 3((10^k)(110*3+405k-135)-3(18k+29)+162k+216)/81.
From Colin Barker, Sep 02 2015: (Start)
a(n) = (-7/9*(-1+10^n)+1/2*(8+3*10^n)*n).
a(n) = 22*a(n-1)-141*a(n-2)+220*a(n-3)-100*a(n-4) for n>3.
G.f.: 3*x*(115*x^2-11*x+4) / ((x-1)^2*(10*x-1)^2).
(End)
EXAMPLE
a(2) = 0+2+4+6+8+1+0+1+2+1+4+..+6+6 = 231.
MATHEMATICA
Table[Sum[Total@ IntegerDigits@ k, {k, 0, FromDigits@ Table[6, {n}], 2}], {n, 0, 8}] (* or *)
Table[(-7/9 (-1 + 10^n) + 1/2 (8 + 3*10^n) n), {n, 0, 18}] (* Michael De Vlieger, Sep 02 2015 *)
LinearRecurrence[{22, -141, 220, -100}, {0, 12, 231, 3735}, 20] (* Vincenzo Librandi, Sep 03 2015 *)
PROG
(PARI) concat(0, Vec(3*x*(115*x^2-11*x+4)/((x-1)^2*(10*x-1)^2) + O(x^30))) \\ Colin Barker, Sep 02 2015
(Magma) [(-7/9*(-1+10^n)+1/2*(8+3*10^n)*n): n in [0..20]]; // Vincenzo Librandi, Sep 03 2015
CROSSREFS
Sequence in context: A221657 A089370 A171093 * A303487 A280071 A279610
KEYWORD
nonn,base,easy
AUTHOR
Yalcin Aktar, Dec 26 2003
EXTENSIONS
More terms from Colin Barker, Sep 03 2015
STATUS
approved