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.

A086685 Number of 1 <= i < n such that i*n+1 is prime.

Original entry on oeis.org

0, 1, 1, 2, 1, 4, 2, 2, 3, 5, 3, 6, 4, 5, 5, 5, 3, 10, 2, 6, 6, 9, 4, 9, 5, 9, 7, 11, 4, 17, 3, 10, 9, 12, 9, 15, 4, 9, 11, 13, 5, 21, 7, 11, 10, 16, 8, 19, 6, 18, 13, 17, 5, 23, 10, 18, 9, 16, 8, 27, 7, 15, 13, 16, 13, 29, 9, 18, 13, 27, 9, 26, 10, 19, 18, 17, 11, 29, 11, 23, 18, 22, 11, 32
Offset: 1

Views

Author

Jon Perry, Jul 28 2003

Keywords

Comments

Number of primes p < n^2 such that p == 1 (mod n). The standard conjecture here is that a(n) ~ n^2/(2 phi(n)log n), where Euler's totient function phi(n) = A000010(n). - Thomas Ordowski, Oct 21 2014
Number of primes appearing in the 1st column of an n X n square array whose elements are the numbers from 1..n^2, listed in increasing order by rows. - Wesley Ivan Hurt, May 17 2021

Examples

			For n=10, i=1,3,4,6,7 give primes, so a(10)=5.
		

Crossrefs

Cf. A000010 (phi), A000720 (pi).

Programs

  • Mathematica
    f[n_] := Length[ Select[ Range[n - 1], PrimeQ[n# + 1] & ]]; Table[ f[n], {n, 1, 85}]
    Table[Count[Range[n-1]n+1,?PrimeQ],{n,90}] (* _Harvey P. Dale, Oct 10 2013 *)
  • PARI
    nphi(n)=local(c); c=0; for (i=1,n-1,if (isprime(i*n+1),c++)); c for(i=1,60,print1(","nphi(i)))

Formula

a(n) = Sum_{k=1..n} pi(1+n*(k-1)) - pi(n*(k-1)), where pi is the prime counting function. - Wesley Ivan Hurt, May 17 2021

Extensions

Extended by Robert G. Wilson v, Jul 31 2003