OFFSET
1,2
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..10000
FORMULA
From Andrew Howroyd, Jul 17 2018: (Start)
a(p^e) = p^e for p prime and p mod 3 = 2.
Conjecture: a(3^e) = 2*3^e for e > 1.
a(p^e) = p^(e-1)*(p - 1 + Sum_{b=1..p-1} Legendre(12*b^(-1) - 3*b^2, p)) for p prime and p <> 3.
The final formula arises from factoring x^3 + y^3 as (x + y)*(x*2 - x*y + y^2), then substituting b = x + y and counting the solutions to the resulting quadratic equation 3*x^2 - 3*b*x + b^2 == b^(-1) (mod p) for each nonzero value of b. (End)
MATHEMATICA
a[n_] := Module[{v = Table[0, {n}]}, For[i = 0, i <= n-1, i++, v[[Mod[i^3, n] + 1]]++]; Sum[v[[i+1]] v[[Mod[1-i, n] + 1]], {i, 0, n-1}]];
a /@ Range[1, 60] (* Jean-François Alcover, Sep 17 2019, after Andrew Howroyd *)
PROG
(PARI) a(n) = {nb = 0; for (x = 0, n-1, for (y = 0, n-1, if (Mod(x^3, n) + Mod(y^3, n) == Mod(1, n), nb++); ); ); nb; } \\ Michel Marcus, Aug 06 2013
(PARI) a(n)={my(v=vector(n)); for(i=0, n-1, v[i^3%n + 1]++); sum(i=0, n-1, v[i+1]*v[(1-i)%n + 1])} \\ Andrew Howroyd, Jul 17 2018
CROSSREFS
KEYWORD
mult,nonn
AUTHOR
Yuval Dekel (dekelyuval(AT)hotmail.com), Oct 21 2003
EXTENSIONS
More terms from Michel Marcus, Aug 06 2013
STATUS
approved