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!)
A242098 Numbers n such that the residue of n modulo floor(sqrt(n)) is prime. 1

%I #21 Mar 26 2023 15:56:46

%S 11,14,18,19,22,23,27,28,32,33,38,39,41,44,45,47,51,52,54,58,59,61,66,

%T 67,69,71,74,75,77,79,83,84,86,88,92,93,95,97,102,103,105,107,112,113,

%U 115,117,123,124,126,128,134,135,137,139,146,147,149

%N Numbers n such that the residue of n modulo floor(sqrt(n)) is prime.

%C Also, i^2+p(1), i^2+p(2),..., i^2+p(k), i^2+i+p(1), i^2+i+p(2),..., i^2+i+p(k), for i>=3, where p(n) is the n-th prime and p(k) is the largest prime strictly less than i.

%H Jens Kruse Andersen, <a href="/A242098/b242098.txt">Table of n, a(n) for n = 1..10000</a>

%e floor(sqrt(28)) = 5. 28 modulo 5 = 3, which is prime, so 28 is in the sequence.

%t Select[Range[200],PrimeQ[ Mod[#,Floor[Sqrt[#]]]]&] (* _Harvey P. Dale_, May 31 2019 *)

%o (Python)

%o from sympy import isprime

%o from math import sqrt, floor

%o from itertools import count

%o sequence = (_ for _ in count(1) if isprime(_ % floor(sqrt(_))))

%o print([next(sequence) for i in range(50)])

%o (PARI) for(n=1, 10^3, if(isprime(n%sqrtint(n)), print1(n", "))) \\ _Jens Kruse Andersen_, Aug 16 2014

%K nonn,easy

%O 1,1

%A _Mark E. Shoulson_, Aug 14 2014

%E Added alternative formulation in comment.

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 20 12:36 EDT 2024. Contains 371844 sequences. (Running on oeis4.)