A387312 a(n) is the action of "Rule 30" elementary cellular automaton on the binary representation of n if the cells may only expand into the significant bits.
0, 3, 7, 6, 14, 13, 13, 12, 28, 31, 27, 26, 26, 25, 25, 24, 56, 59, 63, 62, 54, 53, 53, 52, 52, 55, 51, 50, 50, 49, 49, 48, 112, 115, 119, 118, 126, 125, 125, 124, 108, 111, 107, 106, 106, 105, 105, 104, 104, 107, 111, 110, 102, 101, 101, 100, 100, 103, 99, 98, 98, 97, 97, 96, 224, 227, 231, 230, 238, 237, 237, 236, 252
Offset: 0
Examples
For a(7): 111 -> 1100, so a(7) = 12. For a(10): 1010 -> 11011, so a(10) = A269160(5) = 27.
Links
- Mia Boudreau, Table of n, a(n) for n = 0..9999
- Eric Weisstein's World of Mathematics, Rule 30
- The Wolfram Atlas of Simple Programs, Rule 30
Crossrefs
Cf. A269160.
Programs
-
C
unsigned long long a(unsigned long long n){ unsigned char rule = 30; unsigned long long x = 0; int l = sizeof(unsigned long long) * 8; for(int i = 0; i < l; i++) x|=((rule>>(((n>>(i+1)&(i
>i&1)<<1)|(n>>(i-1)&(i>0))))&1)<
Formula
a(2*n) = A269160(n).
Comments