OFFSET
0,3
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10000
Rémy Sigrist, PARI program
Rémy Sigrist, Perl program
EXAMPLE
A357082(42) = 47, hence a(47) = 42.
PROG
(PARI) See Links section.
(Perl) See Links section.
(Python)
from itertools import islice
def agen():
aset, appearsat, astr, an, mink, nn = {0}, {0: 0}, "0", 0, 1, 0
for n in count(1):
k = mink
while k in aset or bin(an+k)[2:] in astr: k += 1
while mink in aset: mink += 1
an = k; aset.add(an); astr += bin(an)[2:]; appearsat[an] = n
while nn in appearsat: yield appearsat[nn]; nn += 1
print(list(islice(agen(), 68))) # Michael S. Branicky, Sep 16 2022
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Sep 16 2022
STATUS
approved