login
A005078
Sum of primes = 1 mod 4 dividing n.
6
0, 0, 0, 0, 5, 0, 0, 0, 0, 5, 0, 0, 13, 0, 5, 0, 17, 0, 0, 5, 0, 0, 0, 0, 5, 13, 0, 0, 29, 5, 0, 0, 0, 17, 5, 0, 37, 0, 13, 5, 41, 0, 0, 0, 5, 0, 0, 0, 0, 5, 17, 13, 53, 0, 5, 0, 0, 29, 0, 5, 61, 0, 0, 0, 18, 0, 0, 17, 0, 5, 0, 0, 73, 37, 5, 0, 0, 13, 0, 5, 0, 41, 0, 0, 22, 0, 29, 0, 89, 5, 13, 0, 0, 0, 5, 0, 97, 0, 0, 5, 101
OFFSET
1,5
LINKS
FORMULA
Additive with a(p^e) = p if p = 1 (mod 4), 0 otherwise.
a(n) = A008472(n) - A005082(n) - 2*A059841(n). - Antti Karttunen, Jul 11 2017
MATHEMATICA
Array[DivisorSum[#, # &, And[PrimeQ@ #, Mod[#, 4] == 1] &] &, 101] (* Michael De Vlieger, Jul 11 2017 *)
f[p_, e_] := If[Mod[p, 4] == 1, p, 0]; a[n_] := Plus @@ f @@@ FactorInteger[n]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jun 21 2022 *)
PROG
(PARI) a(n)=my(f=factor(n)[, 1]); sum(i=1, #f, if(f[i]%4==1, f[i])) \\ Charles R Greathouse IV, Mar 11 2014
(Scheme) (define (A005078 n) (if (= 1 n) 0 (+ (if (= 1 (modulo (A020639 n) 4)) (A020639 n) 0) (A005078 (A028234 n))))) ;; Antti Karttunen, Jul 11 2017
KEYWORD
nonn
EXTENSIONS
More terms from Antti Karttunen, Jul 11 2017
STATUS
approved