login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A367176
Numbers k, such that (Sum_{d|k} (-1)^[d is prime] * d) is prime.
1
4, 6, 8, 9, 18, 32, 49, 50, 128, 162, 169, 242, 288, 400, 512, 578, 729, 900, 1058, 1156, 1521, 1600, 1682, 2048, 2116, 2312, 2450, 3025, 3249, 3600, 3872, 4356, 4418, 4489, 4624, 5000, 6241, 6728, 6962, 7225, 8100, 8281, 8450, 8464, 8649, 8712, 10000
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)))
A367176_list = list(islice(A367176_gen(), 20)) # Chai Wah Wu, Nov 10 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Nov 10 2023
STATUS
approved