cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A359248 a(n) is the first number that is the start of a string of exactly n consecutive numbers in A358350.

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