OFFSET
1,2
COMMENTS
Lexicographically earliest self-inverse permutation of natural numbers where each prime of the form 4k+1 is replaced by a prime of the form 4k+3 and vice versa, with the composite numbers determined by multiplicativity.
LINKS
FORMULA
PROG
(PARI)
up_to = 2^16;
A267097list(up_to) = { my(v=vector(up_to), i=0, c=0); forprime(p=2, prime(up_to), if(1==(p%4), c++); i++; v[i] = c); (v); };
v267097 = A267097list(up_to);
A267097(n) = v267097[n];
list_primes_of_the_form(up_to, m, k) = { my(v=vector(up_to), i=0); forprime(p=2, , if(k==(p%m), i++; v[i] = p; if(i==up_to, return(v)))); };
v002144 = list_primes_of_the_form(2*up_to, 4, 1);
A002144(n) = v002144[n];
v002145 = list_primes_of_the_form(2*up_to, 4, 3);
A002145(n) = v002145[n];
A267099(n) = { my(f=factor(n)); for(k=1, #f~, f[k, 1] = A267101(primepi(f[k, 1]))); factorback(f); }; \\ Antti Karttunen, May 18 2022
(Scheme, with memoization-macro definec)
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Antti Karttunen, Feb 01 2016
EXTENSIONS
Verbal description prefixed to the name by Antti Karttunen, May 19 2022
STATUS
approved