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.
%I A367619 #14 Feb 07 2024 13:21:43 %S A367619 1,2,3,3,1,1,7,1,2,2,7,1,1,2,1,1,1,1,7,1,1,2,1,7,1,7,1,1,1,1,1,1,7,7, %T A367619 1,1,1,7,1,1,1,1,1,1,7,7,1,1,1,7,1,1,1,1,1,1,1,7,1,1,1,1,7,1,7,1,1,1, %U A367619 1,1,1,1,7,1,1,1,1,7,1,7,1,1,1,1,1,1,7 %N A367619 a(n) is the most remote positive ancestor of n in the comma-child graph in base 3. %C A367619 Analogous to A367617, but the calculations are done in base 3. %C A367619 See A367338 for definitions of comma-child. %C A367619 The sequence consists entirely of terms in {1, 2, 3, 7}. In particular, two terms, a(3) = a(4) = 3; five terms, a(2,9,10,14,22) = 2; and 490 terms are 7, ending with a(2182). All other terms a(k) are 1, since a(2183..2190) = 1 and 1 <= p(n) - n <= b^2 - 1 (= 8 for base b = 3). %H A367619 Michael S. Branicky, <a href="/A367619/b367619.txt">Table of n, a(n) for n = 1..2200</a> %H A367619 Eric Angelini, Michael S. Branicky, Giovanni Resta, N. J. A. Sloane, and David W. Wilson, The Comma Sequence: A Simple Sequence With Bizarre Properties, <a href="http://arxiv.org/abs/2401.14346">arXiv:2401.14346</a>, <a href="https://www.youtube.com/watch?v=_EHAdf6izPI">Youtube</a> %F A367619 a(n) is defined as n if A367618(n) = -1, else A367618(A367618(n)). %o A367619 (Python) %o A367619 from functools import cache %o A367619 from sympy.ntheory.factor_ import digits %o A367619 def comma_parent(n, base=3): # A367618(n) %o A367619 y = digits(n, base)[1] %o A367619 x = (n-y)%base %o A367619 k = n - y - base*x %o A367619 return k if k > 0 else -1 %o A367619 @cache %o A367619 def a(n): %o A367619 cp = comma_parent(n) %o A367619 if cp <= 0: return n %o A367619 return a(cp) %o A367619 print([a(n) for n in range(1, 88)]) %Y A367619 Cf. A367338, A367355, A367617, A367618. %K A367619 nonn,base %O A367619 1,2 %A A367619 _Michael S. Branicky_ and _N. J. A. Sloane_, Dec 20 2023