login
Sum of squares of primes = 1 mod 3 dividing n.
5

%I #19 Jun 21 2022 05:08:58

%S 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,

%T 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,

%U 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

%N Sum of squares of primes = 1 mod 3 dividing n.

%H Antti Karttunen, <a href="/A005071/b005071.txt">Table of n, a(n) for n = 1..10001</a>

%F Additive with a(p^e) = p^2 if p = 1 (mod 3), 0 otherwise.

%t Module[{sp=Select[Prime[Range[100]],Mod[#,3]==1&]},Table[Total[ Select[ sp, Divisible[ n,#]&]^2],{n,70}]] (* _Harvey P. Dale_, Dec 19 2014 *)

%t 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 *)

%o (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

%Y Cf. A000290, A005070, A005072, A005073.

%K nonn

%O 1,7

%A _N. J. A. Sloane_

%E More terms from _Antti Karttunen_, Jul 09 2017