OFFSET
1,3
COMMENTS
a(n) is the product of the three cubic Gauss periods for the n-th prime q == 1 (mod 3).
REFERENCES
B. C. Berndt, R. J. Evans, and K. S. Williams, Gauss and Jacobi Sums, Wiley-Interscience, 1998, Theorem 2.5.1.
K. Ireland and M. Rosen, A Classical Introduction to Modern Number Theory, 2nd ed., Springer GTM 84, 1990, Chapters 8-9.
LINKS
Dao Van Tam, Table of n, a(n) for n = 1..10000
Dao Van Tam, Lean 4 formal verification
FORMULA
a(n) = ((c + 3)*q - 1)/27 where q = A002476(n), x and y are integers with q = x^2 + x*y + 7*y^2 and gcd(x,y) = 1, and c = 2*x + y with c == 1 (mod 3).
a(n) = (L^3 - 3*q*L + 3*q - 1)/27 where 4*q = L^2 + 27*M^2, L == 1 (mod 3), with L = 2*x + y (Berndt-Evans-Williams, Theorem 2.5.1).
EXAMPLE
a(1) = 1: q=7 = (0)^2+(0)*(1)+7*(1)^2, c = 2*(0)+1 = 1, ((1+3)*7-1)/27 = 1.
a(2) = -1: q=13 = (-3)^2+(-3)*(1)+7*(1)^2, c = 2*(-3)+1 = -5, ((-5+3)*13-1)/27 = -1.
a(3) = 7: q=19 = (4)^2+(4)*(-1)+7*(-1)^2, c = 2*(4)+(-1) = 7, ((7+3)*19-1)/27 = 7.
PROG
(PARI) e3(q) = for(b=-sqrtint(4*q\27)-1, sqrtint(4*q\27)+1, my(d=4*q-27*b^2, s); if(d>=0 && issquare(d, &s), for(j=0, 1, my(a=(-b+(-1)^j*s)/2); if(type(a)=="t_INT" && a^2+a*b+7*b^2==q && gcd(abs(a), abs(b))==1, my(c=2*a+b); if(c%3==1, return(((c+3)*q-1)/27)); if((-c)%3==1, return(((-c+3)*q-1)/27))))));
a(n) = my(cnt=0); forprime(q=7, +oo, if(q%3==1, cnt++; if(cnt==n, return(e3(q)))));
CROSSREFS
KEYWORD
sign
AUTHOR
Dao Van Tam, Mar 24 2026
STATUS
approved
