login
Lexicographically earliest sequence such that for all i, j, a(i) = a(j) => f(i) = f(j), where f(n) = A034460(n) * (-1)^[A327159(n)>0], and A034460(n) = usigma(n)-n, with usigma the sum of unitary divisors of n (A034448).
2

%I #5 Sep 05 2019 20:49:04

%S 1,2,2,2,2,3,2,2,2,4,2,4,2,5,6,2,2,7,2,5,8,9,2,7,2,10,2,7,2,11,2,2,12,

%T 13,14,9,2,15,16,9,2,17,2,10,12,18,2,13,2,19,20,21,2,22,16,10,23,24,2,

%U 25,2,26,16,2,27,28,2,15,29,30,2,21,2,31,32,33,27,34,2,15,2,35,2,36,23,37,38,13,2,39,20,19,40,41,42,43,2,44,20,45,2,46,2,15

%N Lexicographically earliest sequence such that for all i, j, a(i) = a(j) => f(i) = f(j), where f(n) = A034460(n) * (-1)^[A327159(n)>0], and A034460(n) = usigma(n)-n, with usigma the sum of unitary divisors of n (A034448).

%C For all i, j:

%C A305800(i) = A305800(j) => a(i) = a(j) => A318882(i) = A318882(j).

%H Antti Karttunen, <a href="/A327162/b327162.txt">Table of n, a(n) for n = 1..87360</a>

%o (PARI)

%o up_to = 87360;

%o rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };

%o A034460(n) = (sumdivmult(n, d, if(gcd(d, n/d)==1, d))-n); \\ From A034460

%o A327159(n,orgn=n,xs=Set([])) = if(1==n,0,if(vecsearch(xs,n), if(n==orgn,length(xs),0), xs = setunion([n],xs); A327159(A034460(n),orgn,xs)));

%o Aux327162(n) = A034460(n)*((-1)^((A327159(n)>0)));

%o v327162 = rgs_transform(vector(up_to, n, Aux327162(n)));

%o A327162(n) = v327162[n];

%Y Cf. A034448, A034460, A305800, A318882, A327159,

%K nonn

%O 1,2

%A _Antti Karttunen_, Aug 28 2019