OFFSET
0,3
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10000
Scott R. Shannon, Image of the first 1000000 terms. The green line is a(n) = n.
EXAMPLE
The first terms, alongside a(n) + a(n+1), are:
n a(n) a(n)+a(n+1)
-- ---- -----------
0 0 1
1 1 3
2 2 5
3 3 7
4 4 9
5 5 12
6 7 13
7 6 14
8 8 17
9 9 19
10 10 21
PROG
(PARI) s=0; v=1; for (n=1, 67, print1 (v", "); s+=2^v; for (w=1, oo, if (!bittest(s, w) && #(d=digits(v+w))==#Set(d), v=w; break)))
(Python)
def agen():
alst, aset, min_unused = [0], {0}, 1
yield 0
while True:
an = min_unused
while True:
while an in aset: an += 1
t = str(alst[-1] + an)
if len(t) == len(set(t)):
alst.append(an); aset.add(an); yield an
if an == min_unused: min_unused = min(set(range(max(aset)+2))-aset)
break
an += 1
g = agen()
print([next(g) for n in range(77)]) # Michael S. Branicky, Mar 11 2021
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Jul 22 2020.
EXTENSIONS
a(0)=0 added by N. J. A. Sloane, Mar 14 2021
STATUS
approved