OFFSET
1,3
FORMULA
a(n) = A337769(n) - 1.
a(n) ~ sqrt(2)*n/sqrt(log n). - Charles R Greathouse IV, Apr 18 2022
a(n) = A350174(n^2). - Kevin Ryde, Apr 19 2022
PROG
(Python)
from sympy import prime
def a(n):
k = 1
total = 0
while True:
total += prime(k)
if total > n**2:
break
k += 1
return k-1
(PARI) first(N)=my(v=vector(N), s, k, n=1, n2=1); forprime(p=2, , s+=p; k++; while(s>n2, v[n]=k-1; if(n++>N, return(v)); n2=n^2)) \\ Charles R Greathouse IV, Apr 18 2022
(PARI) a(n)=my(n2=n^2, s, k); forprime(p=2, , s+=p; k++; if(s>n2, return(k-1))) \\ Charles R Greathouse IV, Apr 18 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Joelle H. Kassir, Apr 17 2022
STATUS
approved