OFFSET
0,2
COMMENTS
A101296(a(n)) gives a permutation of natural numbers.
LINKS
FORMULA
EXAMPLE
The sequence can be represented as a binary tree:
1
|
...................2...................
6 4
36......../ \........30 12......../ \........8
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
216 180 210 900 72 60 24 16
etc.
The value of a(n) is computed from the binary expansion of n as follows: Starting from the least significant end of the binary expansion of n (A007088), we record the successive run lengths, subtract one from all lengths except the first one, and use the reversed partial sums of these adjusted values as the exponents of successive primes.
For 11, which is "1011" in base 2, we have run lengths [2, 1, 1] when scanned from the right, and when one is subtracted from all except the first, we have [2, 0, 0], partial sums of which is [2, 2, 2], which stays same when reversed, thus a(11) = 2^2 * 3^2 * 5^2 = 900.
For 13, which is "1101" in base 2, we have run lengths [1, 1, 2] when scanned from the right, and when one is subtracted from all except the first, we have [1, 0, 1], partial sums of which is [1, 1, 2], reversed [2, 1, 1], thus a(13) = 2^2 * 3^1 * 5^1 = 60.
Sequence A227183 is based on the same algorithm.
MATHEMATICA
{1}~Join~Array[Times @@ MapIndexed[Prime[First@ #2]^#1 &, Reverse@ Accumulate@ MapIndexed[Length[#1] - Boole[First@ #2 > 1] &, Split@ Reverse@ IntegerDigits[#, 2]]] &, 54] (* Michael De Vlieger, Feb 05 2020 *)
PROG
(PARI) A322827(n) = if(!n, 1, my(bits = Vecrev(binary(n)), rl=1, o = List([])); for(i=2, #bits, if(bits[i]==bits[i-1], rl++, listput(o, rl))); listput(o, rl); my(es=Vecrev(Vec(o)), m=1); for(i=1, #es, m *= prime(i)^es[i]); (m));
CROSSREFS
KEYWORD
AUTHOR
Antti Karttunen, Jan 16 2019
STATUS
approved