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.

Previous Showing 31-36 of 36 results.

A277167 Prime numbers p such that (-1)^h + (h!)^2 == 0 (mod p^2) where h = (p-1)/2.

Original entry on oeis.org

3, 11, 31, 47, 53
Offset: 1

Views

Author

René Gy, Oct 01 2016

Keywords

Comments

The above congruence is true modulo p for all odd primes. See A089043. But like for Wilson congruence, it is true modulo p^2, for a restricted number of primes. After 53, the next one (if any) seems very far away (>500000).
The fact that the congruence is true modulo p for all odd primes was proved by Lagrange in 1771. Using a theorem of Mathews (1892) and Eisenstein's logarithmetic rule for the Fermat quotient, the condition stated in the definition can be restated as W_p == -2q_p(2) (mod p), where W_p is the Wilson quotient of p (A007619) and q_p(2) is the Fermat quotient of p, base 2 (A007663). - John Blythe Dobson, Jul 31 2017

Examples

			(-1)^((11-1)/2)+(((11-1)/2)!)^2 = 14399 = 7*11^2*17.
		

References

  • Lagrange, "Démonstration d’un théoreme nouveau concernant les nombres premiers," Nouveaux Mémoires de l’Académie Royale des Sciences et Belles-Lettres [de Berlin], année 1771 (published 1783), 125-137.
  • G. B. Mathews, Theory of Numbers, part 1 [all published] (Cambridge, 1892), 318.

Crossrefs

Programs

  • PARI
    lista(nn) = forprime(p=3, nn, if ((((-1)^((p-1)/2)+(((p-1)/2)!)^2) % p^2) == 0, print1(p, ", "))); \\ Michel Marcus, Oct 02 2016

A282063 A(n, k) = k-th Wilson prime p of order n with p >= n and k running over the positive integers. Square array read by antidiagonals.

Original entry on oeis.org

5, 13, 2, 563, 3, 7
Offset: 1

Views

Author

Felix Fröhlich, Feb 05 2017

Keywords

Comments

A Wilson prime of order n is a prime p such that (n-1)!*(p-n)!-(-1)^n == 0 (modulo p^2).

Examples

			Array A(n, k) starts:
      5,   13,  563
      2,    3,   11,  107, 4931
      7
  10429
      5,    7,   47
     11
		

Crossrefs

Cf. A007540 (row 1), A079853 (row 2), A152413 (row 17), A128666 (column 1).

Programs

  • PARI
    is_wilson(n, order) = Mod((order-1)!*(n-order)!-(-1)^order, n^2)==0
    table(rows, cols) = for(x=1, rows, my(i=0); forprime(p=x, , if(is_wilson(p, x), print1(p, ", "); i++; if(i==cols, print(""); break))))
    table(4, 3) \\ print initial 4 rows and 3 columns of table

A290171 Numbers k such that (k-1)^2 < (k-1)! mod k^2.

Original entry on oeis.org

5, 13, 563, 1277, 780887
Offset: 1

Views

Author

Gionata Neri, Jul 23 2017

Keywords

Comments

The Wilson primes (A007540) are terms of this sequence.
a(n) is prime or twice a prime. Otherwise (k-1)! mod k^2 = 0 for k > 9 where k is not a prime and not twice a prime. - David A. Corneth, Jul 23 2017

Crossrefs

Cf. A007540.

