OFFSET
1,1
FORMULA
Apparently, a(n) = 2*(A179182(n-1) + 1) for n >= 2. - Hugo Pfoertner, Feb 23 2022
EXAMPLE
4 is in the sequence since 4-(1)=3, 4-(2)=2, 4-(4)=0, and at least one of 3,2,0 is prime.
56 is not in the sequence since the divisors of 56 are 1, 2, 4, 7, 8, 14, 28, 56, and none of 56-1, 56-2, 56-4, ... etc. are prime (i.e., none of 55, 54, 52, 49, 48, 42, 28, 0 are prime).
MATHEMATICA
q[n_] := AnyTrue[Divisors[n], PrimeQ[n - #] &]; Select[Range[200], q] (* Amiram Eldar, Feb 22 2022 *)
PROG
(PARI) isok(k) = sumdiv(k, d, isprime(k-d)) >= 1; \\ Michel Marcus, Feb 22 2022
(PARI) is(n) = isprime(n-1) || (n%2 == 0 && isprime(n/2)) \\ David A. Corneth, Feb 22 2022
(Python)
from sympy import divisors, isprime
def ok(n): return any(isprime(n-d) for d in divisors(n))
print([k for k in range(203) if ok(k)]) # Michael S. Branicky, Feb 22 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Feb 22 2022
STATUS
approved