OFFSET
1,1
COMMENTS
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
MATHEMATICA
lpf[n_] := FactorInteger[n][[1, 1]]; aQ[n_] := Module[{k=6}, While[PrimeQ[k-3] && PrimeQ[k-1] || lpf[k-1]<=lpf[k-3] || lpf[k-3]<Prime[n], k+=2]; k == (Prime[n]+1)^2 + 2]; Select[Range[50], aQ] (* Amiram Eldar, Dec 10 2018 *)
PROG
(PARI) lpf(k) = factorint(k)[1, 1];
f(n) = my(k=6); while((isprime(k-3) && isprime(k-1)) || lpf(k-1)<=lpf(k-3) || lpf(k-3)<prime(n), k+=2); k; \\ A242720
isok(n) = f(n) == (prime(n)+1)^2 + 2; \\ Michel Marcus, Dec 10 2018
(Python)
from sympy import prime, isprime, factorint
A246824_list = [a for a, b in ((n, prime(n)+1) for n in range(3, 10**3)) if (not (isprime(b**2-1) and isprime(b**2+1)) and (min(factorint(b**2+1)) > min(factorint(b**2-1)) >= b-1))] # Chai Wah Wu, Jun 03 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Sep 04 2014
EXTENSIONS
a(40)-a(50) from b-file by Robert Price, Sep 08 2019
STATUS
approved