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 30 results. Next

A237705 Number of primes p < n with pi(n-p) prime, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 11 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 4, and a(n) = 1 only for n = 5, 12, 26, 27, 32, 68.
(ii) For any integer n > 5, there is a prime p <= n with pi(n+p) prime.
(iii) If n > 32, then pi((n-p)^2) is prime for some prime p < n. Also, for each n > 6 there is an odd prime p < 2*n with pi((n - (p-1)/2)^2) prime.
(iv) Any integer n > 11 can be written as p + q with p and pi(q^2 + q + 1) both prime.
(v) Each integer n > 34 can be written as k + m with k and m positive integers such that pi(k^2) and pi(2*m^2) are both prime.

Examples

			a(5) = 1 since 2 and pi(5-2) = pi(3) = 2 are both prime.
a(12) = 1 since 7 and pi(12-7) = pi(5) = 3 are both prime.
a(15) = 2 since 3 and pi(15-3) = pi(12) = 5 are both prime, and 11 and pi(15-11) = pi(4) = 2 are both prime.
a(26) = 1 since 23 and pi(26-23) = 2 are both prime.
a(27) = 1 since 23 and pi(27-23) = 2 are both prime.
a(32) = 1 since 29 and pi(32-29) = 2 are both prime.
a(68) = 1 since 37 and pi(68-37) = pi(31) = 11 are both prime.
		

Crossrefs

Programs

  • Mathematica
    q[n_]:=PrimeQ[PrimePi[n]]
    a[n_]:=Sum[If[q[n-Prime[k]],1,0],{k,1,PrimePi[n-1]}]
    Table[a[n],{n,1,70}]

A237598 a(n) = |{0 < k < prime(n): pi(k*n) is a square}|, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 10 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0.
(ii) For each n > 9, there is a positive integer k < prime(n)/2 such that pi(k*n) is a triangular number.
See also A237612 for the least k > 0 with pi(k*n) a square.

Examples

			a(3) = 1 since pi(3*3) = 2^2 with 3 < prime(3) = 5.
a(6) = 2 since pi(4*6) = 3^2 with 4 < prime(6) = 13, and pi(9*6) =  4^2 with 9 < prime(6) = 13.
a(15) = 1 since pi(28*15) = 9^2 with 28 < prime(15) = 47.
a(62) = 1 since pi(68*62) = 24^2 with 68 < prime(62) = 293.
a(459) = 1 since pi(2544*459) = 301^2 with 2544 < prime(459) = 3253.
		

Crossrefs

Programs

  • Mathematica
    sq[n_]:=IntegerQ[Sqrt[PrimePi[n]]]
    a[n_]:=Sum[If[sq[k*n],1,0],{k,1,Prime[n]-1}]
    Table[a[n],{n,1,70}]

A237612 Least positive integer k such that A000720(k*n) is a square, or 0 if such a number k does not exist.

Original entry on oeis.org

1, 1, 3, 2, 2, 4, 1, 1, 1, 1, 5, 2, 2, 2, 28, 34, 9, 3, 3, 5, 20, 7, 1, 1, 1, 1, 1, 1, 2, 14, 5, 17, 3, 16, 12, 23, 18, 4, 4, 30, 46, 10, 50, 23, 36, 18, 40, 14, 2, 2, 3, 3, 1, 1, 1, 1, 1, 1, 32, 7, 11, 68, 19, 79, 29, 267, 10, 8, 12, 6
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 10 2014

Keywords

Comments

According to the conjecture in A237598, we should always have 0 < a(n) < prime(n).

Examples

			a(3) = 3 since A000720(3*3) = 4 is a square, but neither A000720(1*3) = 2  nor A000720(2*3) = 3 is a square.
		

Crossrefs

Programs

  • Mathematica
    sq[n_]:=IntegerQ[Sqrt[PrimePi[n]]]
    Do[Do[If[sq[k*n],Print[n," ",k];Goto[aa]],{k,1,Prime[n]-1}];
    Print[n," ",0];Label[aa];Continue,{n,1,100}]

A237597 a(n) = |{0 < k < prime(n): n divides pi(k*n)}|, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 10 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0.
See also A237614 for the least k > 0 with pi(k*n) divisible by n.

Examples

			a(6) = 1 since pi(11*6) = 3*6 with 11 < prime(6) = 13.
a(19) = 1 since pi(33*19) = 6*19 with 33 < prime(19) = 67.
a(759) = 1 since pi(2559*759) = 191*759 with 2559 < prime(759) = 5783.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[If[Mod[PrimePi[k*n],n]==0,1,0],{k,1,Prime[n]-1}]
    Table[a[n],{n,1,80}]

