login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Prime numbers whose anti-divisors are all prime numbers
1

%I #5 Mar 30 2012 18:53:49

%S 5,7,11,17,19,29,43,47,61,71,79,89,101,107,109,151,191,197,223,251,

%T 271,317,349,359,421,439,461,521,569,601,631,659,673,691,701,719,811,

%U 821,881,911,919,947,971,991,1009,1051,1091,1109,1153,1181,1217,1231

%N Prime numbers whose anti-divisors are all prime numbers

%e Anti-divisors of 109 are 2, 3, 7, 31, 73 that are all prime numbers

%p with(numtheory);

%p P:=proc(i)

%p local a,b,c,k,j,n,ok;

%p for n from 3 by 1 to i do

%p j:=ithprime(n); a:={};

%p for k from 2 to j-1 do

%p if abs((j mod k)- k/2) < 1 then a:=a union {k}; fi;

%p od;

%p b:=nops(a); c:=op(a);

%p if b>1 then

%p ok:=1;

%p for k from 1 to b do

%p if (not isprime(c[k])) then ok:=0; break; fi;

%p od;

%p if ok=1 then print(j); fi;

%p else

%p if isprime(op(a)) then print(j); fi;

%p fi;

%p od;

%p end:

%Y Cf. A066272

%K nonn,easy

%O 1,1

%A _Paolo P. Lava_, Jul 15 2011