%I #6 Oct 20 2022 12:02:03
%S 1,3,2,5,4,35,8,7,11,21,9,55,16,15,14,13,19,65,17,33,10,39,25,77,23,
%T 45,29,51,27,1001,32,31,20,57,6,85,41,63,22,69,37,715,47,75,26,87,43,
%U 91,53,93,28,95,49,115,12,99,34,111,61,1309,59,117,38,67,18,455,64,123,40,429
%N a(n) is the smallest number not yet in the sequence with the same number of distinct prime divisors as n, but relatively prime to n.
%C This is a self-inverse permutation of the positive integers.
%H Rémy Sigrist, <a href="/A159587/b159587.txt">Table of n, a(n) for n = 1..10000</a>
%H Rémy Sigrist, <a href="/A159587/a159587.png">Scatterplot of (n, a(n)) for n, a(n) <= 25000</a>
%o (PARI) invect(v,n,x)=for(i=1,n,if(v[i]==x,return(1)));0
%o nextnew(v,n)=local(k);k=1;while(!R(n,k)||invect(v,n-1,k),k++);k
%o newvect(n)=local(v);v=vector(n);for(k=1,n,v[k]=nextnew(v,k));v
%o R(n,m)=omega(n)==omega(m)&&gcd(n,m)==1
%o newvect(80)
%Y Cf. A001221, A094681, A159588.
%K nonn
%O 1,2
%A _Franklin T. Adams-Watters_, Apr 16 2009
|