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.

A334868 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j) for all i, j >= 1, where f(1) = 0 and for n > 1, f(n) = -1 if n is in A050376, and f(n) = A334870(n) otherwise.

Original entry on oeis.org

1, 2, 2, 2, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 8, 2, 2, 9, 2, 10, 11, 12, 2, 13, 2, 14, 15, 16, 2, 17, 2, 18, 19, 20, 21, 22, 2, 23, 24, 25, 2, 26, 2, 27, 28, 29, 2, 30, 2, 31, 32, 33, 2, 34, 35, 36, 37, 38, 2, 39, 2, 40, 41, 6, 42, 43, 2, 44, 45, 46, 2, 47, 2, 48, 49, 50, 51, 52, 2, 53, 2, 54, 2, 55, 56, 57, 58, 59, 2, 60, 61, 62, 63, 64, 65, 66, 2, 67, 68, 8, 2, 69, 2, 70, 71
Offset: 1

Views

Author

Antti Karttunen, Jun 08 2020

Keywords

Comments

For all i, j: A305979(i) = A305979(j) => a(i) = a(j) => A334872(i) = A334872(j).

Crossrefs

Cf. A050376 (positions of 2's), A305979, A334869, A334870, A334872.

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; };
    ispow2(n) = (n && !bitand(n,n-1));
    A302777(n) = ispow2(isprimepower(n));
    A334870(n) = if(issquare(n),sqrtint(n),my(c=core(n), m=n); forprime(p=2, , if(!(c % p), m/=p; break, m*=p)); (m));
    A334868aux(n) = if(1==n,0,if(A302777(n),-1,A334870(n)));
    v334868 = rgs_transform(vector(up_to,n,A334868aux(n)));
    A334868(n) = v334868[n];