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 A319348 #9 Feb 03 2024 10:12:53 %S A319348 1,2,2,3,2,4,2,5,6,7,2,8,2,9,10,11,2,12,2,13,14,15,2,16,17,18,19,20,2, %T A319348 21,2,22,23,24,25,26,2,27,28,29,2,30,2,31,32,33,2,34,35,36,37,38,2,39, %U A319348 28,40,41,30,2,42,2,43,44,45,46,47,2,48,49,47,2,50,2,51,52,53,46,54,2,55,56,57,2,58,41,59,60,61,2,62,37,63,64,65,66,67,2,68,69,70,2 %N A319348 Lexicographically earliest infinite sequence such that a(i) = a(j) => A003557(i) = A003557(j) and A051953(i) = A051953(j), for all i, j >= 1. %C A319348 Restricted growth sequence transform of ordered pair [A003557(n), A051953(n)]. %C A319348 For all i, j: a(i) = a(j) => A318305(i) = A318305(j). %H A319348 Antti Karttunen, <a href="/A319348/b319348.txt">Table of n, a(n) for n = 1..65537</a> %F A319348 For n >= 3, a(n) = A319349(n) - 1. %o A319348 (PARI) %o A319348 up_to = 65537; %o A319348 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 A319348 A003557(n) = { my(f=factor(n)); for (i=1, #f~, f[i, 2] = f[i, 2]-1); factorback(f); }; %o A319348 A051953(n) = (n-eulerphi(n)); %o A319348 v319348 = rgs_transform(vector(up_to,n,[A003557(n),A051953(n)])); %o A319348 A319348(n) = v319348[n]; %Y A319348 Cf. A003557, A051953, A319349. %K A319348 nonn %O A319348 1,2 %A A319348 _Antti Karttunen_, Sep 29 2018 %E A319348 Name changed by _Antti Karttunen_, Feb 03 2024