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.

A357377 a(0) = 0; for n > 0, a(n) is the smallest positive number not occurring earlier such that |a(n) - a(n-1)| does not appear in the string concatenation of a(0)..a(n-1).

This page as a plain text file.
%I A357377 #12 Jan 16 2023 09:10:46
%S A357377 0,1,3,5,7,9,11,13,15,17,19,21,25,2,6,10,14,22,4,12,20,28,44,8,24,40,
%T A357377 56,18,34,50,23,39,55,26,42,58,29,45,61,31,47,63,27,43,59,75,37,53,69,
%U A357377 85,36,52,68,30,46,62,78,94,110,33,49,65,81,97,113,41,57,73,35,51,67,105,143,16,54
%N A357377 a(0) = 0; for n > 0, a(n) is the smallest positive number not occurring earlier such that |a(n) - a(n-1)| does not appear in the string concatenation of a(0)..a(n-1).
%C A357377 The sequence is conjectured to be a permutation of the positive integers. In the first 200000 terms the only fixed points are 20, 24, 43 and 115. It is likely no more exist although this is unknown.
%C A357377 There are no other fixed points in the first 870000 terms. - _Michael S. Branicky_, Oct 05 2022
%H A357377 Scott R. Shannon, <a href="/A357377/a357377.png">Image for n=0..200000</a>. The green line is a(n) = n.
%e A357377 a(12) = 25 as the concatenation of a(0)..a(11) is "013579111315171921" and |25 - a(11)| = |25 - 21| = 4 which does not appear in the concatenated string. Since a(11) contains a '2' and all other odd numbers appear in the string a(12) cannot be 23 or any even number less than 25.
%e A357377 a(13) = 2 as the concatenation of a(0)..a(12) is "01357911131517192125" and |2 - a(12)| = |2 - 25| = 23 which does not appear in the concatenated string.
%o A357377 (Python)
%o A357377 from itertools import count, islice
%o A357377 def agen(): # generator of terms
%o A357377     alst, aset, astr, an, mink, mindiff = [], set(), "", 0, 1, 1
%o A357377     for n in count(0):
%o A357377         yield an; aset.add(an); astr += str(an)
%o A357377         prevan, an = an, mink
%o A357377         while an + mindiff <= prevan and (an in aset or str(abs(an-prevan)) in astr): an += 1
%o A357377         if an in aset or str(abs(an-prevan)) in astr:
%o A357377             an = max(mink, prevan + mindiff)
%o A357377             while an in aset or str(an-prevan) in astr:
%o A357377                 an += 1
%o A357377         while mink in aset: mink += 1
%o A357377         while str(mindiff) in astr: mindiff += 1
%o A357377 print(list(islice(agen(), 75))) # _Michael S. Branicky_, Oct 05 2022
%Y A357377 Cf. A355611 (base 2), A357082, A007088, A030302, A118248, A341766.
%K A357377 nonn,base,look
%O A357377 0,3
%A A357377 _Scott R. Shannon_, Sep 26 2022