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.

A261625 Number of primes p <= n such that (p-1)*n+1 is prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Aug 27 2015

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1.

Examples

			a(53) = 1 since 3 and (3-1)*53+1 = 107 are both prime.
		

Crossrefs

Programs

  • Mathematica
    Do[r=0;Do[If[PrimeQ[(Prime[k]-1)n+1],r=r+1],{k,1,PrimePi[n]}];Print[n," ",r];Continue,{n,1,80}]
  • PARI
    a(n) = my(nb=0); forprime(p=2, n, if (isprime((p-1)*n+1), nb++)); nb; \\ Michel Marcus, Aug 27 2015