OFFSET
1,1
COMMENTS
Lexicographically earliest sequence of distinct positive terms with this property.
Numbers with an odd digit length cannot be in this sequence.
EXAMPLE
a(1) + a(2) = 10 + 1090 = 1100 (which has an equal number of even and odd digits);
a(2) + a(3) = 1090 + 12 = 1102 (idem);
a(3) + a(4) = 12 + 18 = 30 (idem);
a(4) + a(5) = 18 + 14 = 32 (idem); etc.
PROG
(Python)
def cond(i):
stri = str(i)
se = sum(1 for d in stri if d in "02468")
so = sum(1 for d in stri if d in "13579")
return se == so
def aupto(nn):
alst, used = [0], set()
for n in range(1, nn+1):
an = 10
while True:
while an in used: an += 1
if cond(an) and cond(an + alst[-1]):
alst.append(an); used.add(an); break
an += 1
return alst[1:] # use alst[n] for a(n)
print(aupto(56)) # Michael S. Branicky, Dec 14 2020
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Dec 14 2020
STATUS
approved