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 A269166 #12 Feb 16 2025 08:33:30 %S A269166 0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,2,1,1,1,0,0,0,0,0, %T A269166 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,1,1,1,0,1,0,0,0,0,0,0,1,0,0,0,0, %U A269166 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,0,1,1,1,1,1,0,0,3,1,0,0,0,0,0,0,1,0 %N A269166 If A269162(n) = 0, then a(n) = 0, otherwise a(n) = 1 + a(A269162(n)). %C A269166 a(n) gives the generational distance to the earliest finite ancestor when the binary expansion of n is interpreted as a pattern in Wolfram's Rule-30 cellular automaton or 0 if that pattern has no finite predecessors. %C A269166 A110240 gives the record positions (after zero) and particularly, for n > 0, A110240(n) gives the first occurrence of n in this sequence. %C A269166 See also comments in A269165. %H A269166 Antti Karttunen, <a href="/A269166/b269166.txt">Table of n, a(n) for n = 0..32767</a> %H A269166 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Rule30.html">Rule 30</a> %H A269166 <a href="/index/Ce#cell">Index entries for sequences related to cellular automata</a> %H A269166 <a href="https://oeis.org/wiki/Index_to_Elementary_Cellular_Automata">Index to Elementary Cellular Automata</a> %F A269166 If A269162(n) = 0, then a(n) = 0, otherwise a(n) = 1 + a(A269162(n)). %F A269166 Other identities. For all n >= 0: %F A269166 a(A110240(n)) = n. [Works as a left inverse of sequence A110240.] %o A269166 (Scheme) %o A269166 ;; This implementation is based on given recurrence and utilitizes the memoization-macro definec: %o A269166 (definec (A269166 n) (let ((p (A269162 n))) (if (zero? p) 0 (+ 1 (A269166 p))))) %o A269166 ;; This one computes the same with tail-recursive iteration: %o A269166 (define (A269166 n) (let loop ((n n) (p (A269162 n)) (s 0)) (if (zero? p) s (loop p (A269162 p) (+ 1 s))))) %Y A269166 Cf. A110240, A269160, A269162. %Y A269166 Cf. A269164 (the indices of zeros after the initial zero). %Y A269166 Cf. A269165 (the earliest finite ancestor for n). %Y A269166 Cf. also A268389. %K A269166 nonn %O A269166 0,26 %A A269166 _Antti Karttunen_, Feb 21 2016