OFFSET
0,2
COMMENTS
If i >= 2, a(n) mod 4 = 0. (Cf. A053824)
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
EXAMPLE
a(9) = 8 because 10^9 = 4022000000000_5, and 2^9 = 512 = 4022_5.
MAPLE
a:= n-> add(i, i=convert (2^n, base, 5)):
seq(a(n), n=0..82); # Alois P. Heinz, Jan 06 2011
MATHEMATICA
Table[Plus@@IntegerDigits[2^n, 5], {n, 0, 49}] (* Either that one or this one *) Table[Plus@@IntegerDigits[10^n, 5], {n, 0, 49}] (* Alonso del Arte, Jan 06 2011 *)
PROG
(PARI)\\ L is the list of the N digits of 2^n in quinary.
\\ L[1] = a_0 , ..., L[N] = a_(N-1).
convert(n)={n=2^n; x=n; N=floor(log(n)/log(5))+1;
L = listcreate(N);
while(x, n=floor(n/5); r=x-5*n; listput(L, r); x=n; );
L; N};
for(n=0, 100, convert(n); an=0; for(i=1, N, an+=L[i]; ); print1(an, ", "));
(PARI) t(n) = if(n<1, 0, if(n%5, t(n-1)+1, t(n/5)));
vector(200, n, n--; t(2^n)) \\ Altug Alkan, Oct 28 2015
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Washington Bomfim, Jan 01 2011
STATUS
approved