OFFSET
1,2
COMMENTS
This sequence is a permutation of the positive integers.
The cardinality of {2^k, ..., (2^k - 0^k)/2 + 1} is A011782(k).
LINKS
FORMULA
EXAMPLE
(2^0, ..., (2^0 - 0^0)/2 + 1) = (1),
(2^1, ..., (2^1 - 0^1)/2 + 1) = (2),
(2^2, ..., (2^2 - 0^2)/2 + 1) = (4, 3),
(2^3, ..., (2^3 - 0^3)/2 + 1) = (8, 7, 6, 5)...
MATHEMATICA
{1}~Join~Array[3*2^(IntegerLength[# - 1, 2] - 1) - # + 1 &, 64, 2] (* Michael De Vlieger, Oct 05 2020 *)
PROG
(PARI) a(n) = if(n--, 3<<logint(n, 2) - n, 1); \\ Kevin Ryde, Sep 29 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Lorenzo Sauras Altuzarra, Sep 29 2020
STATUS
approved