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
-
w[n_] := Block[{c = k = m = 1}, While[k < n, m = Mod[m *= k, n]; If[m == 1 || m + 1 == n, c++ ]; k++ ]; c]
-
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
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
-
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 *)
-
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
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
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.
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
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.
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
-
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 *)
Showing 1-5 of 5 results.
Comments