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.

A326193 Lexicographically earliest sequence such that for all i, j, a(i) = a(j) => f(i) = f(j), where f(n) = gcd(n,sigma(n)) * (-1)^[gcd(n,sigma(n))==n].

Original entry on oeis.org

1, 2, 2, 2, 2, 3, 2, 2, 2, 4, 2, 5, 2, 4, 6, 2, 2, 6, 2, 4, 2, 4, 2, 7, 2, 4, 2, 8, 2, 9, 2, 2, 6, 4, 2, 2, 2, 4, 2, 10, 2, 9, 2, 5, 6, 4, 2, 5, 2, 2, 6, 4, 2, 9, 2, 11, 2, 4, 2, 7, 2, 4, 2, 2, 2, 9, 2, 4, 6, 4, 2, 6, 2, 4, 2, 5, 2, 9, 2, 4, 2, 4, 2, 12, 2, 4, 6, 5, 2, 13, 14, 5, 2, 4, 15, 7, 2, 2, 6, 2, 2, 9, 2, 4, 6
Offset: 1

Views

Author

Antti Karttunen, Aug 24 2019

Keywords

Comments

Restricted growth sequence transform of function f, defined as f(n) = -A009194(n) = -n when n is one of multiply-perfect numbers (A007691), otherwise f(n) = A009194(n) = gcd(n,sigma(n)).
For all i, j:
a(i) = a(j) => A326194(i) = A326194(j).

Crossrefs

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; };
    Aux326193(n) = { my(u=gcd(n,sigma(n))); u*((-1)^(u==n)); };
    v326193 = rgs_transform(vector(up_to, n, Aux326193(n)));
    A326193(n) = v326193[n];