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

A341355 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), where f(1) = 1 and for n > 1, f(n) = [A341353(n), A341353(2*n)].

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 3, 2, 4, 6, 2, 3, 3, 3, 2, 4, 2, 7, 3, 2, 6, 4, 7, 3, 4, 3, 3, 3, 3, 4, 2, 5, 2, 4, 3, 8, 3, 3, 4, 4, 2, 2, 3, 7, 5, 8, 5, 3, 4, 2, 5, 3, 3, 3, 6, 3, 4, 3, 2, 2, 3, 4, 3, 6, 3, 4, 2, 2, 2, 3, 3, 2, 5, 3, 3, 3, 9, 2, 3, 2, 4, 4, 2, 4, 4, 3, 8, 8, 3, 6, 6, 2, 2, 6, 3, 3, 2, 5, 2, 4, 3, 6, 9, 3, 4
Offset: 1

Views

Author

Antti Karttunen, Feb 14 2021

Keywords

Comments

For all i, j: a(i) = a(j) => A329903(i) = A329903(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; };
    A007949(n) = valuation(n,3);
    A156552(n) = { my(f = factor(n), p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res };
    A341353(n) = A007949(A156552(n));
    Aux341355(n) = if(1==n,1, [A341353(n), A341353(2*n)]);
    v341355 = rgs_transform(vector(up_to, n, Aux341355(n)));
    A341355(n) = v341355[n];

A336855 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), for all i, j >= 1, where f(p) = p-nextprime(p) for primes p, and f(n) = n for all other numbers.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 09 2020

Keywords

Comments

Restricted growth sequence transform of function f defined as: f(n) = -{distance to the next larger prime} when n is a prime, otherwise f(n) = -n.
For all i, j:
a(i) = a(j) => A305801(i) = A305801(j),
a(i) = a(j) => A336852(i) = A336852(j),
a(i) = a(j) => A336853(i) = A336853(j).

Crossrefs

Cf. also A001359 (positions of 3's), A305801, A319704, A331304, A336852, A336853.

Programs

  • PARI
    up_to = 100000;
    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; };
    A336855aux(n) = if(isprime(n),n-nextprime(1+n),n);
    v336855 = rgs_transform(vector(up_to,n,A336855aux(n)));
    A336855(n) = v336855[n];
Showing 1-3 of 3 results.