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.

A350523 Prime numbers p such that K(p) = 0! + 1! + ... + (p-1)! == -2 (mod p).

Original entry on oeis.org

2, 3, 23, 67, 227, 10331
Offset: 1

Views

Author

Luis H. Gallardo, Jan 03 2022

Keywords

Comments

The Kurepa Conjecture says that K(p) is nonzero in F_p, the finite field with p elements. Primes for which K(p) takes some fixed nonzero value in F_p might have some interest.
No further terms < 6*10^6. - Michael S. Branicky, Jan 03 2022

Crossrefs

Subsequence of A236400.

Programs

  • Mathematica
    q[p_] := PrimeQ[p] && Divisible[Sum[k!, {k, 0, p - 1}] + 2, p]; Select[Range[230], q] (* Amiram Eldar, Jan 03 2022 *)
  • Python
    from sympy import isprime
    def K(n):
        ans, f = 0, 1
        for i in range(1, n+1):
            ans += f%n
            f = (f*i)%n
        return ans%n
    def ok(n): return isprime(n) and (K(n) + 2)%n == 0
    print([k for k in range(11000) if ok(k)]) # Michael S. Branicky, Jan 03 2022
    
  • Python
    # faster version for initial segment of sequence
    from sympy import isprime
    def afind(limit):
        f = 1 # (p-1)!
        s = 2 # sum(0! + 1! + ... + (p-1)!)
        for p in range(2, limit+1):
            if isprime(p) and s%p == p-2:
                print(p, end=", ")
            s += f*p
            f *= p
    afind(11000) # Michael S. Branicky, Jan 03 2022