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.

A363186 Lexicographically earliest sequence of distinct positive integers such that the sum of all terms a(1)..a(n) is a substring of the concatenation of all terms a(1)..a(n).

This page as a plain text file.
%I A363186 #17 Feb 08 2024 09:46:24
%S A363186 1,10,98,767,111,122,2,11,100,889,110,4490,400,560,1096,124,20,129,70,
%T A363186 502,93,171,212,361,512,26,21,36,54,14,1011,139,99,59,550,684,345,102,
%U A363186 1021,1999,2871,137,892,89,126,875,510,994,586,2012,662,1836,201,405,388,2007,2798,1641,50,340
%N A363186 Lexicographically earliest sequence of distinct positive integers such that the sum of all terms a(1)..a(n) is a substring of the concatenation of all terms a(1)..a(n).
%C A363186 In the first 10000 terms the smallest number that has not yet appeared is 696; it is therefore likely all numbers eventually appear although this is unknown.
%H A363186 Scott R. Shannon, <a href="/A363186/b363186.txt">Table of n, a(n) for n = 1..10000</a>
%H A363186 Eric Angelini, <a href="http://cinquantesignes.blogspot.com/2023/07/echecs-et-maths.html">Échecs et Maths</a>, Personal blog, July 2023.
%e A363186 a(2) = 10 as a(1) + 10 = 1 + 10 = 11 which is a substring of "1" + "10" = "110".
%e A363186 a(3) = 98 as a(1) + a(2) + 98 = 1 + 10 + 98 = 109 which is a substring of "1" + "10" + "98" = "11098".
%e A363186 a(4) = 767 as a(1) + a(2) + a(3) + 767 = 1 + 10 + 98 + 767 = 876 which is a substring of "1" + "10" + "98" + "767" = "11098767".
%o A363186 (Python)
%o A363186 from itertools import islice
%o A363186 def agen(): # generator of terms
%o A363186     s, mink, aset, concat = 1, 2, {1}, "1"
%o A363186     yield from [1]
%o A363186     while True:
%o A363186         an = mink
%o A363186         while an in aset or not str(s+an) in concat+str(an): an += 1
%o A363186         aset.add(an); s += an; concat += str(an); yield an
%o A363186         while mink in aset: mink += 1
%o A363186 print(list(islice(agen(), 60))) # _Michael S. Branicky_, Feb 08 2024
%Y A363186 Cf. A359482, A300000, A339144, A357082.
%K A363186 nonn,base
%O A363186 1,2
%A A363186 _Scott R. Shannon_ and _Eric Angelini_, Jul 07 2023