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.

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

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 09 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2, and a(n) = 1 only for n = 5, 8, 13. Moreover, for each n = 1, 2, 3, ..., there is a positive integer k < 3*sqrt(n) + 3 with pi(k*n) prime.
Note that the least positive integer k with pi(k*38) prime is 21 < 3*sqrt(38) + 3 < 21.5.

Examples

			a(5) = 1 since pi(1*5) = 3 is prime.
a(8) = 1 since pi(4*8) = 11 is prime.
a(13) = 1 since pi(10*13) = pi(130) = 31 is prime.
a(38) = 3 since pi(21*38) = pi(798) = 139, pi(28*38) = pi(1064) = 179 and pi(31*38) = pi(1178) = 193 are all prime.
		

Crossrefs

Programs

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

A237497 a(n) = |{0 < k <= n/2: pi(k*(n-k)) is prime}|, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 08 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 10, and a(n) = 1 for no n > 51. Moreover, for any integer n > 10, there is a positive integer k < n with 2*k + 1 and pi(k*(n-k)) both prime.

Examples

			a(6) = 1 since 6 = 1 + 5 with pi(1*5) = 3 prime.
a(8) = 1 since 8 = 2 + 6 with pi(2*6) = pi(12) = 5 prime.
a(25) = 1 since 25 = 4 + 21 with pi(4*21) = pi(84) = 23 prime.
a(51) = 1 since 51 = 14 + 37 with pi(14*37) = pi(518) = 97 prime.
		

Crossrefs

Programs

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

A237496 Number of ordered ways to write n = k + m (0 < k <= m) with pi(k) + pi(m) - 2 prime, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 08 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 5.
(ii) Any integer n > 23 can be written as k + m (k > 0 and m > 0) with pi(k) + pi(m) prime. Also, each integer n > 25 can be written as k + m (k > 0 and m > 0) with pi(k) + pi(m) - 1 prime.

Examples

			a(6) = 1 since 6 = 3 + 3 with pi(3) + pi(3) - 2 = 2 + 2 - 2 = 2 prime.
a(17) = 1 since 17 = 2 + 15 with pi(2) + pi(15) - 2 = 1 + 6 - 2 = 5 prime.
a(99) = 1 since 99 = 1 + 98 with pi(1) + pi(98) - 2 = 0 + 25 - 2 = 23 prime.
		

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=n>0&&PrimeQ[n]
    p[k_,m_]:=PQ[PrimePi[k]+PrimePi[m]-2]
    a[n_]:=Sum[If[p[k,n-k],1,0],{k,1,n/2}]
    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}]

A383134 Array read by ascending antidiagonals: A(n,k) is the length of the arithmetic progression of only primes having difference n and first term prime(k).

Original entry on oeis.org

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

Views

Author

Stefano Spezia, Apr 17 2025

Keywords

Examples

			The array begins as:
  2, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 3, 2, 1, 2, 1, 2, 1, 1, 2, ...
  2, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 3, 1, 2, 1, 2, 1, 2, 1, 1, ...
  2, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 1, 5, 3, 4, 2, 3, 1, 2, 1, ...
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 3, 2, 1, 2, 1, 1, 1, 2, 2, ...
  2, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 3, 1, 2, 1, 2, 1, 2, 1, 1, ...
  ...
A(2,2) = 3 since 3 primes are in arithmetic progression with a difference of 2 and the first term equal to the 2nd prime: 3, 5, and 7.
A(6,3) = 5 since 5 primes are in arithmetic progression with a difference of 6 and the first term equal to the 3rd prime: 5, 11, 17, 23, and 29.
		

References

  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 139.

Crossrefs

Programs

  • Mathematica
    A[n_,k_]:=Module[{count=1,sum=Prime[k]},While[PrimeQ[sum+=n], count++]; count]; Table[A[n-k+1,k],{n,13},{k,n}]//Flatten

Formula

A(A006512(n),k) = 1 for n > 1.
A(A040976(n),k) = A054977(k+1).
Showing 1-6 of 6 results.