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.
%I A325382 #7 May 08 2019 22:18:53 %S A325382 1,2,3,4,3,5,3,4,6,7,3,8,3,9,10,4,3,5,3,7,11,12,3,8,13,14,6,15,3,16,3, %T A325382 4,17,18,19,8,3,20,21,7,3,22,3,23,10,24,3,8,25,7,26,14,3,5,27,28,29, %U A325382 30,3,31,3,32,11,4,33,34,3,18,35,36,3,8,3,37,10,38,39,40,3,7,6,41,3,42,43,44,45,23,3,46,47,48,49,36,50,8,3,9,17,7,3,51,3,14 %N A325382 Lexicographically earliest sequence such that for all i, j, a(i) = a(j) => f(i) = f(j) where f(n) = [A048250(n), A126795(n)] for all other numbers, except f(p) = -(p mod 2) for primes. %H A325382 Antti Karttunen, <a href="/A325382/b325382.txt">Table of n, a(n) for n = 1..65537</a> %o A325382 (PARI) %o A325382 up_to = 65537; %o A325382 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 A325382 A048250(n) = factorback(apply(p -> p+1,factor(n)[,1])); %o A325382 A126795(n) = gcd(n,A048250(n)); %o A325382 Aux325382(n) = if(isprime(n),-(n%2),[A048250(n),A126795(n)]); %o A325382 v325382 = rgs_transform(vector(up_to,n,Aux325382(n))); %o A325382 A325382(n) = v325382[n]; %Y A325382 Cf. A048250, A126795, A305801, A325381, A325384. %K A325382 nonn %O A325382 1,2 %A A325382 _Antti Karttunen_, May 08 2019