OFFSET
1,3
COMMENTS
10 is obviously the first integer not present in the sequence as 1 > 0.
LINKS
Robert Israel, Table of n, a(n) for n = 1..4000
EXAMPLE
a(10) = 9 and a(11) = 13 sum up to 22: the three numbers have digits in nondecreasing order;
a(11) = 13 and a(12) = 11 sum up to 24 (same property);
a(12) = 11 and a(13) = 12 sum up to 23 (same property);
etc.
MAPLE
ND[1]:= [$1..9]:
for d from 2 to 5 do
ND[d]:= map(proc(t) local j; seq(10*t + j, j=(t mod 10) .. 9) end proc, ND[d-1])
od:
S:= [seq(op(ND[i]), i=1..5)]: nS:= nops(S):
isnd:= proc(x) member(x, ND[ilog10(x)+1]) end proc:
R:= 0: t:= 0:
for count from 2 to 100 do
found:= false;
for i from 1 to nS do
if isnd(t + S[i]) then
R:= R, S[i];
t:= S[i];
S:= subsop(i=NULL, S);
nS:= nS-1;
found:= true;
break
fi;
od;
if not found then break fi;
od:
R; # Robert Israel, Jul 14 2025
PROG
(Python)
def nondec(n): s = str(n); return s == "".join(sorted(s))
def aupton(terms):
alst = [0]
for n in range(2, terms+1):
an = 1
while True:
while an in alst: an += 1
if nondec(an) and nondec(alst[-1]+an): alst.append(an); break
else: an += 1
return alst
print(aupton(74)) # Michael S. Branicky, Mar 07 2021
CROSSREFS
KEYWORD
AUTHOR
Eric Angelini and Carole Dubois, Mar 07 2021
STATUS
approved
