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.

A230775 Smallest prime number greater than or equal to the square root of n.

Original entry on oeis.org

2, 2, 2, 2, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11
Offset: 1

Views

Author

Keywords

Comments

Or repeat prime(k) (prime(k)^2-prime(k-1)^2) times, with prime(0) set to 0 for k=1.

Examples

			a(5)=a(6)=a(7)=a(8)=a(9)=3 because prime(1)= 2 < sqrt(5 to 9) <= prime(2) = 3.
		

Crossrefs

Programs

  • Mathematica
    spn[n_]:=Module[{s=Sqrt[n]},If[PrimeQ[s],s,NextPrime[s]]]; Array[spn,90] (* Harvey P. Dale, Feb 10 2019 *)
  • Python
    from math import isqrt
    from sympy import nextprime
    def A230775(n): return nextprime(isqrt(n-1)) # Chai Wah Wu, Nov 04 2024

Formula

a(n) = A000040(A230774(n)).
Repeat prime(1) prime(1)^2 times; for k>1, repeat A000040(k) A050216(k-1) times (that is, repeat prime(k) (prime(k)^2 - prime(k-1)^2) times).