Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A130291
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A130291 Number of quadratic residues (including 0) modulo the n-th prime. +0
3
2, 2, 3, 4, 6, 7, 9, 10, 12, 15, 16, 19, 21, 22, 24, 27, 30, 31, 34, 36, 37, 40, 42, 45, 49, 51, 52, 54, 55, 57, 64, 66, 69, 70, 75, 76, 79, 82, 84, 87, 90, 91, 96, 97, 99, 100, 106, 112, 114, 115, 117, 120, 121, 126, 129, 132, 135, 136, 139, 141, 142, 147, 154, 156, 157 (list; graph; listen)
OFFSET

1,1

COMMENT

The number of squares (quadratic residues including 0) modulo a prime p (sequence A096008 with every "1" prefixed by a "0") equals 1+floor(p/2), or ceiling(p/2) = (p+1)/2 if p is odd. (In fields of characteristic 2, all elements are squares.) See A130290(n)=A130291(n)-1 for number of nozero residues. For all n>0, A130291(n+1) = A111333(n+1) = A006254(n) = A005097(n)-1 = A102781(n+1)-1 = A111332(n+1)-1 = A130290(n+1)-1.

LINKS

Eric Weisstein's World of Mathematics, Quadratic Residue

Wikipedia, Quadratic Residue

FORMULA

a(n) = floor( A000040(n)/2 )+1

EXAMPLE

a(1)=2 since both elements of Z/2Z are squares.

a(3)=0 since 0=0^2, 1=1^2=(-1)^2 and 4=2^2=(-2)^2 are squares in Z/5Z.

a(1000000) = 7742932 = (p[1000000]+1)/2.

PROGRAM

(PARI) A130291(n) = 1+prime(n)>>1

CROSSREFS

Essentially the same as A006254.

Cf. A005097 (Odd primes - 1)/2, A102781 (Integer part of n#/(n-2)#/2#), A111332 (Number of even numbers less than the n-th prime), A063987 (quadratic residues modulo the n-th prime), A006254 (Numbers n such that 2n-1 is prime), A111333 (Number of odd numbers <= n-th prime), A000040 (prime numbers), A130290 (number of nonzero residues modulo primes).

Adjacent sequences: A130288 A130289 A130290 this_sequence A130292 A130293 A130294

Sequence in context: A011868 A145813 A039859 this_sequence A067835 A029011 A077117

KEYWORD

easy,nonn

AUTHOR

M. F. Hasler (Maximilian.Hasler(AT)gmail.com), May 21 2007

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified January 8 02:43 EST 2009. Contains 152824 sequences.


AT&T Labs Research