OFFSET
1,1
COMMENTS
Primes p such that p+16 divides (p-1)!. - Robert Israel, Aug 30 2018
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
11 is in the sequence because 10! + 1 = 3628801 has the form (11+16)k + 1 = 27k + 1 = 27*134400 + 1.
MAPLE
filter:= proc(p) local L, t, q, s, i, r;
if not isprime(p) then return false fi;
for s in ifactors(p+16)[2] do
t:= 0: q:= s[1];
for i from 1 do
r:= floor((p-1)/q^i);
if r = 0 then return false fi;
t:= t+r;
if t >= s[2] then break fi;
od;
od;
true
end proc:
select(filter, [seq(i, i=3..1000, 2)]); # Robert Israel, Aug 30 2018
MATHEMATICA
Reap[For[p = 2, p < 1000, p = NextPrime[p], If[Divisible[(p - 1)!, p + 16], Sow[p]]]][[2, 1]] (* Jean-François Alcover, Jun 09 2020 *)
PROG
(PARI) isok(p) = isprime(p) && (Mod((p-1), (p+16)) == 0); \\ Michel Marcus, Jun 09 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved