login
A244319
Self-inverse permutation of natural numbers: a(1) = 1, a(2n) = A003961(1+a(A064989(2n-1))), a(2n+1) = 1+A003961(a(A064989(2n+1)-1)).
12
1, 3, 2, 9, 6, 5, 26, 11, 4, 21, 8, 125, 56, 25, 16, 15, 344, 115, 36, 1015, 10, 39, 204, 41, 14, 7, 52, 45, 86, 301, 176, 155, 298, 51, 50, 19, 518, 305, 22, 189, 24, 895, 1376, 49, 28, 825, 1268, 11875, 44, 35, 34, 27, 3186, 6625, 2388, 13, 454, 153, 126, 3191, 476, 131
OFFSET
1,2
COMMENTS
After 1, maps each even number to a unique odd number and vice versa, i.e., for all n > 1, A000035(a(n)) XOR A000035(n) = 1, where XOR is given in A003987.
FORMULA
a(1) = 1, a(2n) = A003961(1+a(A064989(2n-1))), a(2n+1) = A243501(a(A064989(2n+1)-1)).
As a composition of related permutations:
a(n) = A245609(A048673(n)) = A064216(A245610(n)).
PROG
(PARI)
A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ This function from Michel Marcus
A064989(n) = my(f = factor(n)); for(i=1, #f~, if((2 == f[i, 1]), f[i, 1] = 1, f[i, 1] = precprime(f[i, 1]-1))); factorback(f);
A244319(n) = if(1==n, 1, if(0==(n%2), A003961(1+A244319(A064989(n-1))), 1+A003961(A244319(A064989(n)-1))));
for(n=1, 10001, write("b244319.txt", n, " ", A244319(n)))
(Scheme, with Antti Karttunen's IntSeq-library for memoizing definec-macro)
(definec (A244319 n) (cond ((= 1 n) 1) ((even? n) (A003961 (+ 1 (A244319 (A064989 (- n 1)))))) (else (A243501 (A244319 (-1+ (A064989 n)))))))
CROSSREFS
Related permutations: A048673, A064216, A245609-A245610.
Similar entanglement permutations: A245605-A245606, A235491, A236854, A243347, A244152.
Sequence in context: A125152 A229119 A269867 * A269359 A270199 A349579
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jul 18 2014; description corrected and PARI code added Jul 30 2014
STATUS
approved