OFFSET
1,1
COMMENTS
Or repeat prime(k) (prime(k)^2-prime(k-1)^2) times, with prime(0) set to 0 for k=1.
LINKS
Jean-Christophe Hervé, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
a(5)=a(6)=a(7)=a(8)=a(9)=3 because prime(1)= 2 < sqrt(5 to 9) <= prime(2) = 3.
MATHEMATICA
spn[n_]:=Module[{s=Sqrt[n]}, If[PrimeQ[s], s, NextPrime[s]]]; Array[spn, 90] (* Harvey P. Dale, Feb 10 2019 *)
PROG
(Python)
from math import isqrt
from sympy import nextprime
def A230775(n): return nextprime(isqrt(n-1)) # Chai Wah Wu, Nov 04 2024
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
Jean-Christophe Hervé, Nov 01 2013
STATUS
approved