This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A130291 #13 Feb 16 2025 08:33:06 %S A130291 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, %T A130291 51,52,54,55,57,64,66,69,70,75,76,79,82,84,87,90,91,96,97,99,100,106, %U A130291 112,114,115,117,120,121,126,129,132,135,136,139,141,142,147,154,156,157 %N A130291 Number of quadratic residues (including 0) modulo the n-th prime. %C A130291 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 nonzero residues. For all n>0, A130291(n+1) = A111333(n+1) = A006254(n) = A005097(n)-1 = A102781(n+1)-1 = A102781(n+1)-1 = A130290(n+1)-1. %H A130291 Vincenzo Librandi, <a href="/A130291/b130291.txt">Table of n, a(n) for n = 1..1000</a> %H A130291 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/QuadraticResidue.html">Quadratic Residue</a> %H A130291 Wikipedia, <a href="http://en.wikipedia.org/wiki/Quadratic_residue">Quadratic Residue</a> %F A130291 a(n) = floor( A000040(n)/2 )+1 %e A130291 a(1)=2 since both elements of Z/2Z are squares. %e A130291 a(3)=0 since 0=0^2, 1=1^2=(-1)^2 and 4=2^2=(-2)^2 are squares in Z/5Z. %e A130291 a(1000000) = 7742932 = (p[1000000]+1)/2. %t A130291 Quotient[Prime[Range[200]], 2] + 1 (* _Vincenzo Librandi_, Jan 16 2013 *) %o A130291 (PARI) A130291(n) = 1+prime(n)>>1 %o A130291 (Magma) [Floor((NthPrime(n))/2)+1: n in [1..60]]; // _Vincenzo Librandi_, Jan 16 2013 %Y A130291 Essentially the same as A006254. %Y A130291 Cf. A005097 (Odd primes - 1)/2, A102781 (Integer part of n#/(n-2)#/2#), A102781 (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). %K A130291 easy,nonn %O A130291 1,1 %A A130291 _M. F. Hasler_, May 21 2007