login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A023396 If any odd power of 2 ends with k 1's and 2's, they must be the first k terms of this sequence in reverse order. 7
2, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 2, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
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
Sequence in context: A293433 A177025 A265210 * A091221 A106495 A100428
KEYWORD
nonn,easy,base
AUTHOR
EXTENSIONS
Definition corrected by Gerry Leversha, Mar 17 2007
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 12:22 EDT 2024. Contains 371937 sequences. (Running on oeis4.)