cp's OEIS Frontend

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.

A144294 Let k = n-th nonsquare = A000037(n); then a(n) = smallest prime p such that k is not a square mod p.

This page as a plain text file.
%I A144294 #12 Oct 21 2024 03:03:44
%S A144294 3,5,3,7,5,3,7,3,5,5,3,13,3,5,7,3,11,5,3,7,3,5,5,3,11,7,3,5,7,3,5,3,
%T A144294 11,7,3,5,5,3,7,11,3,5,3,11,5,3,7,7,3,5,5,3,13,7,3,5,3,7,5,3,7,13,3,5,
%U A144294 5,3,7,7,3,5,11,3,5,3,11,11,3,5,5,3,7,17,3,5,7,3,7,5,3,13
%N A144294 Let k = n-th nonsquare = A000037(n); then a(n) = smallest prime p such that k is not a square mod p.
%C A144294 In a posting to the Number Theory List, Oct 15 2008, Kurt Foster remarks that a positive integer M is a square iff M is a quadratic residue mod p for every prime p which does not divide M. He then asks how fast the present sequence grows.
%H A144294 Charles R Greathouse IV, <a href="/A144294/b144294.txt">Table of n, a(n) for n = 1..10000</a>
%p A144294 with(numtheory); f:=proc(n) local M,i,j,k; M:=100000; for i from 2 to M do if legendre(n,ithprime(i)) = -1 then RETURN(ithprime(i)); fi; od; -1; end;
%o A144294 (PARI) a(n)=my(k=n+(sqrtint(4*n)+1)\2); forprime(p=2,, if(!issquare(Mod(k,p)), return(p))) \\ _Charles R Greathouse IV_, Aug 28 2016
%o A144294 (Python)
%o A144294 from math import isqrt
%o A144294 from sympy.ntheory import nextprime, legendre_symbol
%o A144294 def A144294(n):
%o A144294     k, p = n+(m:=isqrt(n))+(n>=m*(m+1)+1), 2
%o A144294     while (p:=nextprime(p)):
%o A144294         if legendre_symbol(k,p)==-1:
%o A144294             return p # _Chai Wah Wu_, Oct 20 2024
%Y A144294 For records see A144295, A144296. See A092419 for another version.
%K A144294 nonn
%O A144294 1,1
%A A144294 _N. J. A. Sloane_, Dec 03 2008