OFFSET
1,2
COMMENTS
LINKS
EXAMPLE
The first terms, alongside their binary expansions and A356352(a(n)), are:
n a(n) bin(a(n)) A356352(a(n))
-- ---- ---------- -------------
1 0 0 0
2 3 11 2
3 7 111 3
4 12 1100 2
5 15 1111 4
6 31 11111 5
7 48 110000 2
8 51 110011 2
9 56 111000 3
10 60 111100 2
11 63 111111 6
12 127 1111111 7
13 192 11000000 2
14 195 11000011 2
15 204 11001100 2
16 207 11001111 2
PROG
(PARI) is(n) = { my (r=[]); while (n, my (v=valuation(n+n%2, 2)); n\=2^v; r=concat(v, r)); gcd(r)!=1 }
(PARI) See Links section.
(Python)
from math import gcd
from itertools import groupby
def ok(n):
if n == 0: return True # by convention of A356352
return gcd(*(len(list(g)) for k, g in groupby(bin(n)[2:]))) != 1
print([k for k in range(3268) if ok(k)]) # Michael S. Branicky, Oct 15 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Oct 15 2022
STATUS
approved