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.

A378107 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, either a(n+1) is a multiple of a(n) or the decimal expansion of a(n+1) appears in that of a(n).

This page as a plain text file.
%I A378107 #9 Nov 18 2024 08:31:21
%S A378107 1,2,4,8,16,6,12,24,48,96,9,18,36,3,15,5,10,20,40,80,160,60,120,240,
%T A378107 480,960,1920,19,38,76,7,14,28,56,112,11,22,44,88,176,17,34,68,136,13,
%U A378107 26,52,104,208,416,41,82,164,64,128,256,25,50,100,200,400,800
%N A378107 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, either a(n+1) is a multiple of a(n) or the decimal expansion of a(n+1) appears in that of a(n).
%C A378107 Will every integer appear in the sequence?
%H A378107 Rémy Sigrist, <a href="/A378107/b378107.txt">Table of n, a(n) for n = 1..10000</a>
%H A378107 Rémy Sigrist, <a href="/A378107/a378107.gp.txt">PARI program</a>
%e A378107 The first terms are:
%e A378107   n   a(n)
%e A378107   --  ----
%e A378107    1     1
%e A378107    2     2
%e A378107    3     4
%e A378107    4     8
%e A378107    5    16
%e A378107    6     6      (6 appears in 16)
%e A378107    7    12
%e A378107    8    24
%e A378107    9    48
%e A378107   10    96
%e A378107   11     9      (9 appears in 96)
%e A378107   12    18
%e A378107   13    36
%e A378107   14     3      (3 appears in 36)
%e A378107   15    15
%o A378107 (PARI) \\ See Links section.
%o A378107 (Python)
%o A378107 from itertools import combinations, count, islice
%o A378107 def agen(): # generator of terms
%o A378107     an, aset = 1, {0, 1}
%o A378107     while True:
%o A378107         yield an
%o A378107         s = str(an)
%o A378107         subs = (int(s[i:j]) for i, j in combinations(range(len(s)+1), 2))
%o A378107         an1 = min((t for t in subs if t not in aset), default=-1)
%o A378107         if an1 == -1:
%o A378107             an = next(k*an for k in count(2) if k*an not in aset)
%o A378107         else:
%o A378107             an = an1
%o A378107         aset.add(an)
%o A378107 print(list(islice(agen(), 62))) # _Michael S. Branicky_, Nov 17 2024
%Y A378107 See A342072 and A378106 for similar sequences.
%K A378107 nonn,base
%O A378107 1,2
%A A378107 _Rémy Sigrist_, Nov 16 2024