cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A181611 Position of rightmost zero in 2^n (including leading zero).

This page as a plain text file.
%I A181611 #25 Jan 01 2016 17:28:58
%S A181611 1,1,1,2,2,2,3,3,3,2,2,2,4,5,5,5,2,6,6,5,5,1,1,8,8,4,9,9,3,8,10,10,10,
%T A181611 11,11,11,12,4,12,11,8,1,1,5,5,12,12,3,15,7,16,3,3,7,8,8,8,12,7,7,10,
%U A181611 1,1,7,4,4,21,13,7,4,4,22,6,6,4,23,24,13,2,4,25,1,1,11,6,26,3,2,12,12,12,11,14,14,23,3,3,4,4,4,3,1,1,2,2,2,6,6,8,2,2,2,3,3,3,17,2,5,6,6,6
%N A181611 Position of rightmost zero in 2^n (including leading zero).
%C A181611 "Positions" are counted 0,1,2,3,... starting with the least significant digit.
%H A181611 Alois P. Heinz, <a href="/A181611/b181611.txt">Table of n, a(n) for n = 1..10000</a>
%F A181611 a(n) = A215887(A000079(n)). - _Michel Marcus_, Jan 01 2016
%e A181611 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.
%p A181611 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
%p A181611 a:= proc(n) local m, i;
%p A181611       m:= 2^n;
%p A181611       for i from 0 while m>0 and irem(m, 10, 'm')<>0
%p A181611       do od; i
%p A181611     end:
%p A181611 seq(a(n), n=1..121);  # _Alois P. Heinz_, Feb 05 2011
%t A181611 Table[Position[Reverse[Prepend[IntegerDigits[2^n], 0]],
%t A181611     0][[1]][[1]] - 1, {n, 121}]
%o A181611 (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
%Y A181611 Cf. A031142, A031141.
%Y A181611 Cf. A000079, A215887.
%K A181611 nonn,base
%O A181611 1,4
%A A181611 _Tanya Khovanova_, Jan 30 2011