OFFSET
1,4
COMMENTS
"Positions" are counted 0,1,2,3,... starting with the least significant digit.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
2^10 = 1024, the rightmost zero is in position 2, so a(10) = 2. Another example, 2^5 = 32, so we need to add a leading zero: 032, thus the rightmost zero will be in position 2, and a(5) = 2.
MAPLE
A181611 := proc(n) local dgs, i ; dgs := convert(2^n, base, 10) ; i := ListTools[Search](0, dgs) ; if i > 0 then i-1; else nops(dgs) ; end if ; end proc: # R. J. Mathar, Jan 30 2011
a:= proc(n) local m, i;
m:= 2^n;
for i from 0 while m>0 and irem(m, 10, 'm')<>0
do od; i
end:
seq(a(n), n=1..121); # Alois P. Heinz, Feb 05 2011
MATHEMATICA
Table[Position[Reverse[Prepend[IntegerDigits[2^n], 0]],
0][[1]][[1]] - 1, {n, 121}]
PROG
(PARI) a(n) = {my(d = Vecrev(digits(2^n))); for (i=1, #d, if (!d[i], return (i-1)); ); #d; } \\ Michel Marcus, Jan 01 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Tanya Khovanova, Jan 30 2011
STATUS
approved