|
|
A373448
|
|
10^n-th binary palindrome.
|
|
1
|
|
|
0, 27, 2313, 249903, 24183069, 2258634081, 249410097687, 24350854001805, 2229543293296319, 248640535848971067, 24502928886295666773, 2255382216082613264687, 247524358984342778844555, 24637651997205933916917957, 2280497169597819727642768343, 246037303364254649637740936547
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
|
|
LINKS
|
|
|
PROG
|
(Python)
if n == 0: return 0
k = 10**n
a = 1<<(l:=k.bit_length()-2)
m = a|(k&a-1)
return (m<<l+1)+int(bin(m)[:1:-1]or'0', 2) if a&k else (m<<l)+int(bin(m)[-2:1:-1]or'0', 2)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|