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.

A238878 a(n) = |{0 < k <= n: prime(prime(k)) - prime(k) + 1 and prime(prime(k*n)) - prime(k*n) + 1 are both prime}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 06 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0, and a(n) = 1 only for n = 1, 4, 5, 19, 77.
(ii) For any integer n > 0, there is a number k among 1, ..., n such that 2*k + 1 and prime(prime(k^2*n)) - prime(k^2*n) + 1 are both prime.

Examples

			a(5) = 1 since prime(prime(4)) - prime(4) + 1 = prime(7) - 7 + 1 = 17 - 6 = 11 and prime(prime(4*5)) - prime(4*5) + 1 = prime(71) - 71 + 1 = 353 - 70 = 283 are both prime.
a(77) = 1 since prime(prime(3)) - prime(3) + 1 = prime(5) - 5 + 1 = 11 - 4 = 7 and prime(prime(3*77)) - prime(3*77) + 1 = prime(1453) - 1453 + 1 = 12143 - 1452 = 10691 are both prime.
		

Crossrefs

Programs

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