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.

A370046 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest unused positive number whose binary value is a substring of the binary value of the sum of all previous terms.

This page as a plain text file.
%I A370046 #16 Feb 09 2024 04:46:04
%S A370046 1,2,3,6,4,8,12,9,5,18,17,10,7,19,14,16,11,20,13,24,22,15,32,36,34,25,
%T A370046 23,37,27,21,26,64,69,40,43,29,30,35,39,44,28,42,53,129,72,38,31,81,
%U A370046 45,50,46,47,49,74,41,54,55,51,52,57,58,128,68,70,140,77,60,139,85,33,75,61,59,62,48
%N A370046 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest unused positive number whose binary value is a substring of the binary value of the sum of all previous terms.
%C A370046 The fixed points begin 1, 2, 3, 16, 39, 42, 50, 79, 120, 361, although it is likely there are infinitely more. The sequence is conjectured to be a permutation of the positive numbers.
%H A370046 Scott R. Shannon, <a href="/A370046/b370046.txt">Table of n, a(n) for n = 1..10000</a>
%H A370046 Scott R. Shannon, <a href="/A370046/a370046.png">Image of the first 50000 terms</a>.
%F A370046 a(n) = A317788(n) for any n >= 3. - _Rémy Sigrist_, Feb 09 2024
%e A370046 a(7) = 12 as the sum of all previous terms is 1 + 2 + 3 + 6 + 4 + 8 = 24 = 11000_2 and 12 = 1100_2 is the smallest unused number that is a substring of "11000".
%o A370046 (Python)
%o A370046 from itertools import islice
%o A370046 def agen(): # generator of terms
%o A370046     s, mink, aset = 3, 3, {1, 2}
%o A370046     yield from [1, 2]
%o A370046     while True:
%o A370046         an, ss = mink, bin(s)[2:]
%o A370046         while an in aset or not bin(an)[2:] in ss: an += 1
%o A370046         aset.add(an); s += an; yield an
%o A370046         while mink in aset: mink += 1
%o A370046 print(list(islice(agen(), 75))) # _Michael S. Branicky_, Feb 08 2024
%Y A370046 Cf. A317788, A369899 (base 10), A363186, A333410.
%K A370046 nonn,base
%O A370046 1,2
%A A370046 _Scott R. Shannon_, Feb 08 2024