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

A319714 Filter sequence combining the largest proper divisor of n (A032742) with n's residue modulo 4 (A010873).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 26 2018

Keywords

Comments

Restricted growth sequence transform of A286474, or equally, of A286473.

Crossrefs

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; };
    A032742(n) = if(1==n,n,n/vecmin(factor(n)[,1]));
    A286474(n) = if(1==n,n,(4*A032742(n) + (n % 4)));
    v319714 = rgs_transform(vector(up_to,n,A286474(n)));
    A319714(n) = v319714[n];

A319350 Filter sequence which records the number of cyclotomic cosets of 2 mod p for odd primes p, and for any other number assigns a unique number.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 26 2018

Keywords

Comments

Restricted growth sequence transform of function f defined as f(n) = A006694((n-1)/2) when n is an odd prime, otherwise -n.
For all i, j:
a(i) = a(j) => A305801(i) = A305801(j),
a(i) = a(j) => A319351(i) = A319351(j).

Examples

			a(3) = a(5) = a(11) = a(13) = a(19) = a(29) = a(37) because 3, 5, 11, 13, 19, 29, 37 are primes p for which A006694((p-1)/2) = 1 (are in A001122).
a(7) = a(17) = a(23) = a(41) = a(47) because 7, 17, 23, 41, 47 are primes p for which A006694((p-1)/2) = 2 (are in A115591).
		

Crossrefs

Cf. A001122 (positions of 3's), A115591 (positions of 6's).
Cf. also A319704, A319705, A319706.

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; };
    A319350aux(n) = if((n<=2)||!isprime(n),n,-((n-1)/znorder(Mod(2, n))));
    v319350 = rgs_transform(vector(up_to,n,A319350aux(n)));
    A319350(n) = v319350[n];

A319705 Filter sequence which for primes p records a distinct value for each distinct multiset formed from the lengths of 1-runs in its binary representation [A286622(p)], and for all other numbers assigns a unique number.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 26 2018

Keywords

Comments

Restricted growth sequence transform of function f defined as f(n) = A278222(n) when n is a prime, otherwise -n.
After its initial term 3, Fermat primes (A019434) gives the positions of 5 in this sequence, while the Mersenne primes (A000668) are each assigned to their own singleton equivalence class.
For all i, j:
a(i) = a(j) => A305900(i) = A305900(j),
a(i) = a(j) => A286622(i) = A286622(j),
a(i) = a(j) => A305795(i) = A305795(j).

Crossrefs

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; };
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A278222(n) = A046523(A005940(1+n));
    A319705aux(n) = if(isprime(n),A278222(n),-n);
    v319705 = rgs_transform(vector(up_to,n,A319705aux(n)));
    A319705(n) = v319705[n];

A320004 Filter sequence combining the largest proper divisor of n (A032742) with n's residue modulo 4 (A010873), and a single bit (A319710) telling whether the smallest prime factor is unitary.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 04 2018

Keywords

Comments

Restricted growth sequence transform of triple [A010873(A020639(n)), A032742(n), A319710(n)], or equally, of ordered pair [A319714(n), A319710(n)].
Here any nontrivial equivalence classes (that is, when we exclude the singleton classes and two infinite classes of A002144 and A002145), like the example shown, may not contain any even numbers, nor any numbers from A283050. See additional comments in A319717 and A319994.
For all i, j:
a(i) = a(j) => A024362(i) = A024362(j),
a(i) = a(j) => A067029(i) = A067029(j),
a(i) = a(j) => A071178(i) = A071178(j),
a(i) = a(j) => A077462(i) = A077462(j) => A101296(i) = A101296(j).

Examples

			For n = 33 (3*11) and n = 77 (7*11), the modulo 4 residue of the smallest prime factor is 3, and the largest proper divisors (A032742) is also equal 11, and the smallest prime factor is unitary. Thus a(33) = a(77) (= 25, a running count value allotted by rgs-transform).
		

Crossrefs

