login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #27 Jul 18 2018 02:18:57

%S 1,4,9,16,25,36,90,64,162,100,121,144,252,360,225,256,289,648,468,400,

%T 810,484,529,576,625,1008,1458,1440,841,900,1143,1024,1089,1156,2250,

%U 2592,1602,1872,2268,1600,1681,3240,2115,1936,4050,2116,2209,2304,4410

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

%C It appears that a(n) = n^2 for n in A088232 (numbers n such that 3 does not divide phi(n)) and that a(n) != n^2 for n in A066498 (numbers n such that 3 divides phi(n)). - _Michel Marcus_, Mar 13 2015

%C It appears that a(p) != p^2 for primes in A002476 (primes of form 6m + 1). - _Michel Marcus_, Mar 13 2015

%H Chai Wah Wu, <a href="/A254073/b254073.txt">Table of n, a(n) for n = 1..10000</a>

%t a[n_] := Sum[ If[ Mod[x^3 + y^3 + z^3, n] == 1, 1, 0], {x, n}, {y, n}, {z, n}]; a[1]=1; Table[a[n], {n, 2,22}]

%o (PARI) a(n) = {nb = 0; for (x=1, n, for (y=1, n, for (z=1, n, if ((Mod(x^3,n) + Mod(y^3,n) + Mod(z^3,n)) % n == Mod(1, n), nb ++);););); nb;} \\ _Michel Marcus_, Mar 11 2015

%o (PARI) a(n)={my(p=Mod(sum(i=0, n-1, x^(i^3%n)), 1-x^n)^3); polcoeff(lift(p), 1%n)} \\ _Andrew Howroyd_, Jul 18 2018

%o (Python)

%o def A254073(n):

%o ndict = {}

%o for i in range(n):

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

%o if m in ndict:

%o ndict[m] += 1

%o else:

%o ndict[m] = 1

%o count = 0

%o for i in ndict:

%o ni = ndict[i]

%o for j in ndict:

%o k = (1-i-j) % n

%o if k in ndict:

%o count += ni*ndict[j]*ndict[k]

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

%Y Cf. A087412.

%K nonn,mult

%O 1,2

%A _José María Grau Ribas_, Jan 25 2015