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.

Previous Showing 11-20 of 30 results. Next

A237657 a(n) = |{n < m < 2*n: pi(m) and pi(m^2) are both prime}|, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 10 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 8.
(ii) For any integer n > 1 there is a prime p <= n such that n + pi(p) is prime. Also, for n > 5 there is a prime p with n < p < 2*n such that pi(p) is prime.
(iii) For each n > 20, there is a prime p with n < p < 2*n such that pi(p^2) is prime.

Examples

			a(4) = 1 since pi(6) = 3 and pi(6^2) = 11 are both prime.
a(10) = 1 since pi(17) = 7 and pi(17^2) = 61 are both prime.
a(17) = 1 since pi(33) = 11 and pi(33^2) = 181 are both prime.
		

Crossrefs

Programs

  • Mathematica
    q[n_]:=PrimeQ[PrimePi[n]]&&PrimeQ[PrimePi[n^2]]
    a[n_]:=Sum[If[q[m],1,0],{m,n+1,2n-1}]
    Table[a[n],{n,1,70}]

A237840 a(n) = |{0 < k <= n: the number of twin prime pairs not exceeding k*n is a square}|.

Original entry on oeis.org

1, 2, 2, 1, 3, 3, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 3, 1, 3, 4, 3, 4, 4, 3, 3, 4, 2, 2, 4, 2, 3, 2, 1, 3, 2, 2, 2, 1, 2, 1, 2, 2, 2, 4, 3, 2, 2, 1, 3, 4, 3, 1, 3, 1, 2, 4, 2, 5, 2, 3, 2, 3, 1, 3, 2, 4, 4, 1, 3, 2, 4, 2, 4, 4, 4, 4
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 14 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0, and a(n) = 1 for no n > 159.
(ii) For every n = 1, 2, 3, ..., there is a positive integer k <= n such that the number |{{p, 2*p+1}: both p and 2*p + 1 are primes not exceeding k*n}| is a square.
We have verified that a(n) > 0 for all n = 1, ..., 22000.
See also A237879 for the least k among 1, ..., n such that the number of twin prime pairs not exceeding k*n is a square.

Examples

			a(4) = 1 since the number of twin prime pairs not exceeding 1*4 = 4 is 0^2.
a(9) = 1 since there are exactly 2^2 twin prime pairs not exceeding 3*9 = 27 (namely, they are {3, 5}, {5, 7}, {11, 13} and {17, 19}).
a(18055) > 0 since there are exactly 675^2 = 455625 twin prime pairs not exceeding 5758*18055 = 103960690.
a(18120) > 0 since there are exactly 729^2 = 531441 twin prime pairs not exceeding 6827*18120 = 123705240.
a(18307) > 0 since there are exactly 681^2 = 463761 twin prime pairs not exceeding 5792*18307 = 106034144.
a(18670) > 0 since there are exactly 683^2 = 466489 twin prime pairs not exceeding 5716*18670 = 106717720.
a(19022) > 0 since there are exactly 737^2 = 543169 twin prime pairs not exceeding 6666*19022 = 126800652.
a(19030) > 0 since there are exactly 706^2 = 498436 twin prime pairs not exceeding 6045*19030 = 115036350.
a(19805) > 0 since there are exactly 717^2 = 514089 twin prime pairs not exceeding 6015*19805 = 119127075.
a(19939) > 0 since there are exactly 1000^2 = 10^6 twin prime pairs not exceeding 12660*19939 = 252427740.
a(20852) > 0 since there are exactly 747^2 = 558009 twin prime pairs not exceeding 6268*20852 = 130700336.
a(21642) > 0 since there are exactly 724^2 = 524176 twin prime pairs not exceeding 5628*21642 = 121801176.
		

Crossrefs

Programs

  • Mathematica
    tw[0]:=0
    tw[n_]:=tw[n-1]+If[PrimeQ[Prime[n]+2],1,0]
    SQ[n_]:=IntegerQ[Sqrt[tw[PrimePi[n]]]]
    a[n_]:=Sum[If[SQ[k*n-2],1,0],{k,1,n}]
    Table[a[n],{n,1,80}]

A238576 Number of odd primes p < 2*n with prime(n*(p-1)/2)^2 - 2 prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 01 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 1, and a(n) = 1 only for n = 2, 7, 23, 61, 73.
(ii) For any integer n > 1, there is an odd prime p < 2*n with prime(n*(p+1)/2)^2 - 2 prime.
Clearly, either part of the conjecture implies that there are infinitely many primes of the form p^2 - 2 with p prime.

