A269165 If A269162(n) = 0, then a(n) = n, otherwise a(n) = a(A269162(n)).
0, 1, 2, 3, 4, 5, 6, 1, 8, 9, 10, 11, 12, 3, 2, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1, 6, 5, 4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 15, 2, 3, 12, 11, 10, 55, 8, 57, 58, 59, 60, 61, 62, 9, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81
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 (A269165 n) (let ((p (A269162 n))) (if (zero? p) n (A269165 p)))) ;; This one computes the same with tail-recursive iteration: (define (A269165 n) (let loop ((n n) (p (A269162 n))) (if (zero? p) n (loop p (A269162 p)))))
Comments