A238278 a(n) = |{0 < k < n: the number of primes in the interval ((k-1)*n, k*n] and the number of primes in the interval (k*n, (k+1)*n] are both prime}|.

Original entry on oeis.org

0, 0, 0, 1, 1, 3, 3, 2, 7, 6, 8, 4, 9, 4, 9, 8, 1, 1, 3, 5, 4, 6, 3, 4, 4, 6, 3, 11, 8, 8, 7, 7, 12, 9, 4, 8, 9, 12, 8, 12, 8, 7, 6, 7, 7, 9, 4, 8, 9, 11, 5, 6, 3, 11, 2, 5, 14, 8, 8, 11, 2, 1, 11, 4, 6, 4, 5, 4, 1, 9, 5, 2, 10, 5, 4, 9, 10, 11, 6, 7
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 22 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 3.
(ii) For any integer n > 3, there is a prime p < n such that the number of primes in the interval ((p-1)*n, p*n) is a prime.
We have verified part (i) for n up to 150000.
See also A238277 and A238281 for related conjectures.

Examples

			a(17) = 1 since the interval (9*17, 10*17] contains exactly 3 primes with 3 prime, and the interval (10*17, 11*17] contains exactly 3 primes with 3 prime.
		

Crossrefs

Programs

  • Mathematica
    d[k_,n_]:=PrimePi[k*n]-PrimePi[(k-1)n]
    a[n_]:=Sum[If[PrimeQ[d[k,n]]&&PrimeQ[d[k+1,n]],1,0],{k,1,n-1}]
    Table[a[n],{n,1,80}]

A238281 a(n) = |{0 < k < n: the two intervals (k*n, (k+1)*n) and ((k+1)*n, (k+2)*n) contain the same number of primes}|.

Original entry on oeis.org

0, 1, 2, 1, 2, 3, 3, 1, 5, 2, 4, 4, 8, 3, 7, 4, 4, 4, 2, 3, 7, 3, 10, 4, 12, 7, 7, 15, 7, 9, 8, 5, 8, 9, 11, 8, 8, 10, 8, 4, 10, 10, 10, 11, 7, 10, 8, 11, 8, 8, 9, 9, 8, 11, 7, 8, 13, 10, 8, 14, 13, 4, 14, 8, 11, 12, 14, 12, 8, 10, 16, 12, 16, 12, 14, 19, 11, 14, 8, 9
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 22 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 1. Moreover, if n > 1 is not equal to 8, then there is a positive integer k < n with 2*k + 1 prime such that the two intervals ((k-1)*n, k*n) and (k*n, (k+1)*n) contain the same number of primes.
(ii) For any integer n > 4, there is a positive integer k < prime(n) such that all the three intervals (k*n, (k+1)*n), ((k+1)*n, (k+2)*n), ((k+2)*n, (k+3)*n) contain the same number of primes, i.e., pi(k*n), pi((k+1)*n), pi((k+2)*n), pi((k+3)*n) form a 4-term arithmetic progression.

Examples

			a(8) = 1 since each of the two intervals (7*8, 8*8) and (8*8, 9*8) contains exactly two primes.
		

Crossrefs

Programs

  • Mathematica
    d[k_,n_]:=PrimePi[(k+1)*n]-PrimePi[k*n]
    a[n_]:=Sum[If[d[k,n]==d[k+1,n],1,0],{k,1,n-1}]
    Table[a[n],{n,1,80}]

A238573 a(n) = |{0 < k <= n: prime(k*n) + 2 is prime}|.

Original entry on oeis.org

0, 1, 1, 0, 3, 0, 4, 1, 2, 3, 1, 3, 4, 4, 4, 4, 1, 3, 6, 5, 3, 3, 4, 6, 3, 8, 5, 6, 3, 4, 2, 10, 6, 5, 7, 8, 6, 8, 7, 5, 7, 5, 11, 7, 7, 8, 8, 11, 6, 5, 7, 11, 11, 7, 4, 9, 7, 3, 5, 7, 7, 11, 8, 13, 9, 8, 7, 7, 12, 10, 8, 11, 8, 15, 8, 9, 9, 15, 13, 4
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 01 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 6, and a(n) = 1 only for n = 2, 3, 8, 11, 17. Moreover, for any n > 0 there exists a positive integer k < 3*sqrt(n) + 6 such that prime(k*n) + 2 is prime.
(ii) For any integer n > 6, prime(k^2*n) + 2 is prime for some k = 1, ..., n.
(iii) If n > 5, then prime(k^2*(n-k)) + 2 is prime for some 0 < k < n.
Clearly, each of the three parts implies the twin prime conjecture.
We have verified part (i) of the conjecture for n up to 2*10^6.

