A253564 Permutation of natural numbers: a(n) = A156552(A122111(n)).
0, 1, 3, 2, 7, 5, 15, 4, 6, 11, 31, 9, 63, 23, 13, 8, 127, 10, 255, 19, 27, 47, 511, 17, 14, 95, 12, 39, 1023, 21, 2047, 16, 55, 191, 29, 18, 4095, 383, 111, 35, 8191, 43, 16383, 79, 25, 767, 32767, 33, 30, 22, 223, 159, 65535, 20, 59, 71, 447
Offset: 1
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 1000 terms from Antti Karttunen)
- Index entries for sequences that are permutations of the natural numbers
Programs
-
Maple
a:= proc(n) local i, l, r; r, l:= 0, [0, sort(map(i-> numtheory[pi](i[1])$i[2], ifactors(n)[2]))[]]; for i to nops(l)-1 do r:= 2*((x-> 2*x+1)@@(l[i+1]-l[i]))(r) od; r/2 end: seq(a(n), n=1..120); # Alois P. Heinz, Jul 21 2017
-
Mathematica
Table[Floor@ Total@ Flatten@ MapIndexed[#1 2^(#2 - 1) &, Flatten[ Table[ 2^(PrimePi@ #1 - 1), {#2}] & @@@ FactorInteger@ #]] &[If[n == 1, 1, Module[{l = #, m = 0}, Times @@ Power @@@ Table[l -= m; l = DeleteCases[l, 0]; {Prime@ Length@ l, m = Min@ l}, Length@ Union@ l]] &@ Catenate[ConstantArray[PrimePi[#1], #2] & @@@ FactorInteger@ n]]], {n, 57}] (* Michael De Vlieger, Sep 08 2016, after JungHwan Min at A122111 *)
-
Scheme
(define (A253564 n) (A156552 (A122111 n)))
Comments