Cf. also A319717 (analogous sequence for modulo 6 residues).
Cf. A002145 (positions of 3's), A002144 (positions of 5's).
Differs from A319704 for the first time at n=77, and from A319714 for the first time at n=49.

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; };
    A032742(n) = if(1==n,n,n/vecmin(factor(n)[,1]));
    A286474(n) = if(1==n,n,(4*A032742(n) + (n % 4)));
    A319710(n) = ((n>1)&&(factor(n)[1,2]>1));
    v320004 = rgs_transform(vector(up_to,n,[A286474(n),A319710(n)]));
    A320004(n) = v320004[n];

A331304 For n <= 4, a(n) = n, for n > 4, if n is prime, a(n) = 3 + 2*A000035(A000720(n)), otherwise a(n) = 3 + n - A000720(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 18 2020

Keywords

Comments

Restricted growth sequence transform of function f defined as: f(n) = A071986(n) when n is an odd prime, otherwise f(n) = -n.
For all i, j:
a(i) = a(j) => A305801(i) = A305801(j),
a(i) = a(j) => A329647(i) = A329647(j),
a(i) = a(j) => A329903(i) = A329903(j).

Crossrefs

Programs

  • PARI
    A331304(n) = if(n<=4,n,if(isprime(n),3+2*(primepi(n)%2),3+n-primepi(n)));

Formula

For n <= 4, a(n) = n, for n > 4, if n is prime, a(n) = 3 + 2*A000035(A000720(n)), otherwise a(n) = 3 + n - A000720(n).

A319707 Filter sequence which records for primes their residue modulo 6, and for all other numbers assigns a unique number.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 04 2018

Keywords

Comments

Restricted growth sequence transform of function f defined as f(n) = A010875(n) when n is a prime, otherwise -n.
Primes of the form 6k+5 (A007528) get value 5, and the primes of the form 6k+1 (A002476) get value 7, while for all other n, a(n) is assigned to a unique running count.
For all i, j:
a(i) = a(j) => A010875(i) = A010875(j),
a(i) = a(j) => A305900(i) = A305900(j),
a(i) = a(j) => A319717(i) = A319717(j) => A319716(i) = A319716(j).

Crossrefs

Cf. A007528 (positions of 5's), A002476 (positions of 7's).
Cf. also A319704.
Differs from A319716 for the first time at n=121.

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; };
    A319707aux(n) = if(isprime(n),(n%6),-n);
    v319707 = rgs_transform(vector(up_to,n,A319707aux(n)));
    A319707(n) = v319707[n];

A323081 Lexicographically earliest such sequence a that for all i, j, a(i) = a(j) => f(i) = f(j), where f(p) = -(p mod 4) for primes p, and f(n) = A252463(n) for any other numbers.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 03 2019

Keywords

Comments

For all i, j:
A319704(i) = A319704(j) => a(i) = a(j) => A322805(i) = A322805(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; };
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A252463(n) = if(!(n%2),n/2,A064989(n));
    A323081aux(n) = if(isprime(n),-(n%4),A252463(n));
    v323081 = rgs_transform(vector(up_to,n,A323081aux(n)));
    A323081(n) = v323081[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];

A323074 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = -(n mod 4) if n is a prime, and f(n) = A300840(n) for any other number.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 04 2019

Keywords

Comments

For all i, j:
A319704(i) = A319704(j) => a(i) = a(j) => A323082(i) = A323082(j).

Crossrefs

Programs

  • PARI
    up_to = 65539;
    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));
    A050376list(up_to) = { my(v=vector(up_to), i=0); for(n=1,oo,if(A302777(n), i++; v[i] = n); if(i == up_to,return(v))); };
    v050376 = A050376list(up_to);
    A050376(n) = v050376[n];
    A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
    A052331(n) = { my(s=0,e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&A302777(n/d), e = vecsearch(v050376, n/d); if(!e, print("v050376 too short!"); return(1/0)); s += 2^(e-1); n = d; break))); (s); };
    A300840(n) = A052330(A052331(n)>>1);
    A323074aux(n) = if(isprime(n),-(n%4),A300840(n));
    v323074 = rgs_transform(vector(up_to,n,A323074aux(n)));
    A323074(n) = v323074[n];
Showing 1-10 of 10 results.