login
Primes p for which residue of ((p-1)! + 1) modulo (p + 16) equals 1.
1

%I #16 Jun 09 2020 07:17:36

%S 11,17,19,23,29,41,47,53,59,61,71,79,83,89,101,103,107,109,113,127,

%T 131,137,139,149,167,173,179,191,193,197,199,227,229,233,239,251,257,

%U 263,269,271,281,283,293,307,311,313,317,347,349,353,359,379,383,389,397

%N Primes p for which residue of ((p-1)! + 1) modulo (p + 16) equals 1.

%C Primes p such that p+16 divides (p-1)!. - _Robert Israel_, Aug 30 2018

%H Robert Israel, <a href="/A049593/b049593.txt">Table of n, a(n) for n = 1..10000</a>

%e 11 is in the sequence because 10! + 1 = 3628801 has the form (11+16)k + 1 = 27k + 1 = 27*134400 + 1.

%p filter:= proc(p) local L, t,q,s,i,r;

%p if not isprime(p) then return false fi;

%p for s in ifactors(p+16)[2] do

%p t:= 0: q:= s[1];

%p for i from 1 do

%p r:= floor((p-1)/q^i);

%p if r = 0 then return false fi;

%p t:= t+r;

%p if t >= s[2] then break fi;

%p od;

%p od;

%p true

%p end proc:

%p select(filter, [seq(i,i=3..1000,2)]); # _Robert Israel_, Aug 30 2018

%t 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 *)

%o (PARI) isok(p) = isprime(p) && (Mod((p-1), (p+16)) == 0); \\ _Michel Marcus_, Jun 09 2020

%K nonn

%O 1,1

%A _Labos Elemer_