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).
1, 10, 98, 767, 111, 122, 2, 11, 100, 889, 110, 4490, 400, 560, 1096, 124, 20, 129, 70, 502, 93, 171, 212, 361, 512, 26, 21, 36, 54, 14, 1011, 139, 99, 59, 550, 684, 345, 102, 1021, 1999, 2871, 137, 892, 89, 126, 875, 510, 994, 586, 2012, 662, 1836, 201, 405, 388, 2007, 2798, 1641, 50, 340
Offset: 1
Examples
a(2) = 10 as a(1) + 10 = 1 + 10 = 11 which is a substring of "1" + "10" = "110". a(3) = 98 as a(1) + a(2) + 98 = 1 + 10 + 98 = 109 which is a substring of "1" + "10" + "98" = "11098". 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".
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..10000
- Eric Angelini, Échecs et Maths, Personal blog, July 2023.
Programs
-
Python
from itertools import islice def agen(): # generator of terms s, mink, aset, concat = 1, 2, {1}, "1" yield from [1] while True: an = mink while an in aset or not str(s+an) in concat+str(an): an += 1 aset.add(an); s += an; concat += str(an); yield an while mink in aset: mink += 1 print(list(islice(agen(), 60))) # Michael S. Branicky, Feb 08 2024
Comments