%I #15 Dec 25 2021 02:33:41
%S 1,2,4,8,1,3,6,18,26,52,12,24,49,89,134,378,656,117,224,548,1456,2912,
%T 4934,8868,1771,3543,6186,14178,28346,56792,17712,24434,49979,88949,
%U 119614,339338,679776,173937,247964,595838,1951276,2903552,4906114,8903228
%N Take alternate digits of 2^n.
%D GCHQ Director's Christmas Puzzles for 2015.
%H Michael S. Branicky, <a href="/A268516/b268516.txt">Table of n, a(n) for n = 0..6643</a>
%H GCHQ, <a href="http://s3-eu-west-1.amazonaws.com/puzzleinabucket/GCHQ_Puzzle_2015_-_Solutions.pdf">Solutions to Director's Christmas Puzzles for 2015</a>
%e 2^10 = 1024, so a(10) = 12 (omitting the 2nd and 4th digits).
%p a:= n-> (s-> parse(cat(seq(s[2*i+1],
%p i=0..(length(s)-1)/2))))(""||(2^n)):
%p seq(a(n), n=0..50); # _Alois P. Heinz_, Feb 08 2016
%o (PARI) a(n) = my(d = digits(2^n)); my(db = vector(ceil(#d/2), k, Str(d[2*k-1]))); eval(concat(db)); \\ _Michel Marcus_, Feb 08 2016
%o (Python)
%o def a(n): return int(str(2**n)[::2])
%o print([a(n) for n in range(44)]) # _Michael S. Branicky_, Dec 25 2021
%Y Cf. A000079.
%K nonn,base
%O 0,2
%A _N. J. A. Sloane_, Feb 08 2016
%E More terms from _Michel Marcus_, Feb 08 2016
|