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-10 of 36 results. Next

A001220 Wieferich primes: primes p such that p^2 divides 2^(p-1) - 1.

Original entry on oeis.org

1093, 3511
Offset: 1

Views

Author

Keywords

Comments

Sequence is believed to be infinite.
Joseph Silverman showed that the abc-conjecture implies that there are infinitely many primes which are not in the sequence. - Benoit Cloitre, Jan 09 2003
Graves and Murty (2013) improved Silverman's result by showing that for any fixed k > 1, the abc-conjecture implies that there are infinitely many primes == 1 (mod k) which are not in the sequence. - Jonathan Sondow, Jan 21 2013
The squares of these numbers are Fermat pseudoprimes to base 2 (A001567) and Catalan pseudoprimes (A163209). - T. D. Noe, May 22 2003
Primes p that divide the numerator of the harmonic number H((p-1)/2); that is, p divides A001008((p-1)/2). - T. D. Noe, Mar 31 2004
In a 1977 paper, Wells Johnson, citing a suggestion from Lawrence Washington, pointed out the repetitions in the binary representations of the numbers which are one less than the two known Wieferich primes; i.e., 1092 = 10001000100 (base 2); 3510 = 110110110110 (base 2). It is perhaps worth remarking that 1092 = 444 (base 16) and 3510 = 6666 (base 8), so that these numbers are small multiples of repunits in the respective bases. Whether this is mathematically significant does not appear to be known. - John Blythe Dobson, Sep 29 2007
A002326((a(n)^2 - 1)/2) = A002326((a(n)-1)/2). - Vladimir Shevelev, Jul 09 2008, Aug 24 2008
It is believed that p^2 does not divide 3^(p-1) - 1 if p = a(n). This is true for n = 1 and 2. See A178815, A178844, A178900, and Ostafe-Shparlinski (2010) Section 1.1. - Jonathan Sondow, Jun 29 2010
These primes also divide the numerator of the harmonic number H(floor((p-1)/4)). - H. Eskandari (hamid.r.eskandari(AT)gmail.com), Sep 28 2010
1093 and 3511 are prime numbers p satisfying congruence 429327^(p-1) == 1 (mod p^2). Why? - Arkadiusz Wesolowski, Apr 07 2011. Such bases are listed in A247208. - Max Alekseyev, Nov 25 2014. See A269798 for all such bases, prime and composite, that are not powers of 2. - Felix Fröhlich, Apr 07 2018
A196202(A049084(a(1))) = A196202(A049084(a(2))) = 1. - Reinhard Zumkeller, Sep 29 2011
If q is prime and q^2 divides a prime-exponent Mersenne number, then q must be a Wieferich prime. Neither of the two known Wieferich primes divide Mersenne numbers. See Will Edgington's Mersenne page in the links below. - Daran Gill, Apr 04 2013
There are no other terms below 4.97*10^17 as established by PrimeGrid (see link below). - Max Alekseyev, Nov 20 2015. The search was done via PrimeGrid's PRPNet and the results were not double-checked. Because of the unreliability of the testing, the search was suspended in May 2017 (cf. Goetz, 2017). - Felix Fröhlich, Apr 01 2018. On Nov 28 2020, PrimeGrid has resumed the search (cf. Reggie, 2020). - Felix Fröhlich, Nov 29 2020. As of Dec 29 2022, PrimeGrid has completed the search to 2^64 (about 1.8 * 10^19) and has no plans to continue further. - Charles R Greathouse IV, Sep 24 2024
Are there other primes q >= p such that q^2 divides 2^(p-1)-1, where p is a prime? - Thomas Ordowski, Nov 22 2014. Any such q must be a Wieferich prime. - Max Alekseyev, Nov 25 2014
Primes p such that p^2 divides 2^r - 1 for some r, 0 < r < p. - Thomas Ordowski, Nov 28 2014, corrected by Max Alekseyev, Nov 28 2014
For some reason, both p=a(1) and p=a(2) also have more bases b with 1 < b < p that make b^(p-1) == 1 (mod p^2) than any smaller prime p; in other words, a(1) and a(2) belong to A248865. - Jeppe Stig Nielsen, Jul 28 2015
Let r_1, r_2, r_3, ..., r_i be the set of roots of the polynomial X^((p-1)/2) - (p-3)! * X^((p-3)/2) - (p-5)! * X^((p-5)/2) - ... - 1. Then p is a Wieferich prime iff p divides sum{k=1, p}(r_k^((p-1)/2)) (see Example 2 in Jakubec, 1994). - Felix Fröhlich, May 27 2016
Arthur Wieferich showed that if p is not a term of this sequence, then the First Case of Fermat's Last Theorem has no solution in x, y and z for prime exponent p (cf. Wieferich, 1909). - Felix Fröhlich, May 27 2016
Let U_n(P, Q) be a Lucas sequence of the first kind, let e be the Legendre symbol (D/p) and let p be a prime not dividing 2QD, where D = P^2 - 4*Q. Then a prime p such that U_(p-e) == 0 (mod p^2) is called a "Lucas-Wieferich prime associated to the pair (P, Q)". Wieferich primes are those Lucas-Wieferich primes that are associated to the pair (3, 2) (cf. McIntosh, Roettger, 2007, p. 2088). - Felix Fröhlich, May 27 2016
Any repeated prime factor of a term of A000215 is a term of this sequence. Thus, if there exist infinitely many Fermat numbers that are not squarefree, then this sequence is infinite, since no two Fermat numbers share a common factor. - Felix Fröhlich, May 27 2016
If the Diophantine equation p^x - 2^y = d has more than one solution in positive integers (x, y), with (p, d) not being one of the pairs (3, 1), (3, -5), (3, -13) or (5, -3), then p is a term of this sequence (cf. Scott, Styer, 2004, Corollary to Theorem 2). - Felix Fröhlich, Jun 18 2016
Odd primes p such that Chi_(D_0)(p) != 1 and Lambda_p(Q(sqrt(D_0))) != 1, where D_0 < 0 is the fundamental discriminant of the imaginary quadratic field Q(sqrt(1-p^2)) and Chi and Lambda are Iwasawa invariants (cf. Byeon, 2006, Proposition 1 (i)). - Felix Fröhlich, Jun 25 2016
If q is an odd prime, k, p are primes with p = 2*k+1, k == 3 (mod 4), p == -1 (mod q) and p =/= -1 (mod q^3) (Jakubec, 1998, Corollary 2 gives p == -5 (mod q) and p =/= -5 (mod q^3)) with the multiplicative order of q modulo k = (k-1)/2 and q dividing the class number of the real cyclotomic field Q(Zeta_p + (Zeta_p)^(-1)), then q is a term of this sequence (cf. Jakubec, 1995, Theorem 1). - Felix Fröhlich, Jun 25 2016
From Felix Fröhlich, Aug 06 2016: (Start)
Primes p such that p-1 is in A240719.
Prime terms of A077816 (cf. Agoh, Dilcher, Skula, 1997, Corollary 5.9).
p = prime(n) is in the sequence iff T(2, n) > 1, where T = A258045.
p = prime(n) is in the sequence iff an integer k exists such that T(n, k) = 2, where T = A258787. (End)
Conjecture: an integer n > 1 such that n^2 divides 2^(n-1)-1 must be a Wieferich prime. - Thomas Ordowski, Dec 21 2016
The above conjecture is equivalent to the statement that no "Wieferich pseudoprimes" (WPSPs) exist. While base-b WPSPs are known to exist for several bases b > 1 other than 2 (see for example A244752), no base-2 WPSPs are known. Since two necessary conditions for a composite to be a base-2 WPSP are that, both, it is a base-2 Fermat pseudoprime (A001567) and all its prime factors are Wieferich primes (cf. A270833), as shown in the comments in A240719, it seems that the first base-2 WPSP, if it exists, is probably very large. This appears to be supported by the guess that the properties of a composite to be a term of A001567 and of A270833 are "independent" of each other and by the observation that the scatterplot of A256517 seems to become "less dense" at the x-axis parallel line y = 2 for increasing n. It has been suggested in the literature that there could be asymptotically about log(log(x)) Wieferich primes below some number x, which is a function that grows to infinity, but does so very slowly. Considering the above constraints, the number of WPSPs may grow even more slowly, suggesting any such number, should it exist, probably lies far beyond any bound a brute-force search could reach in the forseeable future. Therefore I guess that the conjecture may be false, but a disproof or the discovery of a counterexample are probably extraordinarily difficult problems. - Felix Fröhlich, Jan 18 2019
Named after the German mathematician Arthur Josef Alwin Wieferich (1884-1954). a(1) = 1093 was found by Waldemar Meissner in 1913. a(2) = 3511 was found by N. G. W. H. Beeger in 1922. - Amiram Eldar, Jun 05 2021
From Jianing Song, Jun 21 2025: (Start)
The ring of integers of Q(2^(1/k)) is Z[2^(1/k)] if and only if k does not have a prime factor in this sequence (k is in A342390). See Theorem 5.3 of the paper of Keith Conrad. For example, we have:
(1 + 2^(364/1093) + 2^(2*364/1093) + ... + 2^(1092*364/1093))/1093 is an algebraic integer, but it is not in Z[2^(1/1093)];
(1 + 2^(1755/3511) + 2^(2*1755/3511) + ... + 2^(3510*1755/3511))/3511 is an algebraic integer, but it is not in Z[2^(1/3511)]. (End)

