A269174 Formula for Wolfram's Rule 124 cellular automaton: a(n) = (n OR 2n) AND ((n XOR 2n) OR (n XOR 4n)).
0, 3, 6, 7, 12, 15, 14, 11, 24, 27, 30, 31, 28, 31, 22, 19, 48, 51, 54, 55, 60, 63, 62, 59, 56, 59, 62, 63, 44, 47, 38, 35, 96, 99, 102, 103, 108, 111, 110, 107, 120, 123, 126, 127, 124, 127, 118, 115, 112, 115, 118, 119, 124, 127, 126, 123, 88, 91, 94, 95, 76, 79, 70, 67, 192, 195, 198, 199, 204, 207, 206, 203, 216
Offset: 0
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 0..32767
- Eric Weisstein's World of Mathematics, Elementary Cellular Automaton
- Stephen Wolfram, A New Kind of Science
- Index entries for sequences related to cellular automata
- Index to Elementary Cellular Automata
Crossrefs
Programs
-
Go
package main import "fmt" func main() { for n:=0; n<=100; n++{ fmt.Println((n|2*n)&((n^(2*n))|(n^(4*n))))} } // Indranil Ghosh, Apr 19 2017
-
Mathematica
a[n_] := BitAnd[BitOr[n, 2n], BitOr[BitXor[n, 2n], BitXor[n, 4n]]]; a /@ Range[0, 100] (* Jean-François Alcover, Feb 23 2020 *)
-
Python
def a(n): return (n|2*n)&((n^(2*n))|(n^(4*n))) # Indranil Ghosh, Apr 19 2017
-
Scheme
(define (A269174 n) (A004198bi (A163617 n) (A003986bi (A048724 n) (A048725 n))))
Formula
a(n) = (n OR 2n) AND ((n XOR 2n) OR (n XOR 4n)).
Other identities. For all n >= 0:
a(2*n) = 2*a(n).
G.f.: (-3*x^3 - 2*x^2 - 3*x)/(x^4 - 1) + Sum_{k>=1}((2^(k + 1)*x^(2^k) - 2^(k + 1)*x^(14*2^(k - 2)))/((x^(2^(k + 2)) - 1)*(x - 1))). - Miles Wilson, Jan 25 2025
Comments