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.

Showing 1-2 of 2 results.

A007619 Wilson quotients: ((p-1)! + 1)/p where p is the n-th prime.

Original entry on oeis.org

1, 1, 5, 103, 329891, 36846277, 1230752346353, 336967037143579, 48869596859895986087, 10513391193507374500051862069, 8556543864909388988268015483871, 10053873697024357228864849950022572972973, 19900372762143847179161250477954046201756097561, 32674560877973951128910293168477013254334511627907
Offset: 1

Views

Author

Keywords

Comments

Suggested by the Wilson-Lagrange Theorem: An integer p > 1 is a prime if and only if (p-1)! == -1 (mod p).
Define b(n) = ((n-1)*(n^2 - 3*n + 1)*b(n-1) - (n-2)^3*b(n-2) )/(n*(n-3)); b(2) = b(3) = 1; sequence gives b(primes).
Subsequence of the generalized Wilson quotients A157249. - Jonathan Sondow, Mar 04 2016
a(n) is an integer because of to Wilson's theorem (Theorem 80, p. 68, the if part of Theorem 81, p. 69, given in Hardy and Wright). See the first comment. `This theorem is of course quite useless as a practical test for the primality of a given number n' ( op. cit., p. 69). - Wolfdieter Lang, Oct 26 2017

Examples

			The 4th prime is 7, so a(4) = (6! + 1)/7 = 103.
		

References

  • R. Crandall and C. Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 29.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, fifth edition, Oxford Science Publications, Clarendon Press, Oxford, 2003.
  • Paulo Ribenboim, The Book of Prime Number Records. Springer-Verlag, NY, 2nd ed., 1989, p. 277.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 234.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A005450, A005451, A007540 (Wilson primes), A050299, A163212, A225672, A225906.
Cf. A261779.
Cf. A157249, A157250, A292691 (twin prime analog quotient).

Programs

Formula

a(n) = A157249(prime(n)). - Jonathan Sondow, Mar 04 2016

Extensions

Definition clarified by Jonathan Sondow, Aug 05 2011

A005451 a(n) = 1 if n is a prime number, otherwise a(n) = n.

Original entry on oeis.org

1, 1, 1, 4, 1, 6, 1, 8, 9, 10, 1, 12, 1, 14, 15, 16, 1, 18, 1, 20, 21, 22, 1, 24, 25, 26, 27, 28, 1, 30, 1, 32, 33, 34, 35, 36, 1, 38, 39, 40, 1, 42, 1, 44, 45, 46, 1, 48, 49, 50, 51, 52, 1, 54, 55, 56, 57, 58, 1, 60
Offset: 1

Views

Author

Keywords

Comments

Denominator of (1 + Gamma(n))/n.
Möbius transform of A380441(n). - Wesley Ivan Hurt, Jun 21 2025

References

  • Paulo Ribenboim, The little book of big primes, Springer 1991, p. 106.

Crossrefs

Cf. A005171, A005450 (numerators).

Programs

  • Magma
    [IsPrime(n) select 1 else n: n in [1..70]]; // Vincenzo Librandi, Feb 22 2013
    
  • Magma
    [Denominator((1 + Factorial(n-1))/n): n in [1..70]]; // G. C. Greubel, Nov 22 2022
    
  • Maple
    seq(denom((1 + (n-1)!)/n), n=1..80); # G. C. Greubel, Nov 22 2022
  • Mathematica
    Table[If[PrimeQ[n], 1, n], {n, 70}] (* Vincenzo Librandi, Feb 22 2013 *)
    a[n_] := ((n-1)! + 1)/n - Floor[(n-1)!/n] // Denominator; Table[a[n] , {n, 70}] (* Jean-François Alcover, Jul 17 2013, after Minac's formula *)
    Table[Denominator[(1 + Gamma[n])/n], {n,2,70}] (* G. C. Greubel, Nov 22 2022 *)
  • Sage
    def A005451(n):
        if n == 4: return n
        f = factorial(n-1)
        return 1/((f + 1)/n - f//n)
    [A005451(n) for n in (1..71)]   # Peter Luschny, Oct 16 2013
    
  • SageMath
    [denominator((1+gamma(n))/n) for n in range(1,71)] # G. C. Greubel, Nov 22 2022

Formula

Define b(n) = ( (n-1)*(n^2-3*n+1)*b(n-1) - (n-2)^3*b(n-2) )/(n*(n-3)); b(2) = b(3) = 1; a(n) = denominator(b(n)).
a(n) = A088140(n), n >= 3. - R. J. Mathar, Oct 28 2008
a(n) = gcd(n, (n!*n!!)/n^2). - Lechoslaw Ratajczak, Mar 09 2019
From Wesley Ivan Hurt, Jun 21 2025: (Start)
a(n) = n^c(n), where c = A005171.
a(n) = Sum_{d|n} A380441(d) * mu(n/d). (End)

Extensions

Name edited and a(1)=1 prepended by G. C. Greubel, Nov 22 2022. Name further edited by N. J. A. Sloane, Nov 22 2022
Showing 1-2 of 2 results.