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.

Showing 1-1 of 1 results.

A367175 a(n) = Sum_{d|n} (-1)^[d is prime] * d, where [] denotes the Iverson bracket.

Original entry on oeis.org

1, -1, -2, 3, -4, 2, -6, 11, 7, 4, -10, 18, -12, 6, 8, 27, -16, 29, -18, 28, 12, 10, -22, 50, 21, 12, 34, 38, -28, 52, -30, 59, 20, 16, 24, 81, -36, 18, 24, 76, -40, 72, -42, 58, 62, 22, -46, 114, 43, 79, 32, 68, -52, 110, 40, 102, 36, 28, -58, 148, -60, 30
Offset: 1

Views

Author

Peter Luschny, Nov 08 2023

Keywords

Crossrefs

Programs

  • Maple
    Isprime := n -> if isprime(n) then 1 else 0 fi:
    a := n -> local d; add((-1)^Isprime(d) * d, d in NumberTheory:-Divisors(n)):
    seq(a(n), n = 1..62);
  • Mathematica
    Array[DivisorSum[#, (-1)^Boole[PrimeQ[#]]*# &] &, 62] (* Michael De Vlieger, Nov 10 2023 *)
  • PARI
    a(n) = sumdiv(n, d, (-1)^isprime(d)*d); \\ Michel Marcus, Nov 10 2023
    
  • Python
    from sympy import divisor_sigma, primefactors
    def A367175(n): return divisor_sigma(n)-(sum(primefactors(n))<<1) # Chai Wah Wu, Nov 10 2023
  • SageMath
    def A367175(n): return sum((-1)^is_prime(d)*d for d in divisors(n))
    print([A367175(n) for n in range(1, 63)])
    

Formula

{k: a(k) < 0} = {A000040}.
{k: a(k) > k} = {A033942}.
{k: a(k) < k} = {A037143} \ {1}.
sigma(n) - a(n) = 2 * A008472(n).
Conjecture: {k: a(k) divides sigma(k)} = {1, 2, 3, 6, 14, 15, 35}.
Showing 1-1 of 1 results.