References

  • Richard Crandall and Carl Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 28.
  • Richard K. Guy, Unsolved Problems in Number Theory, A3.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, th. 91.
  • Yves Hellegouarch, "Invitation aux mathématiques de Fermat Wiles", Dunod, 2eme Edition, pp. 340-341.
  • Pace Nielsen, Wieferich primes, heuristics, computations, Abstracts Amer. Math. Soc., 33 (#1, 20912), #1077-11-48.
  • Paulo Ribenboim, The Book of Prime Number Records. Springer-Verlag, NY, 2nd ed., 1989, p. 263.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 230-234.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, NY, 1986, p. 163.

Crossrefs

Cf. similar primes related to the first case of Fermat's last theorem: A007540, A088164.
Sequences "primes p such that p^2 divides X^(p-1)-1": A014127 (X=3), A123692 (X=5), A212583 (X=6), A123693 (X=7), A045616 (X=10), A111027 (X=12), A128667 (X=13), A234810 (X=14), A242741 (X=15), A128668 (X=17), A244260 (X=18), A090968 (X=19), A242982 (X=20), A298951 (X=22), A128669 (X=23), A306255 (X=26), A306256 (X=30).

Programs

  • GAP
    Filtered([1..50000],p->IsPrime(p) and (2^(p-1)-1) mod p^2 =0); # Muniru A Asiru, Apr 03 2018
    
  • Haskell
    import Data.List (elemIndices)
    a001220 n = a001220_list !! (n-1)
    a001220_list = map (a000040 . (+ 1)) $ elemIndices 1 a196202_list
    -- Reinhard Zumkeller, Sep 29 2011
    
  • Magma
    [p : p in PrimesUpTo(310000) | IsZero((2^(p-1) - 1) mod (p^2))]; // Vincenzo Librandi, Jan 19 2019
  • Maple
    wieferich := proc (n) local nsq, remain, bin, char: if (not isprime(n)) then RETURN("not prime") fi: nsq := n^2: remain := 2: bin := convert(convert(n-1, binary),string): remain := (remain * 2) mod nsq: bin := substring(bin,2..length(bin)): while (length(bin) > 1) do: char := substring(bin,1..1): if char = "1" then remain := (remain * 2) mod nsq fi: remain := (remain^2) mod nsq: bin := substring(bin,2..length(bin)): od: if (bin = "1") then remain := (remain * 2) mod nsq fi: if remain = 1 then RETURN ("Wieferich prime") fi: RETURN ("non-Wieferich prime"): end: # Ulrich Schimke (ulrschimke(AT)aol.com), Nov 01 2001
  • Mathematica
    Select[Prime[Range[50000]],Divisible[2^(#-1)-1,#^2]&]  (* Harvey P. Dale, Apr 23 2011 *)
    Select[Prime[Range[50000]],PowerMod[2,#-1,#^2]==1&] (* Harvey P. Dale, May 25 2016 *)
  • PARI
    N=10^4; default(primelimit,N);
    forprime(n=2,N,if(Mod(2,n^2)^(n-1)==1,print1(n,", ")));
    \\ Joerg Arndt, May 01 2013
    
  • Python
    from sympy import prime
    from gmpy2 import powmod
    A001220_list = [p for p in (prime(n) for n in range(1,10**7)) if powmod(2,p-1,p*p) == 1]
    # Chai Wah Wu, Dec 03 2014
    

Formula

(A178815(A000720(p))^(p-1) - 1) mod p^2 = A178900(n), where p = a(n). - Jonathan Sondow, Jun 29 2010
Odd primes p such that A002326((p^2-1)/2) = A002326((p-1)/2). See A182297. - Thomas Ordowski, Feb 04 2014

A006472 a(n) = n!*(n-1)!/2^(n-1).

Original entry on oeis.org

1, 1, 3, 18, 180, 2700, 56700, 1587600, 57153600, 2571912000, 141455160000, 9336040560000, 728211163680000, 66267215894880000, 6958057668962400000, 834966920275488000000, 113555501157466368000000, 17373991677092354304000000, 2970952576782792585984000000
Offset: 1

Views

Author

Keywords

Comments

Product of first (n-1) positive triangular numbers. - Amarnath Murthy, May 19 2002, corrected by Alex Ratushnyak, Dec 03 2013
Number of ways of transforming n distinguishable objects into n singletons via a sequence of n-1 refinements. Example: a(3)=3 because we have XYZ->X|YZ->X|Y|Z, XYZ->Y|XZ->X|Y|Z and XYZ->Z|XY->X|Y|Z. - Emeric Deutsch, Jan 23 2005
In other words, a(n) is the number of maximal chains in the lattice of set partitions of {1, ..., n} ordered by refinement. - Gus Wiseman, Jul 22 2018
From David Callan, Aug 27 2009: (Start)
With offset 0, a(n) = number of unordered increasing full binary trees of 2n edges with leaf set {n,n+1,...,2n}, where full binary means each nonleaf vertex has two children, increasing means the vertices are labeled 0,1,2,...,2n and each child is greater than its parent, unordered might as well mean ordered and each pair of sibling vertices is increasing left to right. For example, a(2)=3 counts the trees with edge lists {01,02,13,14}, {01,03,12,14}, {01,04,12,13}.
PROOF. Given such a tree of size n, to produce a tree of size n+1, two new leaves must be added to the leaf n. Choose any two of the leaf set {n+1,...,2n,2n+1,2n+2} for the new leaves and use the rest to replace the old leaves n+1,...,2n, maintaining relative order. Thus each tree of size n yields (n+2)-choose-2 trees of the next size up. Since the ratio a(n+1)/a(n)=(n+2)-choose-2, the result follows by induction.
Without the condition on the leaves, these trees are counted by the reduced tangent numbers A002105. (End)
a(n) = Sum(M(t)N(t)), where summation is over all rooted trees t with n vertices, M(t) is the number of ways to take apart t by sequentially removing terminal edges (see A206494) and N(t) is the number of ways to build up t from the one-vertex tree by adding successively edges to the existing vertices (the Connes-Moscovici weight; see A206496). See Remark on p. 3801 of the Hoffman reference. Example: a(3) = 3; indeed, there are two rooted trees with 3 vertices: t' = the path r-a-b and t" = V; we have M(t')=N(t')=1 and M(t") =1, N(t")=2, leading to M(t')N(t') + M(t")N(t")=3. - Emeric Deutsch, Jul 20 2012
Number of coalescence sequences or labeled histories for n lineages: the number of sequences by which n distinguishable leaves can coalesce to a single sequence. The coalescence process merges pairs of lineages into new lineages, labeling each newly formed lineage l by a subset of the n initial lineages corresponding to the union of all initial lineages that feed into lineage l. - Noah A Rosenberg, Jan 28 2019
Conjecture: For n > 1, n divides 2*a(n-1) + 4 if and only if n is prime. - Werner Schulte, Oct 04 2020
For a proof of the above conjecture see Himane. The list of primes p such that p^2 divides (2*a(p-1) + 4) (analog of A007540 - Wilson primes) begins [239, 24049, ...]. - Peter Bala, Nov 06 2024
a(n) is the number of maximal chains in the poset of set of permutations of {1, ..., n} ordered by containment. - Rajesh Kumar Mohapatra, Sep 03 2025

Examples

			From _Gus Wiseman_, Jul 22 2018: (Start)
The a(3) = 3 maximal chains in the lattice of set partitions of {1,2,3}:
  {{1},{2},{3}} < {{1},{2,3}} < {{1,2,3}}
  {{1},{2},{3}} < {{2},{1,3}} < {{1,2,3}}
  {{1},{2},{3}} < {{3},{1,2}} < {{1,2,3}} (End)
From _Rajesh Kumar Mohapatra_, Sep 03 2025: (Start)
The a(3) = 3 maximal chains in the poset of the set of permutations of {1,2,3}:
  {(1)(2)(3)} < (12)(3) < (123)}
  {(1)(2)(3)} < (1)(23) < (123)}
  {(1)(2)(3)} < (13)(2) < (132)} (End)
		

References

  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 148.
  • László Lovász, Combinatorial Problems and Exercises, North-Holland, 1979, p. 165.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Mike Steel, Phylogeny: Discrete and Random Processes in Evolution, SIAM, 2016, p. 47.

Crossrefs

Cf. A000110, A000258, A002846, A005121, A213427, A317145, A363679 (sum of reciprocals).
For the type B and D analogs, see A001044 and A123385.

Programs

  • Magma
    [Factorial(n)*Factorial(n-1)/2^(n-1): n in [1..20]]; // Vincenzo Librandi, Aug 23 2018
    
  • Maple
    A006472 := n -> n!*(n-1)!/2^(n-1):
  • Mathematica
    FoldList[Times,1,Accumulate[Range[20]]] (* Harvey P. Dale, Jan 10 2013 *)
  • PARI
    a(n) = n*(n-1)!^2/2^(n-1) \\ Charles R Greathouse IV, May 18 2015
    
  • Python
    from math import factorial
    def A006472(n): return n*factorial(n-1)**2 >> n-1 # Chai Wah Wu, Jun 22 2022

Formula

a(n) = a(n-1)*A000217(n-1).
a(n) = A010790(n-1)/2^(n-1).
a(n) = polygorial(n, 3) = (A000142(n)/A000079(n))*A000142(n+1) = (n!/2^n)*Product_{i=0..n-1} (i+2) = (n!/2^n)*Pochhammer(2, n) = (n!^2/2^n)*(n+1) = polygorial(n, 4)/2^n*(n+1). - Daniel Dockery (peritus(AT)gmail.com), Jun 13 2003
a(n-1) = (-1)^(n+1)/(n^2*det(M_n)) where M_n is the matrix M_(i, j) = abs(1/i - 1/j). - Benoit Cloitre, Aug 21 2003
From Ilya Gutkovskiy, Dec 15 2016: (Start)
a(n) ~ 4*Pi*n^(2*n)/(2^n*exp(2*n)).
Sum_{n>=1} 1/a(n) = BesselI(1,2*sqrt(2))/sqrt(2) = 2.3948330992734... (End)
D-finite with recurrence 2*a(n) -n*(n-1)*a(n-1)=0. - R. J. Mathar, May 02 2022
Sum_{n>=1} (-1)^(n+1)/a(n) = BesselJ(1,2*sqrt(2))/sqrt(2). - Amiram Eldar, Jun 25 2022
From Rajesh Kumar Mohapatra, Sep 03 2025: (Start)
a(n) = A331955(n,n)
a(n) = A331956(n,n)
a(n) = A375835(n,n)
a(n) = A375837(n,n) (End)

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

A002068 Wilson remainders: a(n) = ((p-1)!+1)/p mod p, where p = prime(n).

Original entry on oeis.org

1, 1, 0, 5, 1, 0, 5, 2, 8, 18, 19, 7, 16, 13, 6, 34, 27, 56, 12, 69, 11, 73, 20, 70, 70, 72, 57, 1, 30, 95, 71, 119, 56, 67, 94, 86, 151, 108, 21, 106, 48, 72, 159, 35, 147, 118, 173, 180, 113, 131, 169, 107, 196, 214, 177, 73, 121, 170, 25, 277, 164, 231, 271, 259, 288, 110
Offset: 1

Views

Author

Keywords

Comments

If this is zero, p is a Wilson prime (see A007540).
Costa, Gerbicz, & Harvey give an efficient algorithm for computing terms of this sequence. - Charles R Greathouse IV, Nov 09 2012

References

  • R. Crandall and C. Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 29.
  • J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 244.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    f:= p -> ((p-1)!+1 mod p^2)/p;
    seq(f(ithprime(i)),i=1..1000); # Robert Israel, Jun 15 2014
  • Mathematica
    Table[p=Prime[n]; Mod[((p-1)!+1)/p, p], {n,100}] (* T. D. Noe, Mar 21 2006 *)
    Mod[((#-1)!+1)/#,#]&/@Prime[Range[70]] (* Harvey P. Dale, Feb 21 2020 *)
  • PARI
    forprime(n=2, 10^2, m=(((n-1)!+1)/n)%n; print1(m, ", ")) \\ Felix Fröhlich, Jun 14 2014

Formula

a(n) = A007619(n) mod A000040(n).
a(n) + A197631(n) = A275741(n) for n > 1. - Jonathan Sondow, Jul 08 2019
a(n) = ( A027641(p-1)/A027642(p-1) + 1/p - 1 ) mod p, where p = prime(n), proved by Glashier (1900). - Max Alekseyev, Jun 20 2020

A197632 Lerch primes: odd primes that divide their Lerch quotients A197630.

Original entry on oeis.org

3, 103, 839, 2237
Offset: 1

Views

Author

Jonathan Sondow, Oct 16 2011

Keywords

Comments

Odd primes p such that Sum_{a=1..p-1} a^(p-1) - (p-1)! == p (mod p^3). (The congruence holds mod p^2 for any odd prime p; see Lerch (1905).)
Marek Wolf has computed that if a 5th Lerch prime p exists, then 4496113 < p < 18816869 or 18977773 < p < 32452867 or p > 32602373.
Can a number be simultaneously a Lerch prime and a Wilson prime A007540?
René Gy (see links) has shown that a number is simultaneously a Lerch prime and a Wilson prime if and only if it satisfies the congruence (p - 1)! + 1 == 0 (mod p^3). - John Blythe Dobson, Feb 23 2018
Named after the Czech mathematician Mathias Lerch (1860-1922). - Amiram Eldar, Jun 23 2021

Examples

			The 27th prime is 103, and A197631(27) = 0, so 103 is a member.
		

Crossrefs

Programs

  • Mathematica
    Cases[Prime[Range[2, 500]], p_ /; Divisible[(Sum[(k^(p-1)-1)/p, {k, 1, p-1}] - ((p-1)! + 1)/p)/p, p]] (* Jean-François Alcover, Nov 21 2018 *)
  • PARI
    is(p)=my(m=p-1,P=p^3); !sum(k=1, m, Mod(k,P)^m,-p-m!) && isprime(p) \\ Charles R Greathouse IV, Jun 18 2012

Formula

A197630(A000720(a(n))) == 0 (mod a(n)).
A197631(A000720(a(n))) = 0.

A250406 Values of B such that p = prime(n) satisfies (p-1)! == -1-B*p (mod p^2), i.e., p is a near-Wilson prime.

Original entry on oeis.org

1, 2, 0, 2, 10, 0, 12, 17, 15, 11, 12, 30, 25, 30, 41, 19, 32, 5, 55, 2, 62, 6, 63, 19, 27, 29, 46, 106, 79, 18, 56, 12, 81, 72, 55, 65, 6, 55, 146, 67, 131, 109, 32, 158, 50, 81, 38, 43, 114, 98, 64, 132, 45, 37, 80, 190, 148, 101, 252, 4, 119, 62, 36, 52, 25
Offset: 1

Views

Author

Felix Fröhlich, Nov 22 2014

Keywords

Comments

p is in A007540 iff a(n) == 0.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 0, m, p = Prime[n]}, m = Mod[(p - 1)!, p^2]; While[ Mod[-1 - k*p, p^2] != m, k++]; k]; Array[f, 70] (* Robert G. Wilson v, Dec 03 2014 *)
  • PARI
    forprime(p=1, 1e9, b=0; while(Mod((p-1)!, p^2)!=-1-b*p, b++); print1(b, ", "))

A087047 a(n) = n*(n+1)*(n+2)*a(n-1)/6 for n >= 1; a(0) = 1.

Original entry on oeis.org

1, 1, 4, 40, 800, 28000, 1568000, 131712000, 15805440000, 2607897600000, 573737472000000, 164088916992000000, 59728365785088000000, 27176406432215040000000, 15218787602040422400000000, 10348775569387487232000000000, 8444600864620189581312000000000, 8182818237816963704291328000000000
Offset: 0

Views

Author

Enrico T. Federighi (rico125162(AT)aol.com), Aug 08 2003

Keywords

Comments

Product of the first n tetrahedral (or pyramidal) numbers. See 2nd formula. - Alexander Adamchuk, May 19 2006
From Peter Bala, Nov 28 2024: (Start)
For n >= 5, a(n-3) == 9 (mod n) if and only if n is a prime (adapt the proof of the Main Theorem in Himane).
The list of primes p such that a(p-3) == 9 (mod p^2) (analog of A007540 - Wilson primes) begins [11, 31, 47, ...]. (End)

Examples

			a(4) = (1/32)*(1/81)*24*120*720 = 800.
		

Crossrefs

Programs

  • Maple
    a[0]:=1: for n from 1 to 20 do a[n]:=n*(n+1)*(n+2)*a[n-1]/6 od: seq(a[n],n=0..17); # Emeric Deutsch, Mar 06 2005
    seq(mul(binomial(k+2, 3), k=1..n), n=0..16); # Zerinvary Lajos, Aug 07 2007
  • Mathematica
    Table[Product[k*(k+1)*(k+2)/6,{k,1,n}],{n,0,16}] (* Alexander Adamchuk, May 19 2006 *)
    a[n_]:=Denominator[SeriesCoefficient[HypergeometricPFQ[{1},{1,2,3},6x],{x,0,n}]]; Array[a,18,0] (* Stefano Spezia, Oct 13 2023 *)
  • Sage
    q=50 # change q for more terms
    [2^(-n-1)*3^(-n)*factorial(n)*factorial(n+1)*factorial(n+2) for n in [0..q]] # Tom Edgar, Mar 15 2014

Formula

a(n) = 2^(-n-1)*3^(-n)*n!*(n+1)!*(n+2)!.
From Alexander Adamchuk, May 19 2006: (Start)
a(n) = Product_{k=1..n} k*(k+1)*(k+2)/6.
a(n) = Product_{k=1..n} A000292(k). (End)
a(n) = denominator( [x^n] 1F3([1], [1, 2, 3], 6*x) ), where 1F3 is the hypergeometric function (see Luzón et al. at page 19). - Stefano Spezia, Oct 13 2023

Extensions

More terms from Emeric Deutsch, Mar 06 2005
Example and formula corrected by Tom Edgar, Mar 15 2014
a(0)=1 prepended by and a(15)-a(17) from Stefano Spezia, Oct 13 2023

A163210 Swinging Wilson quotients ((p-1)$ +(-1)^floor((p+2)/2))/p, p prime. Here '$' denotes the swinging factorial function (A056040).

Original entry on oeis.org

1, 1, 1, 3, 23, 71, 757, 2559, 30671, 1383331, 5003791, 245273927, 3362110459, 12517624987, 175179377183, 9356953451851, 509614686432899, 1938763632210843, 107752663194272623
Offset: 1

Views

Author

Peter Luschny, Jul 24 2009

Keywords

Examples

			The 5th prime is 11, (11-1)$ = 252, the remainder term is (-1)^floor((11+2)/2)=1. So the quotient (252+1)/11 = 23 is the 5th member of the sequence.
		

Crossrefs

Programs

  • Maple
    swing := proc(n) option remember; if n = 0 then 1 elif irem(n, 2) = 1 then swing(n-1)*n else 4*swing(n-1)/n fi end:
    WQ := proc(f,r,n) map(p->(f(p-1)+r(p))/p,select(isprime,[$1..n])) end:
    A163210 := n -> WQ(swing,p->(-1)^iquo(p+2,2),n);
  • Mathematica
    sf[n_] := n!/Quotient[n, 2]!^2; a[n_] := (p = Prime[n]; (sf[p - 1] + (-1)^Floor[(p + 2)/2])/p); Table[a[n], {n, 1, 19}] (* Jean-François Alcover, Jun 28 2013 *)
    a[p_] := (Binomial[p-1, (p-1)/2] - (-1)^((p-1)/2)) / p
    Join[{1, 1}, a[Prime[Range[3,20]]]] (* Peter Luschny, May 13 2017 *)
  • PARI
    a(n, p=prime(n)) = ((p-1)!/((p-1)\2)!^2 - (-1)^(p\2))/p \\ David A. Corneth, May 13 2017

A197636 Non-Wilson primes: primes p such that (p-1)! =/= -1 mod p^2.

Original entry on oeis.org

2, 3, 7, 11, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 569
Offset: 1

Views

Author

Jonathan Sondow, Oct 19 2011

Keywords

Comments

All primes except 5, 13, 563, and any other Wilson prime A007540 that may exist.
Same as primes p that do not divide their Wilson quotient ((p-1)!+1)/p.
Wilson's theorem says that (p-1)! == -1 (mod p) if and only if p is prime.
p = prime(i) is a term iff A250406(i) != 0. - Felix Fröhlich, Jan 24 2016
Complement of A007540 in A000040. - Felix Fröhlich, Jan 24 2016

Examples

			2 is a non-Wilson prime since (2-1)! = 1 ==/== -1 (mod 2^2).
		

Crossrefs

Programs

  • Mathematica
    Select[Prime@ Range@ 104, Mod[Factorial[# - 1], #^2] != #^2 - 1 &] (* Michael De Vlieger, Jan 24 2016 *)
  • PARI
    forprime(p=1, 500, if(Mod((p-1)!, p^2)!=-1, print1(p, ", "))) \\ Felix Fröhlich, Jan 24 2016

Formula

((p-1)!+1)/p =/= 0 (mod p), where p is prime.

A064237 Numbers k such that k! + 1 is divisible by a square.

Original entry on oeis.org

4, 5, 7, 12, 23
Offset: 1

Views

Author

Vladeta Jovovic, Sep 22 2001

Keywords

Comments

229 is another term because 613^2 divides 229!+1. See A115091 for primes whose square divides m!+1 for some m. An examination of the factorizations of m!+1 for m<=100 found no additional squares. - T. D. Noe, Mar 01 2006
562 is also a term because 562!+1 is divisible by 563^2. - Vladeta Jovovic, Mar 30 2004
A web search reveals that for 1 <= k <= 228 there are 82 values of k for which k! + 1 has not been completely factored (the smallest is k=103), so showing that 229 and 562 are indeed the next two terms will be a huge task. I checked that k!+1 is not divisible by p^2 for k <= 1000 and prime p < 10^8. - Francois Brunault, Nov 23 2008
It is very likely that 229 and 562 are the next two terms, but this has not yet been proved. - Francois Brunault, Nov 29 2008
Contains A007540(n)-1 for all n. That sequence is conjectured to be infinite. - Robert Israel, Jul 04 2016
This sequence includes A146968 (solutions of Brocard's problem). - Salvador Cerdá, Mar 08 2016
If k > 562 and k! + 1 is divisible by p^2 where p is prime, then either k > 10000 or p > 2038074743 (the hundred millionth prime). - Jason Zimba, Oct 21 2021

Examples

			4 is in the sequence because 4! + 1 = 5^2.
5 is in the sequence because 5! + 1 = 11^2.
6 is not in the sequence because 6! + 1 = 721
7 is in the sequence because 7! + 1 = 71^2.
12 is in the sequence because 12! + 1 = 13^2 * 2834329.
23 is a term because 23!+1 = 47^2*79*148139754736864591.
From _Thomas Richard_, Aug 31 2021: (Start)
229 and 562 are terms because
229!+1 = 613^2 * 38669 * 1685231 * 3011917759 * (417-digit composite)
562!+1 = 563^2 * 64467346976659839517037 * 112870688711507255213769871 * 63753966393108716329397432599379239 * (1214-digit prime). (End)
		

Crossrefs

Cf. A007540 (Wilson primes), A115091, A146968, A038507, A085692.

Programs

  • Maple
    remove(t -> numtheory:-issqrfree(t!+1), [$1..50]); # Robert Israel, Jul 04 2016
  • Mathematica
    Flatten[Position[MoebiusMu[Range[30]!+1], 0]]; (* T. D. Noe, Mar 01 2006, Nov 21 2008 *)
  • PARI
    lista(nn) = for(n=1, nn, if(!issquarefree(n!+1), print1(n, ", "))); \\ Altug Alkan, Mar 08 2016

Extensions

Example corrected by T. D. Noe, Nov 26 2008
Showing 1-10 of 36 results. Next