login
a(n) = 2*A064989(n) for odd n, a(n) = A003961(n/2) for even n, where A003961 is fully multiplicative with a(p) = nextprime(p), and A064989 is its left inverse.
2

%I #12 Nov 17 2025 22:15:49

%S 2,1,4,3,6,5,10,9,8,7,14,15,22,11,12,27,26,25,34,21,20,13,38,45,18,17,

%T 16,33,46,35,58,81,28,19,30,75,62,23,44,63,74,55,82,39,24,29,86,135,

%U 50,49,52,51,94,125,42,99,68,31,106,105,118,37,40,243,66,65,122,57,76,77,134,225,142,41,36,69,70,85,146

%N a(n) = 2*A064989(n) for odd n, a(n) = A003961(n/2) for even n, where A003961 is fully multiplicative with a(p) = nextprime(p), and A064989 is its left inverse.

%C Self-inverse permutation (involution) of natural numbers.

%H Antti Karttunen, <a href="/A389909/b389909.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Pri#prime_indices">Index entries for sequences related to prime indices in the factorization of n</a>.

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

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

%o (PARI)

%o A003961(n) = { my(f=factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };

%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 A389909(n) = if(n%2, 2*A064989(n), A003961(n/2));

%Y Interleaving of A243502 and A003961.

%Y Cf. A064989, A252463, A389910.

%K nonn,easy

%O 1,1

%A _Antti Karttunen_, Nov 16 2025