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 A269160 #42 Feb 16 2025 08:33:30 %S A269160 0,7,14,13,28,27,26,25,56,63,54,53,52,51,50,49,112,119,126,125,108, %T A269160 107,106,105,104,111,102,101,100,99,98,97,224,231,238,237,252,251,250, %U A269160 249,216,223,214,213,212,211,210,209,208,215,222,221,204,203,202,201,200,207,198,197,196,195,194,193,448,455,462 %N A269160 Formula for Wolfram's Rule 30 cellular automaton: a(n) = n XOR (2n OR 4n). %C A269160 Take n, write it in binary, see what Rule 30 would do to that state, convert it to decimal: that is a(n). For example, we can see in A110240 that 7 = 111_2 becomes 25 = 11001_2 under Rule 30, which is shown here by a(7) = 25. - _N. J. A. Sloane_, Nov 25 2016 %C A269160 The sequence is injective: no value occurs more than once. %C A269160 Fibbinary numbers (A003714) give all integers n>=0 for which a(n) = A048727(n) and for which a(n) = A269161(n). %H A269160 Antti Karttunen, <a href="/A269160/b269160.txt">Table of n, a(n) for n = 0..16383</a> %H A269160 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Rule30.html">Rule 30</a> %H A269160 <a href="/index/Ce#cell">Index entries for sequences related to cellular automata</a> %H A269160 <a href="https://oeis.org/wiki/Index_to_Elementary_Cellular_Automata">Index to Elementary Cellular Automata</a> %F A269160 a(n) = n XOR (2n OR 4n) = A003987(n, A003986(2*n, 4*n)). %F A269160 Other identities. For all n >= 0: %F A269160 a(2*n) = 2*a(n). %F A269160 a(n) = A057889(A269161(A057889(n))). [Rule 30 is the mirror image of rule 86.] %F A269160 A269162(a(n)) = n. %F A269160 For all n >= 1: %F A269160 A070939(a(n)) - A070939(n) = 2. [The binary length of a(n) is two bits longer than that of n for all nonzero values.] %F A269160 G.f.: (3*x + 2*x^2 +x^3)/(1 - x^4) + Sum_{k>=1}(2^(k + 1)*x^(2^(k - 1))/((1 + x^(2^(k + 1)))*(1 - x))). - _Miles Wilson_, Jan 24 2025 %t A269160 a[n_] := BitXor[n, BitOr[2n, 4n]]; Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Feb 23 2016 *) %o A269160 (Scheme) (define (A269160 n) (A003987bi n (A003986bi (* 4 n) (* 2 n)))) ;; Where A003986bi and A003987bi are implementation of dyadic functions giving bitwise-OR (A003986) and bitwise-XOR (A003987) of their arguments. %o A269160 (PARI) a(n) = bitxor(n, bitor(2*n, 4*n)); \\ _Michel Marcus_, Feb 23 2016 %o A269160 (Python) %o A269160 def A269160(n): return n^(n<<1 | n<<2) # _Chai Wah Wu_, Jun 29 2022 %Y A269160 Cf. A003714, A003986, A003987, A057889, A070939. %Y A269160 Cf. A110240 (iterates starting from 1). %Y A269160 Cf. A269162 (left inverse). %Y A269160 Cf. A269163 (same sequence sorted into ascending order). %Y A269160 Cf. A269164 (values missing from this sequence). %Y A269160 Cf. also A048727, A269161. %K A269160 nonn %O A269160 0,2 %A A269160 _Antti Karttunen_, Feb 20 2016