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

A071710 Highly Wilsonian primes: smallest primes p such that w(p)=n where w(n) denote the number of nonnegative integers k such that k! = +1 or -1 (mod n).

Original entry on oeis.org

2, 3, 5, 7, 17, 67, 137, 23, 61, 71, 401, 1907, 661, 12227, 29873, 96731, 99721, 154243, 480209, 3408707, 1738901, 27341387
Offset: 2

Views

Author

Benoit Cloitre, Jun 03 2002

Keywords

Comments

Obviously w(n) is at least 2 because 0! = 1! = +1 (mod n) for every n. Also, if p is a prime, then w(p) is at least 4 because (p-2)! = +1 and (p-1)! = -1 (mod p) by Wilson's Theorem.
The smallest prime(k) such that A238444(k) = n-2. - Vladimir Shevelev, Feb 28 2014
The sequence w(n) is 1, 2, 3, 2, 4, 2, 5, 2, 2, 2, 5, 2, 4,... (offset 1) = 1 +A049046(n) +A238532(n) for n>2. - R. J. Mathar, Apr 02 2014

Programs

  • Mathematica
    w[n_] := Block[{c = k = m = 1}, While[k < n, m = Mod[m *= k, n]; If[m == 1 || m + 1 == n, c++ ]; k++ ]; c]
  • PARI
    wilsonian(p)={ local(s,t,pMinusOne); pMinusOne=p-1; s=4; t=24; for(k=5,p-3, t=(t*k)%p; if(t==1 || t==pMinusOne, s=s+1) ); s } \\ Charles R Greathouse IV, Jan 24 2007

Extensions

2 more terms from Charles R Greathouse IV, Jan 24 2007
a(23) from Igor Naverniouk (igor(AT)cs.utoronto.ca), May 09 2007

A238460 Primes p for which x! + (p-1)!/x!==0 (mod p) has only two solutions 1<=x<=p-2 following from Wilson theorem: x = 1 and x = p-2.

Original entry on oeis.org

5, 13, 37, 41, 101, 113, 157, 173, 181, 197, 229, 241, 281, 313, 337, 349, 353, 373, 409, 421, 433, 509, 541, 617, 677, 701, 757, 761, 769, 773, 821, 929, 941, 977, 997, 1013, 1093, 1097, 1109, 1181, 1193, 1237, 1409, 1433, 1481, 1489, 1669, 1693, 1721, 1741
Offset: 1

Views

Author

Vladimir Shevelev, Feb 27 2014

Keywords

Comments

a(n) is prime(k(n)) for which A238444(k(n)) = 2.

Crossrefs

Cf. A238444.

Programs

  • Mathematica
    A238444[n_] := a[n] = Module[{p, r}, p = Prime[n]; r = Range[p-2]; Count[r!+(p-1)!/r!, k_ /; Divisible[k, p]]]; A238460 = Prime /@ (Position[Table[A238444[n], {n, 1, 300}], 2] // Flatten) (* Jean-François Alcover, Feb 27 2014 *)
  • PARI
    is(p)=if(!isprime(p),return(0)); my(X=Mod(1,p),P=Mod((p-1)!,p));for(x=2,p-3,X*=x;P/=x;if(X+P==0,return(0))); p>3 \\ Charles R Greathouse IV, Feb 28 2014

Formula

a(n) == 1 (mod 4).
Proof. Using Wilson's theorem, for every p>3, p==3(mod 4) we have, at least, 3 solution in [1,p-2] of x! + (p-1)!/x!==0 (mod p): x = 1, x = (p-1)/2, x = p-2.

Extensions

More terms from Peter J. C. Moses, Feb 27 2014

A238446 Let B be a nonempty and proper subset of A_n = {1,2,...,p_n-1}, where p_n is the n-th prime. Let C be the complement of B, so that the union B and C is A_n. a(n) is half the number of sums of products of elements of B and elements of C which are divisible by p_n, when B runs through all such subsets of A_n.

Original entry on oeis.org

0, 1, 3, 11, 103, 343, 4095, 14571, 190651, 9586983, 35791471, 1908874583, 27487790719, 104715393911, 1529755308211, 86607685141743, 4969489243995031, 19215358410149343, 1117984489315857511, 16865594581677305359, 65588423373189982911
Offset: 1

Views

Author

Keywords

Examples

			Take A_3 ={1,2,3,4}.  The nonempty and proper subsets are: {{1}, {2}, {3}, {4}, {1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}, {1,2,3}, {1,2,4}, {1,3,4}, {2,3,4}}.
Sums of products of elements of B and elements of C are: 1+2*3*4=25, and analogously 14,11,10,14,11,10,10,11,14,10,11,14,25.
We have 6 numbers divisible by 5. So a(3)=6/2=3.
		

Crossrefs

Formula

a(n) = A038791(n) - 1. - Ridouane Oudra, Jul 08 2025

Extensions

Name edited and more terms from Ridouane Oudra, Jul 08 2025

A238692 a(n) is the quotient of the sum of (not necessarily distinct) integers i!+(prime(n)-1)!/i!, i=1,2,...,prime(n)-2, which are divisible by prime(n), and prime(n).

Original entry on oeis.org

0, 1, 7, 139, 365641, 39916801, 1317933016441, 355688356705921, 53128667010491295649, 10888872347627347035630931201, 8841761993746245283777145088001, 10333147966386144929666651337523200000001
Offset: 1

Views

Author

Keywords

Comments

a(n) is prime for n = {3,4,5,6,7,31,738}; a(738) ~ 7.1 * 10^18518. There are no others for n up to 1000. - Peter J. C. Moses, Mar 03 2014

Examples

			Let n=4, prime(n)=7. Consider integers i!+6!/i!, i=1,2,3,4,5: 721,362,126,54,126. Among them 721,126,126 are divisible by 7. So a(4)=(721 + 126 + 126)/7 = 139.
		

Crossrefs

Programs

A238501 Primes p for which x! + (p-1)!/x!==0 (mod p) has only three solutions 1<=x<=p-2.

Original entry on oeis.org

7, 11, 19, 31, 43, 47, 107, 127, 131, 151, 163, 167, 179, 191, 211, 223, 263, 283, 347, 367, 443, 487, 491, 523, 547, 587, 643, 659, 751, 827, 839, 911, 1039, 1051, 1087, 1103, 1123, 1163, 1171, 1223, 1259, 1283, 1291, 1327, 1427, 1439, 1447, 1487, 1523, 1543
Offset: 1

Views

Author

Vladimir Shevelev, Feb 27 2014

Keywords

Comments

All terms are of the form 4*k+3.
Using Wilson's theorem, for every p>3, p==3(mod 4) we have, at least, 3 solutions in [1,p-2] of x! + (p-1)!/x!==0 (mod p): x = 1, x = (p-1)/2, x = p-2.

Crossrefs

Programs

  • Mathematica
    kmax = 400; Select[Select[4*Range[kmax]+3, PrimeQ], (r = Range[#-2]; Count[r!+(#-1)!/r!, k_ /; Divisible[k, #]] == 3)&] (* Jean-François Alcover, Mar 05 2014 *)

Formula

a(n) is prime(k(n)) for which A238444(k(n)) = 3.

Extensions

More terms from Peter J. C. Moses, Feb 27 2014
Showing 1-5 of 5 results.