OFFSET
1,3
COMMENTS
From Gus Wiseman, Dec 29 2023: (Start)
These are numbers whose binary indices are all powers of 2, where a binary index of n (row n of A048793) is any position of a 1 in its reversed binary expansion. For example, the terms together with their binary expansions and binary indices begin:
0: 0 ~ {}
1: 1 ~ {1}
2: 10 ~ {2}
3: 11 ~ {1,2}
8: 1000 ~ {4}
9: 1001 ~ {1,4}
10: 1010 ~ {2,4}
11: 1011 ~ {1,2,4}
128: 10000000 ~ {8}
129: 10000001 ~ {1,8}
130: 10000010 ~ {2,8}
131: 10000011 ~ {1,2,8}
136: 10001000 ~ {4,8}
137: 10001001 ~ {1,4,8}
138: 10001010 ~ {2,4,8}
139: 10001011 ~ {1,2,4,8}
For powers of 3 we have A368531.
(End)
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..4096
Lorenzo Sauras-Altuzarra, Some arithmetical problems that are obtained by analyzing proofs and infinite graphs, arXiv:2002.03075 [math.NT], 2020.
FORMULA
a(n) = A358126(n-1) / 2. - Tilman Piesk, Dec 18 2022
a(2^n+1) = 2^(2^n-1) = A058891(n+1). - Gus Wiseman, Dec 29 2023
a(2^n) = A072639(n). - Gus Wiseman, Dec 29 2023
G.f.: 1/(1-x) * Sum_{k>=0} (2^(-1+2^k))*x^2^k/(1+x^2^k). - John Tyler Rascoe, May 22 2024
MAPLE
a := proc(n) local k, A:
A := [seq(0, i=1..n)]: A[1]:=0:
for k from 1 to n-1 do
A[k+1] := A[k-2^ilog2(k)+1]+2^(2^ilog2(k)-1): od:
return A[n]: end proc: # Lorenzo Sauras Altuzarra, Dec 18 2019
# second Maple program:
a:= n-> (l-> add(l[i+1]*2^(2^i-1), i=0..nops(l)-1))(Bits[Split](n-1)):
seq(a(n), n=1..38); # Alois P. Heinz, Dec 13 2023
MATHEMATICA
Nest[Append[#1, #1[[-#2]] + 2^(#2 - 1)] & @@ {#, 2^(IntegerLength[Length[#], 2] - 1)} &, {0, 1}, 36] (* Michael De Vlieger, May 08 2020 *)
PROG
(PARI) a(n)={if(n<=1, 0, my(t=1<<logint(n-1, 2)); a(n-t) + 2^(t-1))} \\ Andrew Howroyd, Dec 20 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Philippe Beaudoin, Dec 30 2014
EXTENSIONS
STATUS
approved