OFFSET
1,3
COMMENTS
The binary expansion of a term > 1 can be split into two symmetrical parts of the same size (this size being a power of 2) (possibly after adjoining some leading 0's), and the first part contains at least one 1.
If m is a term, then A001196(m) is also a term.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, Binary plot of the terms < 2^16
Rémy Sigrist, PARI program for A345362
EXAMPLE
A345352(96) = 96, so 96 belongs to this sequence.
PROG
(PARI) is(n) = { my (b=binary(n), x); for (k=1, oo, x=2^k-#b; if (x>=0, b=concat(vector(x), b); return (n==fromdigits(concat(Vecrev(b[1..#b/2]), Vecrev(b[#b/2+1..#b])), 2)))) }
(PARI) See Links section.
(Python)
def A345352(n):
b = bin(n)[2:]
bb = bin(len(b))[2:]
if bb != '1' + '0'*(len(bb)-1): b = '0'*(2**len(bb) - len(b)) + b
return int(b[:len(b)//2][::-1] + b[len(b)//2:][::-1], 2)
def ok(n): return A345352(n) == n
print(list(filter(ok, range(9436)))) # Michael S. Branicky, Jun 16 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jun 16 2021
STATUS
approved