A295574 a(n) = Sum_{1 <= j <= n/2, gcd(j,n)=1} j^2.
0, 1, 1, 1, 5, 1, 14, 10, 21, 10, 55, 26, 91, 35, 70, 84, 204, 75, 285, 140, 210, 165, 506, 196, 525, 286, 549, 406, 1015, 340, 1240, 680, 880, 680, 1190, 654, 2109, 969, 1482, 1080, 2870, 966, 3311, 1650, 2010, 1771, 4324, 1544, 4214, 2050
Offset: 1
Keywords
Links
- Seiichi Manyama, Table of n, a(n) for n = 1..10000
- John D. Baum, A Number-Theoretic Sum, Mathematics Magazine 55.2 (1982): 111-113.
- René Gy, The sum of product pairs of integers prime to n, Math StackExchange.
Crossrefs
Programs
-
Maple
R:=proc(n,k) local x,t1,S; t1:={}; S:=0; for x from 1 to floor(n/2) do if gcd(x,n)=1 then t1:={op(t1),x^k}; S:=S+x^k; fi; od; S; end; s:=k->[seq(R(n,k),n=1..50)]; s(2);
-
Mathematica
f[n_] := Plus @@ (Select[ Range[n/2], GCD[#, n] == 1 &]^2); Array[f, 50] (* Robert G. Wilson v, Dec 10 2017 *)
-
PARI
a(n) = sum(j=1, n\2, (gcd(j, n)==1)*j^2); \\ Michel Marcus, Dec 10 2017
Comments