login
A295575
a(n) = Sum_{1 <= j <= n/2, gcd(j,n)=1} j^3.
3
0, 1, 1, 1, 9, 1, 36, 28, 73, 28, 225, 126, 441, 153, 416, 496, 1296, 469, 2025, 1100, 1710, 1225, 4356, 1800, 4959, 2556, 5581, 4410, 11025, 3872, 14400, 8128, 11090, 8128, 15822, 8910, 29241, 13041, 21996, 16400, 44100, 15426, 53361, 27830, 33716, 29161, 76176, 27936, 77652, 37828
OFFSET
1,5
COMMENTS
If p is an odd prime, a(p) = (n^2-1)^2/64. - Robert Israel, Dec 10 2017
LINKS
John D. Baum, A Number-Theoretic Sum, Mathematics Magazine 55.2 (1982): 111-113.
FORMULA
From Chai Wah Wu, Apr 28 2026: (Start)
If n==0 (mod 4): a(n) = n^2*(n*A000010(n)+4*A023900(n))/64
If n is odd: a(n) = (n^3*A000010(n)-2*n^2*A023900(n)+A063453(n))/64
If n!=2 and n==2 (mod 4): a(n) = (7*n^3*A000010(n)-56*n^2*A023900(n)+8*A063453(n))/448 (End)
MAPLE
f:= n -> add(t^3, t = select(t->igcd(t, n)=1, [$1..n/2])) :
map(f, [$1..100]); # Robert Israel, Dec 10 2017
MATHEMATICA
f[n_] := Plus @@ (Select[Range[n/2], GCD[#, n] == 1 &]^3); Array[f, 50] (* Robert G. Wilson v, Dec 10 2017 *)
PROG
(PARI) a(n) = sum(j=1, n\2, (gcd(j, n)==1)*j^3); \\ Michel Marcus, Dec 10 2017
(Python)
from math import prod
from sympy import primefactors
def A295575(n):
if n == 2: return 1
m, ps = n&3, primefactors(n)
s1, s3 = prod(1-p for p in ps), prod(1-p**3 for p in ps)
t = n*(-s1 if len(ps)&1 else s1)//prod(ps)
if not m:
return n**2*(n*t+4*s1)>>6
elif m==2:
return (7*n**3*t-56*n**2*s1+8*s3)//7>>6
else:
return (n**3*t-n**2*s1*2+s3)>>6 # Chai Wah Wu, Apr 28 2026
CROSSREFS
In the Baum (1982) paper, S_1, S_2, S_3, S_4 are A023896, A053818, A053819, A053820, and S'_1, S'_2, S'_3, S'_4 are A066840, A295574, A295575, A295576.
Sequence in context: A373792 A276634 A050312 * A107892 A283043 A283016
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Dec 08 2017
STATUS
approved