A269166 If A269162(n) = 0, then a(n) = 0, otherwise a(n) = 1 + a(A269162(n)).
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, 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, 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
Offset: 0
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 0..32767
- Eric Weisstein's World of Mathematics, Rule 30
- Index entries for sequences related to cellular automata
- Index to Elementary Cellular Automata
Crossrefs
Programs
-
Scheme
;; This implementation is based on given recurrence and utilitizes the memoization-macro definec: (definec (A269166 n) (let ((p (A269162 n))) (if (zero? p) 0 (+ 1 (A269166 p))))) ;; This one computes the same with tail-recursive iteration: (define (A269166 n) (let loop ((n n) (p (A269162 n)) (s 0)) (if (zero? p) s (loop p (A269162 p) (+ 1 s)))))
Comments