OFFSET
1,2
COMMENTS
a(a(n))=n: a self-inverse permutation with A010051(a(n)+n)=1. - Reinhard Zumkeller, Nov 25 2004
LINKS
PROG
(PARI) A083569(n)={global(a083569); type(a083569)=="t_VEC"||a083569=vector(n); #a083569<n&&a083569=concat(a083569, vector(n-#a083569)); my(u=[0]); a083569[n]||for(i=1, n, a083569[i]||for(k=u[1]+1, 9e9, !setsearch(u, k)&&isprime(i+k)&&(a083569[i]=k)&&break); u=setunion(u, [a083569[i]]); while(#u>1&&u[2]==u[1]+1, u=u[2..-1])); a083569[n]} \\ Returns the n-th term and defines the global array a083569 up to that value at least. For efficiency it is better to (pre)compute a large number of terms at once (via A083569(N_max)) rather than one after the other. - M. F. Hasler, Apr 11 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Jun 12 2003
EXTENSIONS
More terms from David Wasserman, Nov 19 2004
STATUS
approved