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.

A323374 Lexicographically earliest sequence such that for all i, j, a(i) = a(j) => f(i) = f(j) where f(n) = A323373(n) for all other numbers, except f(p) = -(p mod 2) for primes p.

Original entry on oeis.org

1, 2, 3, 4, 3, 4, 3, 5, 6, 5, 3, 5, 3, 7, 8, 9, 3, 7, 3, 9, 10, 11, 3, 9, 12, 13, 14, 15, 3, 9, 3, 16, 12, 16, 17, 13, 3, 18, 17, 16, 3, 13, 3, 19, 20, 21, 3, 16, 22, 19, 23, 24, 3, 18, 25, 26, 27, 28, 3, 16, 3, 29, 30, 31, 32, 33, 3, 31, 34, 24, 3, 26, 3, 35, 25, 36, 37, 26, 3, 31, 38, 39, 3, 26, 40, 41, 42, 39, 3, 26, 43, 44, 37, 45, 46, 31, 3, 41, 47, 39, 3, 31, 3, 48
Offset: 1

Views

Author

Antti Karttunen, Jan 13 2019

Keywords

Comments

For all i, j:
A305801(i) = A305801(j) => a(i) = a(j),
a(i) = a(j) => A039651(i) = A039651(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; };
    A049559(n) = gcd(eulerphi(n), n-1);
    A160595(n) = if(1==n, n, numerator(eulerphi(n)/(n-1)));
    Aux323374(n) = if(isprime(n),-(n%2),[A049559(n), A160595(n)]);
    v323374 = rgs_transform(vector(up_to, n, Aux323374(n)));
    A323374(n) = v323374[n];