The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A355644 Primes p such that p^2-1 does not have a divisor d with d + (p^2-1)/d prime. 2

%I #12 Jul 13 2022 17:41:50

%S 2,3,467,487,787,887,1279,2063,2557,2657,2903,3323,3413,3547,3583,

%T 4273,4373,4517,4567,4801,5233,5393,5443,6047,6823,6911,7507,9133,

%U 9137,9721,9973,10103,10313,10937,12227,12763,13183,13627,14407,15073,15083,15187,15359,15787,16903,17047,17911,18013,18587

%N Primes p such that p^2-1 does not have a divisor d with d + (p^2-1)/d prime.

%C Primes p such that p^2-1 is not in A355643.

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

%e a(2) = 3 is a term because it is prime, the divisors of 3^2-1 = 8 are 1, 2, 4 and 8, and none of 1+8/1 = 9, 2+8/2 = 6, 4+8/4 = 6, 8+8/8 = 9 are prime.

%p filter:= proc(p) local n,F,t;

%p n:= p^2-1;

%p F:= select(t -> t^2 <=n, numtheory:-divisors(n));

%p not ormap(isprime, map(t -> t+n/t, F))

%p end proc:

%p select(filter, [seq(ithprime(i),i=1..3000)]);

%t q[n_] := AllTrue[Divisors[n], !PrimeQ[# + n/#] &]; Select[Prime[Range[2000]], q[#^2 - 1] &] (* _Amiram Eldar_, Jul 11 2022 *)

%o (PARI) isok(p) = isprime(p) && fordiv(p^2-1, d, if (isprime(d + (p^2-1)/d), return(0))); return(1); \\ _Michel Marcus_, Jul 11 2022

%o (Python)

%o from sympy import divisors, isprime

%o def ok(n):

%o if not isprime(n): return False

%o t = n**2 - 1

%o return not any(isprime(d+t//d) for d in divisors(t, generator=True))

%o print([k for k in range(19000) if ok(k)]) # _Michael S. Branicky_, Jul 11 2022

%Y Cf. A355643.

%K nonn

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Jul 11 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 6 10:40 EDT 2024. Contains 373127 sequences. (Running on oeis4.)