login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A105612 Number of nonzero quadratic residues (mod n) (cf. A000224). 5
0, 1, 1, 1, 2, 3, 3, 2, 3, 5, 5, 3, 6, 7, 5, 3, 8, 7, 9, 5, 7, 11, 11, 5, 10, 13, 10, 7, 14, 11, 15, 6, 11, 17, 11, 7, 18, 19, 13, 8, 20, 15, 21, 11, 11, 23, 23, 7, 21, 21, 17, 13, 26, 21, 17, 11, 19, 29, 29, 11, 30, 31, 15, 11, 20, 23, 33, 17, 23, 23, 35, 11, 36, 37, 21, 19, 23 (list; graph; refs; listen; history; internal format)
OFFSET

1,5

REFERENCES

E. J. F. Primrose, The number of quadratic residues mod m, Math. Gaz. v. 61 (1977) n. 415, 60-61.

W. D. Stangl, Counting squares in Z_n, Math. Mag. 69 (1996) 285-289.

LINKS

S. R. Finch and Pascal Sebah, Squares and Cubes Modulo n (arXiv:math.NT/0604465).

Eric Weisstein's World of Mathematics, Quadratic Residue

MATHEMATICA

a[n_]:=Count[Union[Mod[Range[Floor[n/2]]^2, n]], _?Positive]; Table[a[n], {n, 1, 80}] (* Jean-François Alcover,  Feb 09 2011 *)

PROG

Contribution from Michael B. Porter (michael_b_porter(AT)yahoo.com), May 04 2010: (Start)

(PARI) /* based on code by Franklin T. Adams-Watters, see A000224 */

A105612(n)={local(v, i); v=vector(n, i, 0); for(i=0, floor(n/2), v[i^2%n+1]=1); sum(i=2, n, v[i])} (End)

CROSSREFS

a(n)=A000224(n)-1

Sequence in context: A002963 A046677 A109747 * A141744 A089783 A090414

Adjacent sequences:  A105609 A105610 A105611 * A105613 A105614 A105615

KEYWORD

nonn

AUTHOR

Eric Weisstein (eric(AT)weisstein.com), Apr 15, 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 16 14:37 EST 2012. Contains 205930 sequences.