login
A361944
a(n) is the least k > 0 such that the binary expansion of k*n is an abelian square (A272653).
1
3, 5, 1, 9, 2, 6, 9, 17, 1, 1, 3, 3, 10, 11, 1, 33, 2, 2, 10, 26, 3, 6, 2, 22, 6, 5, 2, 21, 25, 5, 33, 65, 1, 1, 18, 1, 6, 5, 4, 13, 15, 14, 1, 3, 1, 1, 5, 11, 3, 3, 1, 3, 1, 1, 3, 41, 9, 37, 11, 10, 3, 39, 1, 129, 2, 2, 3, 2, 9, 9, 8, 11, 3, 3, 2, 27, 2, 2, 3
OFFSET
1,1
FORMULA
a(n) = A361943(n) / n.
a(n) = 1 iff n belongs to A272653.
EXAMPLE
a(8) = A361943(8)/8 = 136/8 = 17.
PROG
(PARI) a(n) = { forstep (m = n, oo, n, my (w = #binary(m)); if (w%2==0 && hammingweight(m)==2*hammingweight(m % (2^(w/2))), return (m/n))) }
(Python)
from itertools import count
def a(n): return next(m//n for m in count(n, n) if not (w:= m.bit_length())&1 and m.bit_count() == ((m>>(w>>1)).bit_count())<<1)
print([a(n) for n in range(1, 80)]) # Michael S. Branicky, Mar 31 2023 after Rémy Sigrist
CROSSREFS
Sequence in context: A235605 A212695 A209422 * A320386 A112411 A283838
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 31 2023
STATUS
approved