cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A367176 Numbers k, such that (Sum_{d|k} (-1)^[d is prime] * d) is prime.

This page as a plain text file.
%I A367176 #16 Nov 11 2023 00:16:03
%S A367176 4,6,8,9,18,32,49,50,128,162,169,242,288,400,512,578,729,900,1058,
%T A367176 1156,1521,1600,1682,2048,2116,2312,2450,3025,3249,3600,3872,4356,
%U A367176 4418,4489,4624,5000,6241,6728,6962,7225,8100,8281,8450,8464,8649,8712,10000
%N A367176 Numbers k, such that (Sum_{d|k} (-1)^[d is prime] * d) is prime.
%F A367176 k is a term if and only if A367175(k) is prime.
%p A367176 select(n -> isprime(A367175(n)), [seq(1..10000)]);
%t A367176 Select[Range[10000], And[# > 1, PrimeQ[#]] &@ DivisorSum[#, (-1)^Boole[PrimeQ[#]]*# &] &] (* _Michael De Vlieger_, Nov 10 2023 *)
%o A367176 (SageMath)
%o A367176 def is_a(n): return is_prime(sum((-1)^is_prime(d)*d for d in divisors(n)))
%o A367176 print([n for n in range(1, 10001) if is_a(n)])
%o A367176 (PARI) isok(k) = isprime(sumdiv(k, d, (-1)^isprime(d)*d)); \\ _Michel Marcus_, Nov 10 2023
%o A367176 (Python)
%o A367176 from itertools import count, islice
%o A367176 from sympy import divisor_sigma, primefactors
%o A367176 def A367176_gen(startvalue=2): # generator of terms >= startvalue
%o A367176     return filter(lambda n: isprime(divisor_sigma(n)-(sum(primefactors(n))<<1)), count(max(startvalue,2)))
%o A367176 A367176_list = list(islice(A367176_gen(),20)) # _Chai Wah Wu_, Nov 10 2023
%Y A367176 Cf. A367175, A023194, A114522.
%K A367176 nonn
%O A367176 1,1
%A A367176 _Peter Luschny_, Nov 10 2023