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.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Nov 10 2023

Keywords

Crossrefs

Programs

  • 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 *)
  • 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
  • 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)])
    

Formula

k is a term if and only if A367175(k) is prime.