Examples

			a(2) = 1 since prime(1*2) + 2 = 3 + 2 = 5 is prime.
a(3) = 1 since prime(1*3) + 2 = 5 + 2 = 7 is prime.
a(8) = 1 since prime(8*8) + 2 = 311 + 2 = 313 is prime.
a(11) = 1 since prime(3*11) + 2 = 137 + 2 = 139 is prime.
a(17) = 1 since prime(1*17) + 2 = 59 + 2 = 61 is prime.
		

Crossrefs

Programs

  • Mathematica
    p[k_,n_]:=PrimeQ[Prime[k*n]+2]
    a[n_]:=Sum[If[p[k,n],1,0],{k,1,n}]
    Table[a[n],{n,1,80}]

A237614 Least positive integer k with A000720(k*n) divisible by n, or 0 if such a number k does not exist.

Original entry on oeis.org

1, 2, 2, 2, 6, 11, 11, 7, 3, 3, 3, 8, 13, 13, 8, 14, 14, 14, 33, 33, 9, 15, 9, 4, 4, 42, 22, 22, 43, 4, 36, 99, 10, 10, 10, 10, 38, 38, 38, 38, 31, 24, 17, 17, 17, 62, 24, 194, 55, 80, 11, 40, 11, 11, 11, 11, 11, 57, 11, 11, 33, 18, 18, 83, 164, 5, 5, 5, 156, 5
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 10 2014

Keywords

Comments

According to the conjecture in A237597, we should always have 0 < a(n) < prime(n).

Examples

			a(3) = 2 since pi(2*3) = 3 is divisible by 3, but pi(1*3) = 2 is not.
		

Crossrefs

Programs

  • Mathematica
    Do[Do[If[Mod[PrimePi[k*n],n]==0,Print[n," ",k];Goto[aa]],{k,1,Prime[n]-1}];
    Print[n," ",0];Label[aa];Continue,{n,1,70}]

A243164 Number of primes p < n such that p*n is a primitive root modulo prime(n).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, May 31 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 6.
(ii) Any integer n > 6 can be written as k + m with k > 0 and m > 0 such that k*m is a primitive root modulo prime(n).
We have verified part (i) for all n = 7, ..., 2*10^5.

Examples

			a(4) = 1 since 3 is prime with 3*4 = 12 a primitive root modulo prime(4) = 7.
a(9) = 1 since 7 is prime with 7*9 = 63 a primitive root modulo prime(9) = 23.
a(10) = 1 since 5 is prime with 5*10 = 50 a primitive root modulo prime(10) = 29.
a(12) = 1 since 2 is prime with 2*12 = 24 a primitive root modulo prime(12) = 37.
		

Crossrefs

Programs

  • Mathematica
    dv[n_]:=Divisors[n]
    Do[m=0;Do[Do[If[Mod[(Prime[k]*n)^(Part[dv[Prime[n]-1],i]),Prime[n]]==1,Goto[aa]],{i,1,Length[dv[Prime[n]-1]]-1}];m=m+1;Label[aa];Continue,{k,1,PrimePi[n-1]}];Print[n," ",m];Continue,{n,1,80}]

A237615 a(n) = |{0 < k < n: k^2 + k - 1 and pi(k*n) are both prime}|, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 10 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 5.
(ii) For each n = 4, 5, ..., there is a positive integer k < n with k^2 + k - 1 and pi(k*n) + 1 both prime. Also, for any integer n > 6, there is a positive integer k < n with k^2 + k - 1 and pi(k*n) - 1 both prime.
(iii) For every integer n > 15, there is a positive integer k < n such that pi(k) - 1 and pi(k*n) are both prime.
Note that part (i) is a refinement of the first assertion in the comments in A237578.

Examples

			a(8) = 1 since 4^2 + 4 - 1 = 19 and pi(4*8) = 11 are both prime.
a(33) = 1 since 28^2 + 28 - 1 = 811 and pi(28*33) = 157 are both prime.
		

Crossrefs

Programs

  • Mathematica
    p[k_,n_]:=PrimeQ[k^2+k-1]&&PrimeQ[PrimePi[k*n]]
    a[n_]:=Sum[If[p[k,n],1,0],{k,1,n-1}]
    Table[a[n],{n,1,70}]
Showing 1-10 of 30 results. Next