login
Number of solutions to x^3 + y^3 + z^3 + t^3 == 0 (mod n) for 1 <= x, y, z, t <= n.
2

%I #29 Jun 07 2017 00:35:43

%S 1,8,27,72,125,216,595,704,1539,1000,1331,1944,3133,4760,3375,5632,

%T 4913,12312,8911,9000,16065,10648,12167,19008,16125,25064,45927,42840,

%U 24389,27000,35371,47104,35937,39304,74375,110808,58645,71288,84591,88000

%N Number of solutions to x^3 + y^3 + z^3 + t^3 == 0 (mod n) for 1 <= x, y, z, t <= n.

%C a(n) = n^3 if n is in A074243. - _Robert Israel_, Oct 13 2016

%H Chai Wah Wu, <a href="/A276920/b276920.txt">Table of n, a(n) for n = 1..10000</a> (terms n = 1..242 from Robert Israel)

%e For n = 3, we see that all nondecreasing solutions {x, y, z, t} are in {{1, 1, 1, 3}, {1, 1, 2, 2}, {1, 2, 3, 3}, {2, 2, 2, 3}, {3, 3, 3, 3}}. The numbers in the sets can be ordered in 4, 6, 12, 4 and 1 ways respectively. Therefore, a(3) = 4 + 6 + 12 + 4 + 1 = 27. - _David A. Corneth_, Oct 11 2016

%p CF:= table([[false, false, true] = 12, [true, false, false] = 12, [true, false, true] = 6, [false, false, false] = 24, [true, true, true] = 1, [false, true, true] = 4, [false, true, false] = 12, [true, true, false] = 4]):

%p f1:= proc(n)

%p option remember;

%p local count, t, x,y,z,signature;

%p if isprime(n) and n mod 3 = 2 then return n^3 fi;

%p count:= 0;

%p for t from 1 to n do

%p for x from 1 to t do

%p for y from 1 to x do

%p for z from 1 to y do

%p if t^3 + x^3 + y^3 + z^3 mod n = 0 then

%p signature:= map(evalb,[z=y,y=x,x=t]);

%p count:= count + CF[signature];

%p fi

%p od od od od;

%p count

%p end proc:

%p f:= proc(n) local t;

%p mul(f1(t[1]^t[2]),t=ifactors(n)[2])

%p end proc:

%p map(f, [$1..40]); # _Robert Israel_, Oct 13 2016

%t 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, 0], {n, 1, 50}]

%o (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 == 0)))); \\ _Michel Marcus_, Oct 11 2016

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

%o a(n) = {my(t=0); forvec(v=vector(4,i,[1,n]), if(sum(i=1,4,Mod(v[i],n)^3)==0, t+=qperms(v)),1);t} \\ _David A. Corneth_, Oct 11 2016

%o (Python)

%o def A276920(n):

%o ndict = {}

%o for i in range(n):

%o i3 = pow(i,3,n)

%o for j in range(i+1):

%o j3 = pow(j,3,n)

%o m = (i3+j3) % n

%o if m in ndict:

%o if i == j:

%o ndict[m] += 1

%o else:

%o ndict[m] += 2

%o else:

%o if i == j:

%o ndict[m] = 1

%o else:

%o ndict[m] = 2

%o count = 0

%o for i in ndict:

%o j = (-i) % n

%o if j in ndict:

%o count += ndict[i]*ndict[j]

%o return count # _Chai Wah Wu_, Jun 06 2017

%Y Cf. A000189, A047726, A060839, A063454, A074243, A087412, A087786, A254073, A276919.

%K nonn,mult

%O 1,2

%A _José María Grau Ribas_, Sep 22 2016