cp's OEIS Frontend

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.

A378522 Lexicographically earliest infinite sequence such that a(i) = a(j) => A378518(i) = A378518(j), for all i, j >= 1.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Antti Karttunen, Nov 30 2024

Keywords

Comments

Restricted growth sequence transform of A378518.

Crossrefs

Cf. A005117 (positions of 1's), A097248, A378518.

Programs

  • PARI
    up_to = 65537;
    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; };
    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))); };
    A097248(n) = { my(k=A097246(n)); while(k<>n, n = k; k = A097246(k)); k; };
    A378518(n) = (n - A097248(n));
    v378522 = rgs_transform(vector(up_to, n, A378518(n)));
    A378522(n) = v378522[n];