login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A065988 a(n) is the largest prime p < n such that n mod p is a perfect square; a(n) = 0 if no such prime exists. 1

%I #11 Apr 23 2022 18:28:54

%S 0,0,2,3,2,5,3,7,5,5,7,11,3,13,11,5,13,17,5,19,17,13,19,23,7,17,23,19,

%T 7,29,11,31,29,17,31,7,11,37,23,31,37,41,17,43,41,37,43,47,7,41,47,43,

%U 37,53,23,47,53,29,43,59,19,61,59,11,61,41,29,67,53,61,67,71,37,73,71

%N a(n) is the largest prime p < n such that n mod p is a perfect square; a(n) = 0 if no such prime exists.

%H Harry J. Smith, <a href="/A065988/b065988.txt">Table of n, a(n) for n = 1..1000</a>

%t lp[n_]:=Module[{p=Prime[PrimePi[n]]},p=If[p==n,NextPrime[p,-1],p];While[ !IntegerQ[ Sqrt[Mod[n,p]]],p=NextPrime[p,-1]];p]; Join[{0,0},Array[lp,80,3]] (* _Harvey P. Dale_, Apr 23 2022 *)

%o (PARI) { for (n=1, 1000, p=precprime(n - 1);; while (p > 0 && !issquare(n%p), p=precprime(p - 1)); write("b065988.txt", n, " ", p) ) } \\ _Harry J. Smith_, Nov 05 2009

%K nonn

%O 1,3

%A _Reinhard Zumkeller_, Dec 10 2001

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 17 23:23 EDT 2024. Contains 371767 sequences. (Running on oeis4.)