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 A366297 #8 Oct 07 2023 21:39:59 %S A366297 1,2,2,2,2,3,2,4,5,2,2,2,2,4,6,2,2,2,2,4,7,2,2,2,7,8,4,2,2,2,2,2,9,2, %T A366297 5,10,2,11,6,2,2,2,2,4,4,12,2,13,9,8,7,14,2,15,6,2,6,2,2,2,2,4,4,16, %U A366297 17,2,2,4,6,2,2,18,2,4,3,3,17,2,2,2,18,2,2,19,6,8,6,20,2,21,6,4,6,22,5,2,2,14,8,20,2,14,2,2,2 %N A366297 Lexicographically earliest infinite sequence such that a(i) = a(j) => A359589(i) = A359589(j) for all i, j >= 1, where A359589 is Dirichlet inverse of function f(n) = (-1 + gcd(A003415(n), A276086(n))). %C A366297 Restricted growth sequence transform of A359589. %C A366297 For all i, j: A305800(i) = A305800(j) => a(i) = a(j) => A359595(i) = A359595(j). %H A366297 Antti Karttunen, <a href="/A366297/b366297.txt">Table of n, a(n) for n = 1..65537</a> %o A366297 (PARI) %o A366297 up_to = 65537; %o A366297 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 A366297 DirInverseCorrect(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1]*sumdiv(n, d, if(d<n, v[n/d]*u[d], 0)))); (u) }; \\ Compute the Dirichlet inverse of the sequence given in input vector v. %o A366297 A003415(n) = if(n<=1, 0, my(f=factor(n)); n*sum(i=1, #f~, f[i, 2]/f[i, 1])); %o A366297 A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); }; %o A366297 A327858(n) = gcd(A003415(n), A276086(n)); %o A366297 v366297 = rgs_transform(DirInverseCorrect(vector(up_to,n,A327858(n)-1))); %o A366297 A366297(n) = v366297[n]; %Y A366297 Cf. A276086, A305800, A327858, A359589, A359595. %Y A366297 Cf. also A366296. %K A366297 nonn %O A366297 1,2 %A A366297 _Antti Karttunen_, Oct 07 2023