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.

A197637 Number of non-Wilson primes <= n.

This page as a plain text file.
%I A197637 #17 May 21 2016 22:51:04
%S A197637 0,1,2,2,2,2,3,3,3,3,4,4,4,4,4,4,5,5,6,6,6,6,7,7,7,7,7,7,8,8,9,9,9,9,
%T A197637 9,9,10,10,10,10,11,11,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,
%U A197637 14,15,15,16,16,16,16,16,16,17,17,17,17,18,18,19,19,19,19,19,19,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23
%N A197637 Number of non-Wilson primes <= n.
%C A197637 The analog of pi(n) for non-Wilson primes.
%C A197637 An inverse function of A197636, as A197636(a(n)) = n if and only if n is a non-Wilson prime, i.e., a member of A197636.
%C A197637 Empirical evidence suggests that the sequence is unbounded, i.e., that A197636 is infinite, although no proof seems to be known. - _Felix Fröhlich_, May 18 2016
%H A197637 Felix Fröhlich, <a href="/A197637/b197637.txt">Table of n, a(n) for n = 1..10000</a>
%H A197637 E. Costa, R. Gerbicz and D. Harvey, <a href="http://dx.doi.org/10.1090/S0025-5718-2014-02800-7">A search for Wilson primes</a>, Mathematics of Computation, 83 (2014), 3071-3091 (arXiv:<a href="http://arxiv.org/abs/1209.3436">1209.3436</a> [math.NT], 2012).
%F A197637 a(A197636(n)) = n
%e A197637 There are 3 non-Wilson primes <= 8, namely 2, 3, and 7, so a(8) = 3.
%t A197637 nmax = 100; nonWilsonQ[p_] := Mod[((p-1)! + 1)/p, p] != 0; nonWilsonPrimes = Select[ Prime[ Range[nmax + 2]], nonWilsonQ]; a[n_] := Count[ nonWilsonPrimes, k_ /; k <= n]; Table[a[n], {n, 1, nmax}] (* _Jean-François Alcover_, Oct 10 2012 *)
%o A197637 (PARI) my(i=0); for(n=1, 50, if(ispseudoprime(n) && Mod((n-1)!, n^2)!=-1, i++); print1(i, ", ")) /* _Felix Fröhlich_, May 18 2016 */
%o A197637 (PARI) /* The following program is valid up to n = 2*10^13 (cf. Costa, Gerbicz, Harvey, 2014) */
%o A197637 my(w=[5, 13, 563], i=0); for(n=1, 200, for(k=1, #w, if(n==w[k], i++)); print1(primepi(n)-i, ", ")) /* _Felix Fröhlich_, May 18 2016 */
%Y A197637 Cf. A000720, A197636.
%K A197637 nonn
%O A197637 1,3
%A A197637 _Jonathan Sondow_, Oct 19 2011