|
|
A268516
|
|
Take alternate digits of 2^n.
|
|
1
|
|
|
1, 2, 4, 8, 1, 3, 6, 18, 26, 52, 12, 24, 49, 89, 134, 378, 656, 117, 224, 548, 1456, 2912, 4934, 8868, 1771, 3543, 6186, 14178, 28346, 56792, 17712, 24434, 49979, 88949, 119614, 339338, 679776, 173937, 247964, 595838, 1951276, 2903552, 4906114, 8903228
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
REFERENCES
|
GCHQ Director's Christmas Puzzles for 2015.
|
|
LINKS
|
|
|
EXAMPLE
|
2^10 = 1024, so a(10) = 12 (omitting the 2nd and 4th digits).
|
|
MAPLE
|
a:= n-> (s-> parse(cat(seq(s[2*i+1],
i=0..(length(s)-1)/2))))(""||(2^n)):
|
|
PROG
|
(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
(Python)
def a(n): return int(str(2**n)[::2])
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|