OFFSET
1,1
REFERENCES
David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989, p. 103.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
FORMULA
For n squarefree and negative, a(n) = n if n == 1 (mod 4), otherwise a(n) = 4n.
MATHEMATICA
max = 56; j = 1; Do[ If[ SquareFreeQ[n], v[j] = n; j = j+1], {n, 1, 2*max}]; Do[ a[n] = -v[n]*If[Mod[v[n], 4] == 3, 1, 4], {n, 1, j-1}]; Table[a[n], {n, 1, max}] (* Jean-François Alcover, Oct 18 2011, after PARI *)
PROG
(PARI) bnd = 1000; L = vector(bnd); j = 1; for (i=1, bnd, if(issquarefree(i), L[j]=i:j=j+1)); M = vector(j-1); for (i=1, j-1, M[i]=if((L[i]%4==3), -L[i], -4*L[i])); M
CROSSREFS
KEYWORD
sign,easy,nice
AUTHOR
STATUS
approved