login
Permutation of nonnegative integers: a(1) = 0; for n > 1, a(n) = A122111(A156552(n)).
3

%I #10 Dec 31 2018 13:22:46

%S 0,1,2,4,3,8,5,16,6,9,7,32,11,128,12,18,13,64,17,256,15,72,19,512,10,

%T 216,24,54,23,36,29,2048,192,36864,20,25,31,36028797018963968,120,144,

%U 37,4096,41,524288,48,3136,43,32768,14,27,360,4294967296,47,1024,21,1048576,61440,128000,53,16384,59,47852207848256971424537054170092404736,384,100,320,1152,61

%N Permutation of nonnegative integers: a(1) = 0; for n > 1, a(n) = A122111(A156552(n)).

%C Note the indexing: the domain starts from 1, but the range includes also zero.

%H Antti Karttunen, <a href="/A322864/b322864.txt">Table of n, a(n) for n = 1..105</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%H <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>

%F a(1) = 0; for n > 1, a(n) = A122111(A156552(n)).

%F For all n >= 1, a(prime(1+n)) = prime(n).

%t Table[If[n < 3, n - 1, Block[{k = #, m = 0}, Times @@ Power @@@ Table[k -= m; k = DeleteCases[k, 0]; {Prime@ Length@ k, m = Min@ k}, Length@ Union@ k]] &@ Catenate[ConstantArray[PrimePi[#1], #2] & @@@ FactorInteger@ #] &@ Floor@ Total@ Flatten@ MapIndexed[#1 2^(#2 - 1) &, Flatten[Table[2^(PrimePi@ #1 - 1), {#2}] & @@@ FactorInteger@ n]]], {n, 67}] (* _Michael De Vlieger_, Dec 31 2018, after _JungHwan Min_ at A122111 *)

%o (PARI)

%o A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};

%o A122111(n) = if(1==n,n,prime(bigomega(n))*A122111(A064989(n)));

%o A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n))));

%o A322864(n) = if(1==n, 0, A122111(A156552(n)));

%Y Inverse permutation: A322863.

%K nonn

%O 1,3

%A _Antti Karttunen_, Dec 30 2018