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.

Showing 1-3 of 3 results.

A305801 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), where f(n) = 0 if n is an odd prime, with f(n) = n for all other n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 14 2018

Keywords

Comments

The original name was: "Filter sequence for a(odd prime) = constant sequences", which stemmed from the fact that for all i, j, a(i) = a(j) => b(i) = b(j) for any sequence b that obtains a constant value for all odd primes A065091.
For example, we have for all i, j:
a(i) = a(j) => A305800(i) = A305800(j),
a(i) = a(j) => A007814(i) = A007814(j),
a(i) = a(j) => A305891(i) = A305891(j) => A291761(i) = A291761(j).
There are several filter sequences "above" this one (meaning that they have finer equivalence class partitioning), for example, we have, for all i, j:
[where odd primes are further distinguished by]
A305900(i) = A305900(j) => a(i) = a(j), [whether p = 3 or > 3]
A319350(i) = A319350(j) => a(i) = a(j), [A007733(p)]
A319704(i) = A319704(j) => a(i) = a(j), [p mod 4]
A319705(i) = A319705(j) => a(i) = a(j), [A286622(p)]
A331304(i) = A331304(j) => a(i) = a(j), [parity of A000720(p)]
A336855(i) = A336855(j) => a(i) = a(j). [distance to the next larger prime]

Crossrefs

Cf. A305900, A319350, A319704, A319705, A331304, A336855 (sequences with finer equivalence class partitioning).
Cf. also A003602, A103391, A295300, A305795, A324400, A331300, A336460 (for similar constructions or similarly useful sequences).

Programs

  • Mathematica
    Array[If[# <= 2, #, If[PrimeQ[#], 3, 2 + # - PrimePi[#]]] &, 105] (* Michael De Vlieger, Oct 18 2021 *)
  • PARI
    A305801(n) = if(n<=2,n,if(isprime(n),3,2+n-primepi(n)));

Formula

a(1) = 1, a(2) = 2; for n > 2, a(n) = 3 for odd primes, and a(n) = 2+n-A000720(n) for composite n.
For n > 2, a(n) = 1 + A305800(n).

Extensions

Name changed and Comment section rewritten by Antti Karttunen, Oct 17 2021

A322019 a(n) = A000005(n) - A014197(n), where A000005(n) gives the number of divisors of n, and A014197(n) gives the number of integers m with phi(m) = n.

Original entry on oeis.org

-1, -1, 2, -1, 2, 0, 2, -1, 3, 2, 2, 0, 2, 4, 4, -1, 2, 2, 2, 1, 4, 2, 2, -2, 3, 4, 4, 4, 2, 6, 2, -1, 4, 4, 4, 1, 2, 4, 4, -1, 2, 4, 2, 3, 6, 2, 2, -1, 3, 6, 4, 4, 2, 6, 4, 5, 4, 2, 2, 3, 2, 4, 6, -1, 4, 6, 2, 6, 4, 6, 2, -5, 2, 4, 6, 6, 4, 6, 2, 0, 5, 2, 2, 6, 4, 4, 4, 2, 2, 12, 4, 3, 4, 4, 4, -5, 2, 6, 6, 5, 2, 6, 2, 5, 8
Offset: 1

Views

Author

Antti Karttunen, Dec 03 2018

Keywords

Crossrefs

Cf. A000005, A014197, A305058 (positions of zeros).
Cf. also A305896.

Programs

  • PARI
    A014197(n, m=1) = { n==1 && return(1+(m<2)); my(p, q); sumdiv(n, d, if( d>=m && isprime(d+1), sum( i=0, valuation(q=n\d, p=d+1), A014197(q\p^i, p))))}; \\ From A014197
    A322019(n) = (numdiv(n)-A014197(n));

Formula

a(n) = A000005(n) - A014197(n).

A322024 Lexicographically earliest such sequence a that a(i) = a(j) => A014197(i) = A014197(j) and A081373(i) = A081373(j), for all i, j. Here A081373(n) gives the number of k, 1 <= k <= n, with phi(k) = phi(n), while A014197(n) gives the number of integers m with phi(m) = n.

Original entry on oeis.org

1, 2, 3, 4, 3, 5, 3, 6, 7, 8, 3, 9, 3, 10, 3, 11, 3, 12, 3, 13, 7, 14, 3, 15, 3, 10, 7, 16, 3, 17, 3, 18, 7, 10, 3, 19, 3, 10, 7, 20, 3, 21, 3, 22, 10, 14, 3, 23, 7, 24, 3, 16, 3, 16, 7, 25, 7, 14, 3, 26, 3, 7, 10, 27, 3, 17, 3, 10, 3, 28, 3, 29, 3, 24, 10, 30, 7, 31, 3, 15, 3, 16, 3, 32, 3, 10, 3, 33, 3, 34, 7, 2, 10, 7, 10, 35, 3, 24, 24, 21, 3, 28, 3, 2, 10
Offset: 1

Views

Author

Antti Karttunen, Nov 29 2018

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A014197(n), A081373(n)].

Crossrefs

Programs

  • PARI
    up_to = 65537;
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    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; };
    A014197(n, m=1) = { n==1 && return(1+(m<2)); my(p, q); sumdiv(n, d, if( d>=m && isprime(d+1), sum( i=0, valuation(q=n\d, p=d+1), A014197(q\p^i, p))))}; \\ From A014197
    v081373 = ordinal_transform(vector(up_to,n,eulerphi(n)));
    A081373(n) = v081373[n];
    v322024 = rgs_transform(vector(up_to, n, [A014197(n), A081373(n)]));
    A322024(n) = v322024[n];
Showing 1-3 of 3 results.