Programs

  • Mathematica
    Select[Range[10^4],(#-1)^2Giorgos Kalogeropoulos, Jul 23 2021 *)
  • PARI
    for(n=1,1e5,a=(n-1)!%n^2;if((n-1)^2
    				
  • PARI
    is(n) = (n-1)^2 < lift(Mod((n-1)!, n^2)) \\ Felix Fröhlich, Jul 23 2017
    
  • PARI
    val(n, p) = my(r=0); while(n, r+=n\=p); r
    is(n) = my(f = factor(n), r = Mod(1, n^2)); if(#f~ > 2, return(0), if(#f~==2, if(f[1,1]!=2, return(0)))); forprime(p=2,n-1, r*=Mod(p,n^2)^val(n-1,p)); (n-1)^2 < lift(r) \\ David A. Corneth, Jul 23 2017
    
  • Python
    def ok(n):
        nn = n**2; f = 1%nn
        for k in range(1, n): f = f*k%nn
        return (n-1)**2 < f
    print(list(filter(ok, range(1, 1300)))) # Michael S. Branicky, Jul 23 2021
    
  • Python
    # faster for initial segment of sequence
    from math import factorial
    def afind(limit, startk=1):
        k = startk; kkprev = (k-1)**2; f = factorial(k-1)
        while k < limit:
            kk = k*k
            if kkprev < f%kk: print(k, end=", ")
            kkprev = kk; f *= k; k += 1
    afind(10000) # Michael S. Branicky, Jul 25 2021

Extensions

a(5) from Chai Wah Wu, Jul 30 2017

A309398 a(n) is the nearest integer to log(log(10^n)).

Original entry on oeis.org

1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
Offset: 1

Views

Author

Felix Fröhlich, Sep 27 2019

Keywords

Comments

The sequence grows relatively slowly. For example, for n < 10^7, a(n) <= 17.
a(n) is roughly the expected number of Wieferich primes (cf. A001220 and Knauer, Richstein, 2005, p. 1560) as well as the expected number of Fibonacci-Wieferich primes (Wall-Sun-Sun primes) (cf. McIntosh, Roettger, 2007, p. 2091) and Wolstenholme primes (cf. A088164 and McIntosh, 1995, p. 387) with at most n digits. It is also roughly the expected number of Wilson primes with at most n digits (cf. A007540 and Costa, Gerbicz, Harvey, 2014).

Crossrefs

Programs

  • Mathematica
    Round[Log[Log[10^Range[90]]]] (* Harvey P. Dale, Jan 16 2024 *)
  • PARI
    a(n) = round(log(log(10^n)))

Formula

a(n) = round(log(log(10^n))) = log n + O(1).

A319025 Primes p such that W_p == 2 (mod p), where W_p = A007619(n) and p = prime(n).

Original entry on oeis.org

19, 1187, 14296621, 16556218163369
Offset: 1

Views

Author

Felix Fröhlich, Sep 08 2018

Keywords

Comments

These are the members of René Gy's set W_2 (cf. Gy, 2018).
The sequence is complete to 2*10^13, with the higher terms coming from a list of primes with small Wilson quotients in the article by Costa, Gerbicz, and Harvey. - John Blythe Dobson, Jan 05 2021

Crossrefs

Programs

  • PARI
    forprime(p=1, , if(Mod(((p-1)!+1)/p, p)==2, print1(p, ", ")))

A365098 Primes p such that Sum_{k=1..p-1} q^2_p(k) == 0 (mod p), with q_p(k) a Fermat quotient.

Original entry on oeis.org

2, 11, 971
Offset: 1

Views

Author

Felix Fröhlich, Aug 21 2023

Keywords

Comments

The congruence in the definition is given in Gy, 2018, Eq. 16.
The terms, except for the prime 2, satisfy the congruence B_{p-1} - 1 + 1/p == (B_{2p-2} - 1 + 1/p)/2 (mod p^2), with B_i a Bernoulli number (cf. Gy, 2018, Eq. 18).
Any odd prime that is a term of both A007540 and A197632, i.e., that is simultaneously a Wilson prime and a Lerch prime, is in this sequence (cf. Gy, 2018, Theorem 5).
An equivalent definition, better suited for computational purposes, is: "Primes p such that Sum_{k=1..p-1} (k^(p-1) - 1)^2 == 0 (mod p^3)." - John Blythe Dobson, Apr 30 2024
a(4) > 427000, if it exists (Gy, 2018). - Amiram Eldar, Aug 22 2023
a(4) > 39540000, if it exists. - John Blythe Dobson, Apr 30 2024

Crossrefs

Programs

  • Mathematica
    Join[{2}, Select[Prime[Range[2, 200]], Divisible[Numerator[BernoulliB[# - 1] - 1 + 1/# - (BernoulliB[2*# - 2] - 1 + 1/#)/2], #^2] &]] (* Amiram Eldar, Aug 22 2023 *)
  • PARI
    forprime(p = 2, 10000, if(sum(j=1, p-1, (Mod(j, p^3)^(p-1) - 1)^2) % p^3 == 0, print1(p, ", "))) /* John Blythe Dobson, Apr 30 2024 */
Previous Showing 31-36 of 36 results.