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.

A005066 Sum of squares of odd primes dividing n.

Original entry on oeis.org

0, 0, 9, 0, 25, 9, 49, 0, 9, 25, 121, 9, 169, 49, 34, 0, 289, 9, 361, 25, 58, 121, 529, 9, 25, 169, 9, 49, 841, 34, 961, 0, 130, 289, 74, 9, 1369, 361, 178, 25, 1681, 58, 1849, 121, 34, 529, 2209, 9, 49, 25, 298, 169, 2809, 9, 146, 49, 370, 841, 3481, 34, 3721, 961, 58, 0, 194, 130, 4489, 289, 538, 74, 5041, 9, 5329, 1369
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Total[Select[Divisors[n],OddQ[#]&&PrimeQ[#]&]^2],{n,60}] (* Harvey P. Dale, May 02 2012 *)
    Array[DivisorSum[#, #^2 &, And[PrimeQ@ #, OddQ@ #] &] &, 74] (* Michael De Vlieger, Jul 11 2017 *)
    f[2, e_] := 0; f[p_, e_] := p^2; a[n_] := Plus @@ f @@@ FactorInteger[n]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jun 20 2022 *)
  • PARI
    a(n) = sumdiv(n, d, ((d%2) && isprime(d))*d^2); \\ Michel Marcus, Jan 04 2017
    
  • Python
    from sympy import primefactors
    def a(n): return sum(p**2 for p in primefactors(n) if p % 2)
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jul 11 2017
  • Scheme
    (define (A005066 n) (cond ((= 1 n) 0) ((even? n) (A005066 (/ n 2))) (else (+ (A000290 (A020639 n)) (A005066 (A028234 n)))))) ;; Antti Karttunen, Jul 10 2017
    

Formula

Additive with a(p^e) = 0 if p = 2, p^2 otherwise.
G.f.: Sum_{k>=2} prime(k)^2*x^prime(k)/(1 - x^prime(k)). - Ilya Gutkovskiy, Jan 04 2017
From Antti Karttunen, Jul 10 & 11 2017: (Start)
a(1) = 0; after which, for even n: a(n) = a(n/2), for odd n: a(n) = A020639(n)^2 + a(A028234(n)).
a(n) = A005063(A000265(n)).
a(n) = A005079(n) + A005083(n).
(End)

Extensions

More terms from Antti Karttunen, Jul 10 2017