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 A322589 #5 Dec 18 2018 17:04:41 %S A322589 1,2,3,1,3,4,3,2,1,5,3,6,3,7,8,1,3,2,3,9,10,11,3,4,1,12,6,13,3,14,3,2, %T A322589 15,16,17,1,3,18,19,5,3,20,3,21,9,22,3,6,1,2,23,24,3,4,25,7,26,27,3,8, %U A322589 3,28,13,1,29,30,3,31,32,33,3,2,3,34,6,35,36,37,3,9,1,38,3,10,39,40,41,11,3,5,42,43,44,45,46,4,3,2,21,1,3,47,3,12,48 %N A322589 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) = A007913(n) for any other number. %H A322589 Antti Karttunen, <a href="/A322589/b322589.txt">Table of n, a(n) for n = 1..65537</a> %o A322589 (PARI) %o A322589 up_to = 65537; %o A322589 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 A322589 Aux322589(n) = if((n>2)&&isprime(n),0,core(n)); %o A322589 v322589 = rgs_transform(vector(up_to, n, Aux322589(n))); %o A322589 A322589(n) = v322589[n]; %Y A322589 Cf. A007913, A322587, A322588, A322591, A322592. %K A322589 nonn %O A322589 1,2 %A A322589 _Antti Karttunen_, Dec 18 2018