OFFSET
1,1
COMMENTS
a(n) is the least k such that k, k+1, ..., k+n-1 are in A358350 but k-1 and k+n are not.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..71
Michael S. Branicky, All terms below 3.4*10^10
EXAMPLE
MAPLE
f:= proc(n) local L; L:= convert(n, base, 10); n + convert(L, `+`)+convert(L, `*`) end proc:
S:= select(`<=`, map(f, {$1..10^6}), 10^6):
S:= sort(convert(S, list)):
V:= Vector(27):
a:= 1:
for x from 2 to nops(S) do
if S[x] - S[x-1] > 1 then
v:= x-a;
if v <= 27 and V[v] = 0 then V[v]:= S[a]; count:= count+1; fi;
a:= x;
fi
od:
convert(V, list);
PROG
(Python)
from math import prod
from itertools import islice
def sp(n): d = list(map(int, str(n))); return sum(d) + prod(d)
def agen(increment=10**6):
S, L, U, adict, rl, n = set(), 1, increment, dict(), 0, 1
while True:
S |= set(i + sp(i) for i in range(L, U))
for i in range(L, U):
if i in S: rl += 1
else:
if rl not in adict:
adict[rl] = i - rl
while n in adict: yield adict[n]; n += 1
rl = 0
S -= set(range(L, U))
L, U = U, U + increment
print(list(islice(agen(), 34))) # Michael S. Branicky, Dec 23 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Dec 22 2022
EXTENSIONS
a(28)-a(40) from Michael S. Branicky, Dec 22 2022
STATUS
approved