Examples

			a(2) = 1 since 2 and prime(2*(3-1)/2)^2 - 2 = 3^2 - 2 = 7 are both prime.
a(7) = 1 since 5 and prime(7*(5-1)/2)^2 - 2 = 43^2 - 2 = 1847 are both prime.
a(23) = 1 since 29 and prime(23*(29-1)/2)^2 - 2 = 2137^2 - 2 = 4566767 are both prime.
a(61) = 1 since 43 and prime(61*(43-1)/2)^2 - 2 = 10463^2 - 2 = 109474367 are both prime.
a(73) = 1 since 7 and prime(73*(7-1)/2)^2 - 2 = 1367^2 - 2 = 1868687 are both prime.
		

Crossrefs

Programs

  • Mathematica
    p[k_,n_]:=PrimeQ[Prime[(Prime[k]-1)/2*n]^2-2]
    a[n_]:=Sum[If[p[k,n],1,0],{k,2,PrimePi[2n-1]}]
    Table[a[n],{n,1,80}]

A237643 Least positive integer m such that {A000720(k*n): k = 1, ..., m} contains a complete system of residues modulo n, or 0 if such a number m does not exist.

Original entry on oeis.org

1, 2, 3, 8, 8, 12, 13, 14, 27, 25, 32, 25, 16, 23, 94, 41, 46, 67, 38, 60, 77, 55, 84, 46, 88, 79, 85, 113, 82, 155, 114, 141, 178, 132, 124, 176, 155, 96, 135, 176, 146, 148, 126, 125, 183, 191, 185, 194, 166, 261, 378, 230, 278, 203, 199, 161, 293, 286, 175, 274
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 10 2014

Keywords

Comments

Conjecture: a(n) is always positive. Moreover, a(n) <= 2*prime(n) for all n > 0.
Note that a(15) = 94 = 2*prime(15).

Examples

			a(4) = 8 since {A000720(4*k): k = 1, ..., 8} = {2, 4, 5, 6, 8, 9, 9, 11} contains a complete system of residues modulo 4, but {pi(4*k): k = 1, ..., 7} contains no integer congruent to 3 modulo 4.
		

Crossrefs

Programs

  • Mathematica
    q[m_,n_]:=Length[Union[Table[Mod[PrimePi[k*n],n],{k,1,m}]]]
    Do[Do[If[q[m,n]==n,Print[n," ",m];Goto[aa]],{m,n,2*Prime[n]}];
    Print[n," ",0];Label[aa];Continue,{n,1,60}]

A238224 Number of pairs {j, k} with 0 < j < k <= n and k == 1 (mod j) such that pi(j*n) divides pi(k*n), where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 20 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1.
This is a refinement of part (i) of the conjecture in A238165.
We have verified the conjecture for n up to 21500.

Examples

			a(18) = 1 since 6 == 1 (mod 1), and pi(1*18) = 7 divides pi(6*18) = 28.
a(50) = 1 since 7 == 1 (mod 3), and pi(3*50) = 35 divides pi(7*50) = 70.
a(379) = 1 since 353 == 1 (mod 4), and pi(4*379) = 240 divides pi(353*379) = 12480.
		

Crossrefs

Programs

  • Mathematica
    m[k_,j_,n_]:=Mod[PrimePi[k*n],PrimePi[j*n]]==0
    a[n_]:=Sum[If[m[j*q+1,j,n],1,0],{j,1,n-1},{q,1,(n-1)/j}]
    Table[a[n],{n,1,80}]

A237582 a(n) = |{0 < k < n: pi(n + k^2) is prime}|, where pi(.) is given by A000720.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 2, 3, 2, 3, 4, 1, 2, 2, 3, 6, 6, 5, 5, 5, 5, 6, 7, 7, 6, 5, 6, 5, 6, 7, 8, 9, 8, 10, 9, 8, 6, 6, 6, 6, 7, 9, 9, 10, 11, 11, 13, 11, 9, 9, 10, 10, 8, 6, 6, 5, 4, 8, 9, 10, 12, 11, 14, 15, 15, 15, 12, 14, 15, 17, 16, 13, 11, 11, 13, 16, 18, 24, 25, 20
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 09 2014

Keywords

Comments

