cp's OEIS Frontend

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.

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.

Original entry on oeis.org

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

Views

Author

Mia Boudreau, Aug 25 2025

Keywords

Comments

A269160 allows cells to expand in both directions; its example gives 111 -> 11001 (as opposed to this 111 -> 1100). This sequence does not allow the cells to expand into the least significant bits.
A269160 is a subsequence.
When calculating the LSB edge, the out-of-bounds cell is taken to be 0.

Examples

			For a(7): 111 -> 1100, so a(7) = 12.
For a(10): 1010 -> 11011, so a(10) = A269160(5) = 27.
		

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).