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 A322807 #5 Dec 26 2018 21:36:03 %S A322807 1,2,3,4,3,5,3,6,5,7,3,8,3,9,8,10,3,11,3,12,12,13,3,14,7,15,9,16,3,17, %T A322807 3,18,14,19,11,20,3,21,22,23,3,24,3,25,26,27,3,28,17,29,30,31,3,32,23, %U A322807 33,34,35,3,36,3,37,38,39,28,40,3,22,41,42,3,43,3,44,45,46,20,47,3,48,49,50,3,51,52,53,54,55,3,56,29,57,58,59,60,61,3,62,15 %N A322807 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = -1 if n is an odd prime, and f(n) = A285330(n) for all other numbers. %H A322807 Antti Karttunen, <a href="/A322807/b322807.txt">Table of n, a(n) for n = 1..65537</a> %o A322807 (PARI) %o A322807 up_to = 65537; %o A322807 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 A322807 A007947(n) = factorback(factorint(n)[, 1]); \\ From A007947 %o A322807 A048675(n) = my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; \\ From A048675 %o A322807 A285328(n) = { my(r); if((n > 1 && !bitand(n,(n-1))), (n/2), r=A007947(n); if(r==n,1,n = n-r; while(A007947(n) <> r, n = n-r); n)); }; %o A322807 A285330(n) = if(issquarefree(n),A048675(n),A285328(n)); %o A322807 A322807aux(n) = if((n%2)&&isprime(n),-1,A285330(n)); %o A322807 v322807 = rgs_transform(vector(up_to,n,A322807aux(n))); %o A322807 A322807(n) = v322807[n]; %Y A322807 Cf. A048675, A285328, A285330, A285332, A322806. %K A322807 nonn %O A322807 1,2 %A A322807 _Antti Karttunen_, Dec 26 2018