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.

Showing 1-2 of 2 results.

A356195 The binary expansion of a(n) is obtained by applying the totalistic cellular automaton with rule 2*n to the binary expansion of n.

Original entry on oeis.org

0, 1, 0, 3, 0, 6, 3, 7, 0, 14, 3, 14, 0, 9, 7, 15, 0, 30, 3, 30, 0, 25, 7, 30, 0, 16, 12, 29, 7, 23, 15, 31, 0, 62, 3, 62, 0, 57, 7, 62, 0, 48, 12, 61, 7, 55, 15, 62, 0, 32, 28, 60, 7, 38, 28, 61, 0, 33, 19, 51, 15, 47, 31, 63, 0, 126, 3, 126, 0, 121, 7, 126
Offset: 0

Views

Author

Rémy Sigrist, Jul 29 2022

Keywords

Comments

To compute the binary expansion of a(n):
- we scan the binary digits of n from right to left,
- at some position k >= 0 (0 corresponding to the least significant bit):
- we count the number of 1's at positions >= k, say we have w 1's,
- if 2^w appears in the binary expansion of 2*n,
then we insert a 1,
otherwise we insert a 0,
- as we are considering an even automaton (with rule 2*n),
once scanning the leading 0's of n, we will only insert 0's,
- and the result will have finitely many 1's.
More formally: 2^k appears in the binary expansion of a(n) iff 2^A000120(floor(n/2^k)) appears in the binary expansion of 2*n.

Examples

			For n = 43:
- the binary expansion of 2*43 is "1010110",
- so we apply the following totalistic cellular automaton:
       w   | >=7  6   5   4   3   2   1   0
       out |  0   1   0   1   0   1   1   0
- scanning the binary expansion of n, we obtains:
    bin(n)    | 1   0   1   0   1   1
    w         | 1   1   2   2   3   4
    bin(a(n)) | 1   1   1   1   0   1
- so a(n) = 61.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=0, m=n); for (k=0, oo, if (m==0, return (v), bittest(2*n, hammingweight(m)), v+=2^k); m\=2) }

Formula

a(n) = n iff n belongs to A000225.
a(n) = 0 iff n AND A038573(n) = 0 (where AND denotes the bitwise AND operator).

A356215 The binary expansion of a(n) is obtained by applying the elementary cellular automaton with rule (2*n) mod 16 to the binary expansion of n.

Original entry on oeis.org

0, 1, 1, 2, 0, 5, 3, 7, 0, 9, 5, 14, 4, 13, 7, 15, 0, 17, 9, 26, 0, 21, 11, 31, 0, 17, 5, 22, 12, 29, 15, 31, 0, 33, 17, 50, 0, 37, 19, 55, 0, 41, 21, 62, 4, 45, 23, 63, 0, 33, 9, 42, 16, 53, 27, 63, 0, 33, 5, 38, 28, 61, 31, 63, 0, 65, 33, 98, 0, 69, 35, 103
Offset: 0

Views

Author

Rémy Sigrist, Jul 29 2022

Keywords

Comments

This sequence is a variant of A352528; here the cellular automaton maps 2 cells into 1, there 3 cells into 1.
The binary digit of a(n) at place value 2^k is a function of the binary digits of n at place values 2^(k+1) and 2^k (and of (2*n) mod 256).
We use even elementary cellular automaton rules, so "00" will always evolve to "0", and the binary expansion of a(n) will have finitely many 1's and will be correctly defined.

Examples

			For n = 11:
- we use rule 22 mod 16 = 6,
- the binary expansion of 6 is "0110", so we apply the following evolutions:
      11  10  01  00
       |   |   |   |
       v   v   v   v
       0   1   1   0
- the binary expansion of 11 (with a leading 0's) is    "...01011",
- the binary digit of a(11) at place value 2^0 is 0 (from     "11"),
- the binary digit of a(11) at place value 2^1 is 1 (from    "01"),
- the binary digit of a(11) at place value 2^2 is 1 (from   "10"),
- the binary digit of a(11) at place value 2^3 is 1 (from  "01"),
- the binary digit of a(11) at other places    is 0 (from "00"),
- so the binary expansion of a(11) is "1110",
- and a(11) = 14.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=0, m=n); for (k=0, oo, if (m==0, return (v), bittest(2*n, m%4), v+=2^k); m\=2) }

Formula

a(2^k-1) = 2^k-1 for any k <> 2.
a(2^k) = 0 for any k > 1.
Showing 1-2 of 2 results.