OFFSET
1,1
COMMENTS
This is a self-inverse permutation of the positive integers.
Equivalently, the geometric mean of n and a(n) is an integer.
If n is squarefree, a(n) = 4n.
PROG
(PARI) invect(v, n, x)=for(i=1, n, if(v[i]==x, return(1))); 0
nextnew(v, n)=local(k); k=1; while(!R(n, k)||invect(v, n-1, k), k++); k
newvect(n)=local(v); v=vector(n); for(k=1, n, v[k]=nextnew(v, k)); v
R(n, m)=issquare(n*m)&&n!=m
newvect(80)
CROSSREFS
KEYWORD
nonn
AUTHOR
Franklin T. Adams-Watters, Apr 16 2009
STATUS
approved