OFFSET
1,2
COMMENTS
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
MATHEMATICA
JJJ[4, n, lam] = Sum[If[Mod[a^3 + b^3 + c^3 + d^3, n] == Mod[lam, n], 1, 0], {d, 0, n - 1}, {a, 0, n - 1}, {b, 0, n - 1}, {c, 0 , n - 1}]; Table[JJJ[4, n, 1], {n, 1, 50}]
PROG
(PARI) a(n) = sum(x=1, n, sum(y=1, n, sum(z=1, n, sum(t=1, n, Mod(x, n)^3 + Mod(y, n)^3 + Mod(z, n)^3 + Mod(t, n)^3 == 1)))); \\ Michel Marcus, Oct 11 2016
(PARI) qperms(v) = {my(r=1, t); v = vecsort(v); for(i=1, #v-1, if(v[i]==v[i+1], t++, r*=binomial(i, t+1); t=0)); r*=binomial(#v, t+1)}
a(n) = {my(t=0); forvec(v=vector(4, i, [1, n]), if(sum(i=1, 4, Mod(v[i], n)^3)==1, print1(v", "); t+=qperms(v)), 1); t} \\ David A. Corneth, Oct 11 2016
(Python)
def A276919(n):
ndict = {}
for i in range(n):
i3 = pow(i, 3, n)
for j in range(i+1):
j3 = pow(j, 3, n)
m = (i3+j3) % n
if m in ndict:
if i == j:
ndict[m] += 1
else:
ndict[m] += 2
else:
if i == j:
ndict[m] = 1
else:
ndict[m] = 2
count = 0
for i in ndict:
j = (1-i) % n
if j in ndict:
count += ndict[i]*ndict[j]
return count # Chai Wah Wu, Jun 06 2017
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
José María Grau Ribas, Sep 22 2016
STATUS
approved