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-6 of 6 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

A324400 Lexicographically earliest sequence such that a(i) = a(j) => f(i) = f(j) for all i, j >= 1, where f(n) = -1 if n = 2^k and k > 0, and f(n) = n for all other numbers.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 01 2019

Keywords

Comments

In the following, A stands for this sequence, A324400, and S -> T (where S and T are sequence A-numbers) indicates that for all i, j >= 1: S(i) = S(i) => T(i) = T(j).
For example, the following chains of implications hold:
A -> A286619 -> A005811,
and
A -> A003602 -> A286622 -> A000120,
-> A323889,
-> A000593,
-> A001227,
among many others.

Crossrefs

Programs

  • PARI
    A000523(n) = if(n<1, 0, #binary(n)-1);
    A324400(n) = if(n<4,n,if(!bitand(n,n-1),2,1+n-A000523(n)));

Formula

If n <= 3, a(n) = n; and for n >= 4, if A209229(n) = 1, then a(n) = 2, otherwise a(n) = 1 + n - A000523(n).

A324389 Lexicographically earliest sequence such that a(i) = a(j) => f(i) = f(j), where f(n) = [A009194(n), A318458(n)] for all other numbers, except f(1) = -1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 05 2019

Keywords

Comments

For all i, j:
A324401(i) = A324401(j) => a(i) = a(j).
Regarding the scatter plot of this sequence, see also comments in A318310. - Antti Karttunen, Feb 04 2020

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; };
    A009194(n) = gcd(n,sigma(n));
    A318458(n) = bitand(n,sigma(n)-n);
    Aux324389(n) = if(1==n,-1,[A009194(n), A318458(n)]);
    v324389 = rgs_transform(vector(up_to,n,Aux324389(n)));
    A324389(n) = v324389[n];

A326202 Lexicographically earliest sequence such that for all i, j, a(i) = a(j) => f(i) = f(j), where f(n) = 0 if n > 2 and gcd(n,sigma(n)) = 1, with f(n) = n for all other numbers.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 11 2019

Keywords

Comments

For all i, j:
A305801(i) = A305801(j) => A324401(i) = A324401(j) => a(i) = a(j),
a(i) = a(j) => A009194(i) = A009194(j) => A325964(i) = A325964(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; };
    Aux326202(n) = if((n>2) && (1==gcd(n,sigma(n))),0,n);
    v326202 = rgs_transform(vector(up_to, n, Aux326202(n)));
    A326202(n) = v326202[n];

A336157 Lexicographically earliest infinite sequence such that a(i) = a(j) => A318458(i) = A318458(j) and A336158(i) = A336158(j), for all i, j >= 1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 11 2020

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A318458(n), A336158(n)].
For all i, j:
A324400(i) = A324400(j) => a(i) = a(j).
A324401(i) = A324401(j) => a(i) = a(j).

Crossrefs

Cf. A324389, A324530, A324531, A324532 for other similar constructions (also similar by their scatter plots).

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; };
    A000265(n) = (n>>valuation(n,2));
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A336158(n) = A046523(A000265(n));
    A318458(n) = bitand(n, sigma(n)-n);
    Aux336157(n) = [A318458(n), A336158(n)];
    v336157 = rgs_transform(vector(up_to, n, Aux336157(n)));
    A336157(n) = v336157[n];

A324399 Lexicographically earliest sequence such that a(i) = a(j) => f(i) = f(j) for all i, j >= 1, where f(n) = A000265(n) for all other numbers, except that f(n) = 0 if n is an odd prime, and f(1) = -1 and f(2) = -2.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 01 2019

Keywords

Comments

For all i, j:
A324401(i) = A324401(j) => a(i) = a(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; };
    A000265(n) = (n/2^valuation(n, 2));
    Aux324399(n) = if(n<3,-n,if(isprime(n),0,A000265(n)));
    v324399 = rgs_transform(vector(up_to, n, Aux324399(n)));
    A324399(n) = v324399[n];
Showing 1-6 of 6 results.