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 A322587 #5 Dec 18 2018 17:04:28 %S A322587 1,1,2,3,2,4,2,5,6,7,2,8,2,9,10,11,2,6,2,12,13,14,2,15,16,13,17,18,2, %T A322587 10,2,19,20,21,22,23,2,24,22,25,2,13,2,26,27,28,2,29,30,16,31,32,2,17, %U A322587 33,34,35,36,2,37,2,38,39,40,41,20,2,42,43,22,2,44,2,35,45,46,47,22,2,48,49,33,2,32,50,51,52,53,2,27,54,55,47,56,54,57,2,30,58,59,2,31,2,60,41 %N A322587 Lexicographically earliest such sequence a that for all i, j, a(i) = a(j) => f(i) = f(j), where f(n) = 0 for odd primes, and f(n) = A291756(n) [equally: A295887(n)] for any other number. %C A322587 For all i, j: a(i) = a(j) => A322320(i) = A322320(j). %H A322587 Antti Karttunen, <a href="/A322587/b322587.txt">Table of n, a(n) for n = 1..65537</a> %o A322587 (PARI) %o A322587 up_to = 65537; %o A322587 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 A322587 A003557(n) = { my(f=factor(n)); for(i=1, #f~, f[i, 2] = f[i, 2]-1); factorback(f); }; %o A322587 A173557(n) = my(f=factor(n)[, 1]); prod(k=1, #f, f[k]-1); \\ From A173557 %o A322587 Aux322587(n) = if((n>2)&&isprime(n),0,(1/2)*(2 + ((A003557(n)+A173557(n))^2) - A003557(n) - 3*A173557(n))); %o A322587 v322587 = rgs_transform(vector(up_to, n, Aux322587(n))); %o A322587 A322587(n) = v322587[n]; %Y A322587 Cf. A291756, A295887, A322588, A322589, A322591, A322592. %K A322587 nonn %O A322587 1,3 %A A322587 _Antti Karttunen_, Dec 18 2018