OFFSET
0,1
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.
FORMULA
a(n) = Sum_{k = 1..8} (floor((n - k)/k) mod 2)*2^(8 - k).
EXAMPLE
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]
MATHEMATICA
a[n_] := Sum[Floor@Mod[(n - k)/k, 2]*2^(8 - k), {k, 1, 8}];
Table[a[n], {n, 0, 64}]
PROG
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Andres Cicuttin, Mar 02 2017
STATUS
approved