Conjecture: (i) For each a = 2, 3, ... there is a positive integer N(a) such that for any integer n > N(a) there is a positive integer k < n with pi(n + k^a) prime. In particular, we may take (N(2), N(3), ..., N(9)) = (1, 1, 9, 26, 8, 9, 18, 1).
(ii) If n > 6, then pi(n^2 + k^2) is prime for some 0 < k < n. If n > 27, then pi(n^3 + k^3) is prime for some 0 < k < n. In general, for each a = 2, 3, ..., if n is sufficiently large then pi(n^a + k^a) is prime for some 0 < k < n.
For any integer n > 1, it is easy to show that pi(n + k) is prime for some 0 < k < n.

Examples

			a(5) = 1 since pi(5 + 1^2) = 3 is prime.
a(6) = 1 since pi(6 + 5^2) = pi(31) = 11 is prime.
a(9) = 2 since pi(9 + 3^2) = pi(18) = 7 and pi(9 + 5^2) = pi(34) = 11 are both prime.
a(12) = 1 since pi(12 + 10^2) = pi(112) = 29 is prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[PrimePi[n]]
    a[n_]:=Sum[If[p[n+k^2],1,0],{k,1,n-1}]
    Table[a[n],{n,1,80}]

A237595 a(n) = |{1 <= k <= n: n + pi(k^2) is prime}|, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 09 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 4.
(ii) If n > 1 then n + pi(k*(k-1)) is prime for some k = 1, ..., n.
(iii) For any integer n > 1, there is a positive integer k <= (n+1)/2 such that pi(n + k*(k+1)/2) is prime.
(iv) Any integer n > 1 can be written as p + pi(k*(k+1)/2), where p is a prime and k is among 1, ..., n-1.

Examples

			a(2) = 1 since 2 + pi(1^2) = 2 is prime.
a(6) = 1 since 6 + pi(6^2) = 6 + 11 = 17 is prime.
a(10) = 1 since 10 + pi(5^2) = 10 + 9 = 19 is prime.
a(21) = 2 since 21 + pi(2^2) = 23 and 21 + pi(9^2) = 43 are both prime.
a(24) = 1 since 24 + pi(21^2) = 24 + 85 = 109 is prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[If[PrimeQ[n+PrimePi[k^2]],1,0],{k,1,n}]
    Table[a[n],{n,1,70}]

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

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 24 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 5.
This implies that there are infinitely many positive integers m with m + pi(m) prime.

Examples

			a(6) = 1 since 2*6 + pi(2*6) = 12 + 5 = 17 is prime.
a(47) = 1 since 21*47 + pi(21*47) = 987 + 166 = 1153 is prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[n+PrimePi[n]]
    a[n_]:=Sum[If[p[k*n],1,0],{k,1,n-1}]
    Table[a[n],{n,1,100}]

A237839 a(n) = |{0 < k <= n: q = |{p <= k*n: p and p + 2 are both prime}| and q + 2 are both prime}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 14 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3, and a(n) = 1 only for n = 5, 9, 25, 77, 104.
See also A237838 for a similar conjecture involving Sophie Germain primes.

Examples

			a(9) = 1 since {p <= 4*9: p and p + 2 are both prime} = {3, 5, 11, 17, 29} has cardinality 5 and {5, 7} is a twin prime pair.
		

Crossrefs

Programs

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

A238645 Number of odd primes p < 2*n such that the number of squarefree numbers among 1, ..., ((p-1)/2)*n is prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 02 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1, and a(n) = 1 only for n = 2, 4, 7, 14, 19, 29.
This is an analog of the conjecture in A237578 for squarefree numbers. We have verified it for n up to 20000.
See also A238646 for a similar conjecture involving squarefree numbers.

Examples

			a(4) = 1 since 3 is prime and there are exactly 3 squarefree numbers among 1, ..., (3-1)/2*4 (namely, 1, 2, 3).
a(14) = 1 since 5 and 17 are both prime, and there are exactly 17 squarefree numbers among 1, ..., (5-1)/2*14.
a(19) = 1 since 3 and 13 are both prime, and there are exactly 13 squarefree numbers among 1, ..., (3-1)/2*19 (namely, 1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19).
a(29) = 1 since 41 and 353 are both prime, and there are exactly 353 squarefree numbers among 1, ..., (41-1)/2*29 = 580.
		

Crossrefs

Programs

  • Mathematica
    s[n_]:=Sum[If[SquareFreeQ[k],1,0],{k,1,n}]
    a[n_]:=Sum[If[PrimeQ[s[(Prime[k]-1)/2*n]],1,0],{k,2,PrimePi[2n-1]}]
    Table[a[n],{n,1,80}]
Previous Showing 11-20 of 30 results. Next