OFFSET
1,1
FORMULA
k is a term if and only if A367175(k) is prime.
MAPLE
select(n -> isprime(A367175(n)), [seq(1..10000)]);
MATHEMATICA
Select[Range[10000], And[# > 1, PrimeQ[#]] &@ DivisorSum[#, (-1)^Boole[PrimeQ[#]]*# &] &] (* Michael De Vlieger, Nov 10 2023 *)
PROG
(SageMath)
def is_a(n): return is_prime(sum((-1)^is_prime(d)*d for d in divisors(n)))
print([n for n in range(1, 10001) if is_a(n)])
(PARI) isok(k) = isprime(sumdiv(k, d, (-1)^isprime(d)*d)); \\ Michel Marcus, Nov 10 2023
(Python)
from itertools import count, islice
from sympy import divisor_sigma, primefactors
def A367176_gen(startvalue=2): # generator of terms >= startvalue
return filter(lambda n: isprime(divisor_sigma(n)-(sum(primefactors(n))<<1)), count(max(startvalue, 2)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Nov 10 2023
STATUS
approved