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.
%I A157249 #34 Nov 08 2024 09:02:51 %S A157249 2,1,1,1,5,1,103,13,249,19,329891,32,36846277,1379,59793,126689, %T A157249 1230752346353,4727,336967037143579,436486,2252263619,56815333, %U A157249 48869596859895986087,1549256,1654529071288638505,23390099351,56463097772562963,51860555558,10513391193507374500051862069 %N A157249 Generalized Wilson quotients (or Wilson quotients for composite moduli). %C A157249 By Wilson's Theorem, for prime p the Wilson quotient ((p-1)!+1)/p is an integer A007619. By Gauss's extension (see Dickson p. 65), the generalized Wilson quotient (P(n)+e(n))/n is an integer, where P(n) = n-phi-torial A001783 and e(n) = +1 or -1 according as n does or does not have a primitive root (see A033948). %C A157249 For additional references and links, see A007540. %D A157249 L. E. Dickson, History of the Theory of Numbers, vol. 1, Divisibility and Primality, Chelsea, New York, 1966. %H A157249 Seiichi Manyama, <a href="/A157249/b157249.txt">Table of n, a(n) for n = 1..200</a> %H A157249 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 A157249 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 A157249 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. %F A157249 a(n) = (P(n)+e(n))/n, with P(n) = n-phi-torial = A001783(n) and e(n) = +1 if n = 1, 2, 4, p^k or 2p^k, where p is an odd prime and k > 0, and e(n) = -1 otherwise. %e A157249 P(8) = 3*5*7 = 105 and e(8) = -1, so a(8) = (105-1)/8 = 13. %p A157249 a := proc(n) local A001783,e,i; %p A157249 A001783 := proc(n) local i; mul(i,i=select(k->igcd(k,n)=1,[$1..n]))end; %p A157249 e := proc(n) local p,r,P; if n=1 or n=2 or n=4 then RETURN(1) fi; %p A157249 P := select(isprime,[$3..n]); for p in P do r := p; %p A157249 while r <= n do if n = r or n = 2*r then RETURN(1) fi; %p A157249 r := r*p; od od; -1 end; (A001783(n)+e(n))/n end: %p A157249 # _Peter Luschny_, Jul 19 2009 %t A157249 p[n_] := Times @@ Select[ Range[n], CoprimeQ[n, #] & ]; e[1 | 2 | 4] = 1; e[n_] := (fi = FactorInteger[n]; If[MatchQ[fi, {{(p_)?OddQ, _}} | {{2, 1}, {_, _}}], 1, -1]); a[n_] := (p[n] + e[n])/n; Table[a[n], {n, 1, 25}] (* _Jean-François Alcover_, Sep 28 2011 *) %Y A157249 Cf. Wilson quotient A007619, Wilson prime A007540, Wilson number A157250, n-phi-torial A001783, numbers having a primitive root A033948. %Y A157249 Cf. A317507. %K A157249 nonn %O A157249 1,1 %A A157249 _Jonathan Sondow_ and _Wadim Zudilin_, Feb 27 2009