login
A359248
a(n) is the first number that is the start of a string of exactly n consecutive numbers in A358350.
1
3, 11, 42, 32, 20, 154, 130, 1240, 515, 1033, 610, 3101, 103, 4010, 56379, 31809, 35212, 23103, 7413, 12101, 1011, 204, 10391, 92109, 25013, 812819, 75099, 8493016, 437016, 775009, 287017, 8029, 457014, 10503, 26148108, 10997, 27445016, 286092, 231135007, 480014
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
a(3) = 42 because the three consecutive numbers 42, 43 and 44 are in A358350 but 41 and 45 are not, and this is the first string of exactly three consecutive numbers in A358350.
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
Cf. A358350.
Sequence in context: A358426 A096147 A225431 * A099489 A077830 A106460
KEYWORD
nonn,base
AUTHOR
Robert Israel, Dec 22 2022
EXTENSIONS
a(28)-a(40) from Michael S. Branicky, Dec 22 2022
STATUS
approved