OFFSET
1,12
COMMENTS
a(2n) = a(2n+1) for all n.
For m >=2, terms a(2^m) through a(2^(m+1)-1) are 0,0,1,1,2,2,3,3,..., 2^(m-1)-1, 2^(m-1)-1.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A053645(floor(n/2)) for n > 1. - Georg Fischer, Nov 29 2022
EXAMPLE
26 in binary is 11010. Take the middle digits 1(101)0 - > 101, which is 5 in decimal. Therefore a(26) = 5.
MAPLE
0, seq(seq(seq(k, j=0..1), k=0..2^(d-2)-1), d=2..7); # Robert Israel, Jun 19 2019
PROG
(PARI) a(n) = my(b = binary(n)); if (#b < 2, 0, fromdigits(vector(#b-2, k, b[k+1]), 2)); \\ Michel Marcus, May 29 2019
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Leroy Quet, Aug 09 2009
STATUS
approved