cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A159586 a(n) is the smallest number not yet used such that n*a(n) is a square, but n != a(n).

This page as a plain text file.
%I A159586 #2 Mar 30 2012 17:35:23
%S A159586 4,8,12,1,20,24,28,2,16,40,44,3,52,56,60,9,68,32,76,5,84,88,92,6,36,
%T A159586 104,48,7,116,120,124,18,132,136,140,25,148,152,156,10,164,168,172,11,
%U A159586 80,184,188,27,64,72,204,13,212,96,220,14,228,232,236,15,244,248,112,49
%N A159586 a(n) is the smallest number not yet used such that n*a(n) is a square, but n != a(n).
%C A159586 This is a self-inverse permutation of the positive integers.
%C A159586 Equivalently, the geometric mean of n and a(n) is an integer.
%C A159586 If n is squarefree, a(n) = 4n.
%o A159586 (PARI) invect(v,n,x)=for(i=1,n,if(v[i]==x,return(1)));0
%o A159586 nextnew(v,n)=local(k);k=1;while(!R(n,k)||invect(v,n-1,k),k++);k
%o A159586 newvect(n)=local(v);v=vector(n);for(k=1,n,v[k]=nextnew(v,k));v
%o A159586 R(n,m)=issquare(n*m)&&n!=m
%o A159586 newvect(80)
%Y A159586 Cf. A159253, A056135.
%K A159586 nonn
%O A159586 1,1
%A A159586 _Franklin T. Adams-Watters_, Apr 16 2009