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-1 of 1 results.

A283188 A periodic sequence of 8-bit binary numbers for single-bit multi-frequency generation.

Original entry on oeis.org

255, 127, 191, 31, 207, 71, 163, 33, 240, 80, 152, 24, 236, 108, 174, 6, 215, 87, 179, 51, 235, 73, 137, 9, 252, 116, 180, 20, 198, 70, 170, 42, 251, 91, 155, 17, 229, 101, 165, 5, 220, 92, 186, 58, 234, 66, 130, 2, 247, 117, 189, 29, 205, 77, 169, 33, 242, 82, 146, 18, 238, 110, 174, 12, 221
Offset: 0

Views

Author

Andres Cicuttin, Mar 02 2017

Keywords

Comments

If the updating frequency of numbers is f, then the most significant bit (MSB) changes with frequency f, while the second MSB changes with f/2, the third MSB changes with f/3, fourth MSB with f/4, and so on till the least significant bit (LSB), which changes with f/8.
The length of the cyclic period is 1680 = lcm(2,4,6,8,10,12,14,16). Only 192 numbers are used out of the 256 possible 8-bit binary numbers. Possible number of repetitions within a cycle are 6, 8, 9, and 12.
For a fast continuous production of the sequence, it could be more efficient to implement a cyclic lookup table rather than calculating the numbers each time.
A similar sequence can be obtained from A272614 (excluding the first 8 terms) by selecting the 8 most significant bits after having removed the MSB.

Examples

			Binary expansions of the first 16 terms:
  [1, 1, 1, 1, 1, 1, 1, 1]
  [0, 1, 1, 1, 1, 1, 1, 1]
  [1, 0, 1, 1, 1, 1, 1, 1]
  [0, 0, 0, 1, 1, 1, 1, 1]
  [1, 1, 0, 0, 1, 1, 1, 1]
  [0, 1, 0, 0, 0, 1, 1, 1]
  [1, 0, 1, 0, 0, 0, 1, 1]
  [0, 0, 1, 0, 0, 0, 0, 1]
  [1, 1, 1, 1, 0, 0, 0, 0]
  [0, 1, 0, 1, 0, 0, 0, 0]
  [1, 0, 0, 1, 1, 0, 0, 0]
  [0, 0, 0, 1, 1, 0, 0, 0]
  [1, 1, 1, 0, 1, 1, 0, 0]
  [0, 1, 1, 0, 1, 1, 0, 0]
  [1, 0, 1, 0, 1, 1, 1, 0]
  [0, 0, 0, 0, 0, 1, 1, 0]
		

Crossrefs

Cf. A272614.

Programs

  • Mathematica
    a[n_] := Sum[Floor@Mod[(n - k)/k, 2]*2^(8 - k), {k, 1, 8}];
    Table[a[n], {n, 0, 64}]
  • PARI
    a(n) = sum(k=1, 8, ((floor((n - k) / k)) % 2)*2^(8 - k)); \\ Indranil Ghosh, Mar 03 2017
    
  • Python
    def A283188(n):
        s=0
        for k in range(1,9):
            s+=(((n-k)//k)%2) * 2**(8-k)
        return s # Indranil Ghosh, Mar 03 2017

Formula

a(n) = Sum_{k = 1..8} (floor((n - k)/k) mod 2)*2^(8 - k).
Showing 1-1 of 1 results.