OFFSET
1,2
COMMENTS
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
It appears that a(p) != p^2 for primes in A002476 (primes of form 6m + 1). - Michel Marcus, Mar 13 2015
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
MATHEMATICA
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}]
PROG
(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
(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
(Python)
def A254073(n):
ndict = {}
for i in range(n):
m = pow(i, 3, n)
if m in ndict:
ndict[m] += 1
else:
ndict[m] = 1
count = 0
for i in ndict:
ni = ndict[i]
for j in ndict:
k = (1-i-j) % n
if k in ndict:
count += ni*ndict[j]*ndict[k]
return count # Chai Wah Wu, Jun 06 2017
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
José María Grau Ribas, Jan 25 2015
STATUS
approved