login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A182158 Number of solutions to x^2 + x + y + y^2 == 1 mod n. 1
1, 0, 1, 0, 4, 0, 8, 0, 0, 0, 12, 0, 12, 0, 4, 0, 16, 0, 20, 0, 8, 0, 24, 0, 20, 0, 0, 0, 28, 0, 32, 0, 12, 0, 32, 0, 36, 0, 12, 0, 40, 0, 44, 0, 0, 0, 48, 0, 56, 0, 16, 0, 52, 0, 48, 0, 20, 0, 60, 0, 60, 0, 0, 0, 48, 0, 68, 0, 24, 0, 72, 0, 72, 0, 20, 0, 96, 0 (list; graph; refs; listen; history; text; internal format)
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

Sequence in context: A200501 A141433 A019111 * A103554 A261278 A222609

Adjacent sequences:  A182155 A182156 A182157 * A182159 A182160 A182161

KEYWORD

nonn,mult

AUTHOR

José María Grau Ribas, Apr 15 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 24 01:16 EST 2020. Contains 332195 sequences. (Running on oeis4.)