%I #29 Nov 08 2024 07:57:46
%S 1,5,13,563,5971,558771,1964215,8121909,12326713,23025711,26921605,
%T 341569806,399292158
%N Wilson numbers: k such that the generalized Wilson quotient A157249(k) is divisible by k.
%C A prime p is a Wilson prime if p divides its Wilson quotient A007619. A number n is a Wilson number if n divides its generalized Wilson quotient A157249.
%C The sequence contains all Wilson numbers <= 5 x 10^8. Heuristics suggest that #(Wilson numbers < N) is about (6/pi^2) log N, for large N.
%C A Wilson number is prime if and only if it is a Wilson prime A007540. Only three are known: 5, 13, 563.
%C The first composite Wilson number 5971 was discovered by Kloss, the others by Agoh, Dilcher, and Skula. Every known composite Wilson number n has at least two odd prime factors, so e(n) = -1.
%C For additional references and links, see A007540.
%D L. E. Dickson, History of the Theory of Numbers, vol. 1, Divisibility and Primality, Chelsea, New York, 1966, p. 65.
%H T. Agoh, K. Dilcher, and L. Skula, <a href="https://doi.org/10.1090/S0025-5718-98-00951-X">Wilson quotients for composite moduli</a>, Math. Comp. 67 (1998), 843-861.
%H K. E. Kloss, <a href="http://dx.doi.org/10.6028/jres.069B.035">Some Number-Theoretic Calculations</a>, J. Research of the National Bureau of Standards-B. Mathematics and Mathematical Physics, Vol. 69B, No. 4 (1965), 335-336.
%H Jonathan Sondow, <a href="http://arxiv.org/abs/1110.3113">Lerch Quotients, Lerch Primes, Fermat-Wilson Quotients, and the Wieferich-non-Wilson Primes 2, 3, 14771</a>, in Proceedings of CANT 2011, arXiv:1110.3113 [math.NT], 2011-2012.
%H Jonathan Sondow, <a href="https://doi.org/10.1007/978-1-4939-1601-6_17">Lerch Quotients, Lerch Primes, Fermat-Wilson Quotients, and the Wieferich-non-Wilson Primes 2, 3, 14771</a>, Combinatorial and Additive Number Theory, CANT 2011 and 2012, Springer Proc. in Math. & Stat., vol. 101 (2014), pp. 243-255.
%F A157249(n) == 0 mod n.
%F A001783(n) + e(n) == 0 mod n^2, where e(n) = +1 or -1 according as n does or does not have a primitive root.
%e A157249(13) = (A001783(13) + e(13))/13 = ((13-1)! + 1)/13 = 479001601/13 = 36846277 == 0 mod 13, so 13 is a member. A001783(5971) + e(5971) = A001783(5971) - 1 == 0 mod 5971^2, so 5971 is a member. But A157249(8) = (A001783(8) + e(8))/8 = (3*5*7 - 1)/8 = 13 ==/== 0 mod 8, so 8 is not a member.
%t f[n_] := Times @@ Select[Range[n], CoprimeQ[n, #]&];
%t e[1|2|4] = 1; e[n_] := If[MatchQ[FactorInteger[n], {{_?OddQ, _}} | {{2, 1}, {_, _}}], 1, -1];
%t WilsonQ[n_] := IntegerQ[(f[n] + e[n])/n^2];
%t Reap[For[k = 1, k < 10^7, k++, If[WilsonQ[k], Print[k]; Sow[k]]]][[2, 1]] (* _Jean-François Alcover_, Dec 11 2018 *)
%Y Cf. Wilson quotient A007619, Wilson prime A007540, generalized Wilson quotient A157249, n-phi-torial A001783, numbers having a primitive root A033948.
%K more,nonn,changed
%O 1,2
%A _Jonathan Sondow_ and _Wadim Zudilin_, Feb 27 2009