login
A351863
Numbers k with at least one divisor, d, such that k-d is prime.
1
3, 4, 6, 8, 10, 12, 14, 18, 20, 22, 24, 26, 30, 32, 34, 38, 42, 44, 46, 48, 54, 58, 60, 62, 68, 72, 74, 80, 82, 84, 86, 90, 94, 98, 102, 104, 106, 108, 110, 114, 118, 122, 128, 132, 134, 138, 140, 142, 146, 150, 152, 158, 164, 166, 168, 174, 178, 180, 182, 192, 194, 198, 200, 202
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
Cf. A242932.
Union of A008864 and A100484.
Sequence in context: A156624 A341340 A242932 * A025201 A071259 A231405
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Feb 22 2022
STATUS
approved