A005071 Sum of squares of primes = 1 mod 3 dividing n.
0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 169, 49, 0, 0, 0, 0, 361, 0, 49, 0, 0, 0, 0, 169, 0, 49, 0, 0, 961, 0, 0, 0, 49, 0, 1369, 361, 169, 0, 0, 49, 1849, 0, 0, 0, 0, 0, 49, 0, 0, 169, 0, 0, 0, 49, 361, 0, 0, 0, 3721, 961, 49, 0, 169, 0, 4489, 0, 0, 49, 0, 0, 5329, 1369, 0, 361, 49, 169, 6241, 0, 0, 0, 0, 49, 0, 1849, 0, 0, 0, 0, 218
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10001
Programs
-
Mathematica
Module[{sp=Select[Prime[Range[100]],Mod[#,3]==1&]},Table[Total[ Select[ sp, Divisible[ n,#]&]^2],{n,70}]] (* Harvey P. Dale, Dec 19 2014 *) f[p_, e_] := If[Mod[p, 3] == 1, p^2, 0]; a[n_] := Plus @@ f @@@ FactorInteger[n]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jun 21 2022 *)
-
Scheme
(define (A005071 n) (if (= 1 n) 0 (+ (A000290 (if (= 1 (modulo (A020639 n) 3)) (A020639 n) 0)) (A005071 (A028234 n))))) ;; Antti Karttunen, Jul 09 2017
Formula
Additive with a(p^e) = p^2 if p = 1 (mod 3), 0 otherwise.
Extensions
More terms from Antti Karttunen, Jul 09 2017