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.

A272614 Numbers whose binary digits, except for the first "1", are given by floor(((k-n)/n) mod 2) with 1<=k<=n.

Original entry on oeis.org

1, 2, 6, 8, 28, 40, 104, 144, 496, 672, 1632, 2240, 7872, 11648, 27520, 33536, 120576, 175616, 445952, 629760, 2014208, 2701312, 6453248, 8712192, 33353728, 48881664, 114548736, 144949248, 476561408, 684687360, 1787789312, 2501836800, 8510177280, 11647451136, 27590000640
Offset: 0

Views

Author

Andres Cicuttin, May 03 2016

Keywords

Comments

Numbers such that the sequence of its binary digits change periodically with linearly increasing period depending of its position: after the first '1', k-th most significant bit changes with period 2*(k-1). For instance, the second most significant bit changes with period 2, third bit changes with period 4, fourth bit with period 6, and so on. For example on the first 15 terms we have:
a(n) Binary digits
1 1
2 1 0
6 1 1 0
8 1 0 0 0
28 1 1 1 0 0
40 1 0 1 0 0 0
104 1 1 0 1 0 0 0
144 1 0 0 1 0 0 0 0
496 1 1 1 1 1 0 0 0 0
672 1 0 1 0 1 0 0 0 0 0
1632 1 1 0 0 1 1 0 0 0 0 0
2240 1 0 0 0 1 1 0 0 0 0 0 0
7872 1 1 1 1 0 1 1 0 0 0 0 0 0
11648 1 0 1 1 0 1 1 0 0 0 0 0 0 0
27520 1 1 0 1 0 1 1 1 0 0 0 0 0 0 0
/ | | | | | \ etc.
MSB / | | | | Period 12
/ | | | \
Period 2 / | | Period 10
/ | \
Period 4 | Period 8
/
Period 6
Regarding the periodicity of the binary digits, this sequence is similar to A059893 where the periodicity of its binary digits are powers of two.
By truncating the least significant bits in such a way to leave only k most significant bits of a(n) with n>k-1, it is obtained a periodic sequence with period p given by p=Least common multiple (LCM) of {2,4,6,..,2k}. In general any subsequence obtained by a selection of a subset of its most significant bits including the most significant bit is periodic.

Crossrefs

Programs

  • Mathematica
    nmax = 34;
    a[n_] := 2^n + Sum[ Floor@Mod[(n - k)/k, 2]* 2^(n - k), {k, 1, n}];
    Table[a[n] , {n, 0, nmax}]
  • PARI
    a(n) = 2^n + sum(k=1, n, (floor(((n-k)/k)) % 2) * 2^(n-k)); \\ Michel Marcus, May 20 2016

Formula

a(n) = 2^n + Sum_{k=1..n}[floor(((n-k)/k) mod 2) * 2^(n-k)].