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.

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

Original entry on oeis.org

11, 14, 18, 19, 22, 23, 27, 28, 32, 33, 38, 39, 41, 44, 45, 47, 51, 52, 54, 58, 59, 61, 66, 67, 69, 71, 74, 75, 77, 79, 83, 84, 86, 88, 92, 93, 95, 97, 102, 103, 105, 107, 112, 113, 115, 117, 123, 124, 126, 128, 134, 135, 137, 139, 146, 147, 149
Offset: 1

Views

Author

Mark E. Shoulson, Aug 14 2014

Keywords

Comments

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.

Examples

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

Programs

  • Mathematica
    Select[Range[200],PrimeQ[ Mod[#,Floor[Sqrt[#]]]]&] (* Harvey P. Dale, May 31 2019 *)
  • PARI
    for(n=1, 10^3, if(isprime(n%sqrtint(n)), print1(n", "))) \\ Jens Kruse Andersen, Aug 16 2014
  • Python
    from sympy import isprime
    from math import sqrt, floor
    from itertools import count
    sequence = ( for  in count(1) if isprime( % floor(sqrt())))
    print([next(sequence) for i in range(50)])
    

Extensions

Added alternative formulation in comment.