OFFSET
1,5
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
MATHEMATICA
a[1]=1; a[n_]:=Length@Rest@Union@Flatten@Table[If[Mod[i^2+i+ j +j^2 , n]==1, i+I j, 0], {i, 0, n-1}, {j, 0, n-1}]; Table[a[n], {n, 1, 98}]
PROG
(PARI) a(n)=sum(x=1, n, sum(y=1, n, Mod(x^2+x+y+y^2, n)==1)) \\ Charles R Greathouse IV, Apr 16 2012
(PARI) A(n)=my(v=vecsort(vector(n, i, i^2+i)%n), u=vecsort(v, , 8), w=vector(#u), j=1); w[1]=1; for(i=2, #v, if(v[i]>v[i-1], j++); w[j]++); sum(i=2, #u, while(u[i]+u[j]>n+1, j--); if(u[i]+u[j]==n+1, w[i]*w[j]))+ if(#u>1&&u[2]==1, 2*w[1]*w[2])
a(n)=n=factor(n); prod(i=1, #n[, 1], A(n[i, 1]^n[i, 2])) \\ Charles R Greathouse IV, Apr 16 2012
(Magma) [n eq 1 select 1 else #[x: x in [1..n], y in [1..n] | (x^2+x+y+y^2) mod n eq 1]: n in [1..78]]; // Bruno Berselli, Apr 16 2012
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
José María Grau Ribas, Apr 15 2012
STATUS
approved