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 A378522 #6 Nov 30 2024 16:45:49 %S A378522 1,1,1,2,1,1,1,3,4,1,1,5,1,1,1,6,1,7,1,8,1,1,1,9,10,1,11,5,1,1,1,12,1, %T A378522 1,1,13,1,1,1,14,1,1,1,6,15,1,1,16,15,17,1,18,1,19,1,9,1,1,1,20,1,1, %U A378522 21,22,1,1,1,23,1,1,1,24,1,1,25,26,1,1,1,27,28,1,1,22,1,1,1,12,1,29,1,30,1,1,1,31,1,29,32,33,1,1,1,34,1 %N A378522 Lexicographically earliest infinite sequence such that a(i) = a(j) => A378518(i) = A378518(j), for all i, j >= 1. %C A378522 Restricted growth sequence transform of A378518. %H A378522 Antti Karttunen, <a href="/A378522/b378522.txt">Table of n, a(n) for n = 1..65537</a> %o A378522 (PARI) %o A378522 up_to = 65537; %o A378522 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 A378522 A097246(n) = { my(f=factor(n)); prod(i=1, #f~, (nextprime(f[i, 1]+1)^(f[i, 2]\2))*((f[i, 1])^(f[i, 2]%2))); }; %o A378522 A097248(n) = { my(k=A097246(n)); while(k<>n, n = k; k = A097246(k)); k; }; %o A378522 A378518(n) = (n - A097248(n)); %o A378522 v378522 = rgs_transform(vector(up_to, n, A378518(n))); %o A378522 A378522(n) = v378522[n]; %Y A378522 Cf. A005117 (positions of 1's), A097248, A378518. %K A378522 nonn %O A378522 1,4 %A A378522 _Antti Karttunen_, Nov 30 2024