OFFSET
1,2
COMMENTS
EXAMPLE
The first terms, with their binary expansion and an appropriate cyclic shift, are:
n a(n) bin(a(n)) cyc
-- ---- --------- ------
1 0 0 0
2 2 10 01
3 4 100 001
4 8 1000 0001
5 9 1001 0110
6 10 1010 0101
7 12 1100 0011
8 16 10000 00001
9 17 10001 00110
10 18 10010 00101
11 20 10100 01001
12 24 11000 00011
13 32 100000 000001
14 33 100001 000110
15 34 100010 000101
16 35 100011 011100
PROG
(PARI) is(n) = { my (x = max(exponent(n), 0), s = n); for (i = 0, x, s = (s >> 1) + if (s%2, 2^x, 0); if (bitand(s, n)==0, return (1); ); ); return (0); }
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, Jul 15 2024
STATUS
approved