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-4 of 4 results.

A286181 Lesser of Wilson's pseudo-twin primes: primes p such that p! == 1 (mod q), where q=A151800(p) is the next prime after p, and q-p>2.

Original entry on oeis.org

7841, 594278556271608991, 4259842839142238791410741595983041626644087433
Offset: 1

Views

Author

Max Alekseyev and Thomas Ordowski, May 04 2017

Keywords

Comments

By Wilson's theorem, p! == 1 (mod p+2) whenever p,p+2 are twin primes. This sequence and A286208 concern consecutive primes p,q satisfying p! = 1 (mod q), where d = q-p > 2.
It follows that (d-1)! == 1 (mod q), and so q divides A033312(d-1).
Listed terms correspond to d = 12, 30, 76 (cf. A286230). Further terms should have d>=140.
Also, primes p=prime(n) such that A275111(n)=1, and (prime(n),prime(n+1)) are not twin primes (i.e., p is not a term of A001359).

Examples

			For a(1)=7841, we have 7841! == 1 (mod 7853), where 7841 and 7853=7841+12 are consecutive primes. Also, 7853 | (12-1)!-1.
		

Crossrefs

A286208 Greater of Wilson's pseudo-twin primes: primes q such that p! == 1 (mod q), where p=A151799(q) is the previous prime before q, and q-p>2.

Original entry on oeis.org

7853, 594278556271609021, 4259842839142238791410741595983041626644087509
Offset: 1

Views

Author

Max Alekseyev and Thomas Ordowski, May 04 2017

Keywords

Comments

By Wilson's theorem, p! == 1 (mod p+2) whenever (p,p+2) are twin primes. This sequence and A286181 concern consecutive primes (p,q) satisfying p! = 1 (mod q), where d = q-p > 2.
It follows that (d-1)! == 1 (mod q). Listed terms correspond to d = 12, 30, 76 (cf. A286230). Further terms should have d>=140.
Also, primes q=prime(n) such that A275111(n-1)=1, and (prime(n-1),prime(n)) are not twin primes (i.e., q is not a term of A006512).

Crossrefs

Subsequence of A166864.

A286230 Possible differences between consecutive primes p, q satisfying p! == 1 (mod q).

Original entry on oeis.org

2, 12, 30, 76
Offset: 1

Views

Author

Max Alekseyev, May 04 2017

Keywords

Comments

By Wilson's theorem, p! == 1 (mod p+2) whenever p, p+2 are twin primes, so 2 is a term.
Terms d > 2 correspond to Wilson's pseudo-twin primes, i.e., consecutive primes p, q such that q - p = d and p! == 1 (mod q). The corresponding primes are listed in A286181 and A286208.
As a set, the sequence is the union of {2} and the differences {A286208(n) - A286181(n)}.
A positive integer d belongs to this sequence if A033312(d-1) = (d-1)! - 1 has a prime factor q such that q - A151799(q) = d.
All terms are even.
If it exists, a(5) >= 140.

Crossrefs

A360825 a(n) is the remainder after dividing n! by its least nondivisor.

Original entry on oeis.org

1, 1, 2, 2, 4, 1, 6, 2, 5, 1, 10, 1, 12, 3, 8, 1, 16, 1, 18, 4, 11, 1, 22, 22, 6, 5, 14, 1, 28, 1, 30, 33, 20, 31, 18, 1, 36, 7, 20, 1, 40, 1, 42, 8, 23, 1, 46, 19, 11, 9, 26, 1, 52, 30, 27, 10, 29, 1, 58, 1, 60, 43, 53, 56, 33, 1, 66, 12, 35, 1, 70, 1, 72, 27, 23
Offset: 0

Views

Author

Sebastian F. Orellana, Feb 22 2023

Keywords

Comments

For every term besides a(3), the least nondivisor is the next prime after n.

Examples

			a(5) = 5! mod 7 = 120 mod 7 = 1.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{f = n!, m = n + 1}, While[Divisible[f, m], m++]; Mod[f, m]]; Array[a, 100, 0] (* Amiram Eldar, Feb 22 2023 *)
  • PARI
    a(n) = my(k=1, r); while(!(r=(n! % (n+k))), k++); r; \\ Michel Marcus, Feb 22 2023
    
  • Python
    from functools import reduce
    from sympy import nextprime
    def A360825(n):
        if n == 3: return 2
        m = nextprime(n)
        return reduce(lambda i, j: i*j%m,range(2,n+1),1)%m # Chai Wah Wu, Feb 22 2023
    
  • Python
    from functools import reduce
    from sympy import nextprime
    def A360825(n):
        if n == 3: return 2
        m = nextprime(n)
        return (m-1)*pow(reduce(lambda i,j:i*j%m,range(n+1,m),1),-1,m)%m # Chai Wah Wu, Feb 23 2023

Formula

a(n) = 1 <=> n in { A040976 } \ { 3 }.
a(n) = n <=> n in { A006093 }.
a(n) = n! mod A151800(n) for n > 3.
a(n) = A213636(n!) = A213636(A000142(n)).
a(A000040(n)) = A275111(n) for n >= 3.
a(n) > n <=> n in { A360805 }.
Showing 1-4 of 4 results.