Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #18 Dec 26 2022 19:09:31
%S 3,11,42,32,20,154,130,1240,515,1033,610,3101,103,4010,56379,31809,
%T 35212,23103,7413,12101,1011,204,10391,92109,25013,812819,75099,
%U 8493016,437016,775009,287017,8029,457014,10503,26148108,10997,27445016,286092,231135007,480014
%N a(n) is the first number that is the start of a string of exactly n consecutive numbers in A358350.
%C 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.
%H Michael S. Branicky, <a href="/A359248/b359248.txt">Table of n, a(n) for n = 1..71</a>
%H Michael S. Branicky, <a href="/A359248/a359248.txt">All terms below 3.4*10^10</a>
%e 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.
%p f:= proc(n) local L; L:= convert(n,base,10); n + convert(L,`+`)+convert(L,`*`) end proc:
%p S:= select(`<=`,map(f,{$1..10^6}),10^6):
%p S:= sort(convert(S,list)):
%p V:= Vector(27):
%p a:= 1:
%p for x from 2 to nops(S) do
%p if S[x] - S[x-1] > 1 then
%p v:= x-a;
%p if v <= 27 and V[v] = 0 then V[v]:= S[a]; count:= count+1; fi;
%p a:= x;
%p fi
%p od:
%p convert(V,list);
%o (Python)
%o from math import prod
%o from itertools import islice
%o def sp(n): d = list(map(int, str(n))); return sum(d) + prod(d)
%o def agen(increment=10**6):
%o S, L, U, adict, rl, n = set(), 1, increment, dict(), 0, 1
%o while True:
%o S |= set(i + sp(i) for i in range(L, U))
%o for i in range(L, U):
%o if i in S: rl += 1
%o else:
%o if rl not in adict:
%o adict[rl] = i - rl
%o while n in adict: yield adict[n]; n += 1
%o rl = 0
%o S -= set(range(L, U))
%o L, U = U, U + increment
%o print(list(islice(agen(), 34))) # _Michael S. Branicky_, Dec 23 2022
%Y Cf. A358350.
%K nonn,base
%O 1,1
%A _Robert Israel_, Dec 22 2022
%E a(28)-a(40) from _Michael S. Branicky_, Dec 22 2022