OFFSET
1,1
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
EXAMPLE
2^1 ends in 2;
2^5 ends in 32;
2^9 ends in 512;
2^13 ends in 8192;
2^89 ends in ...562112.
There exists a power of two ending in 12, so for n = 3 the choice for a(3) = 1 or a(3) = 2 comes from the existence of a power of two ending in either 112 or 212. As 112 is divisible by 2^n = 8 (and 212 is not) a(3) = 1. - David A. Corneth, Jun 11 2020
PROG
(PARI) first(n) = my(f = 2, pow10 = 1, pow2 = 2); { for(i = 2, n, pow10*=10; pow2<<=1; c1 = pow10 + f; if(c1 % pow2 == 0, f = c1, c2 = 2*pow10 + f; if(c2 % pow2 == 0, f = c2 ) ) ); Vecrev(digits(f)) } \\ David A. Corneth, Jun 11 2020
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
EXTENSIONS
Definition corrected by Gerry Leversha, Mar 17 2007
STATUS
approved