Skip to main content
2 of 2
added 28 characters in body
Justin
  • 21.3k
  • 9
  • 67
  • 114

Ruby, 75 55 bytes

->n{a=[]
t=2
(a<<t if(2...t).all?{|i|t%i!=0}
t+=1)while !a[n-1]
a}

Works by trial division

Justin
  • 21.3k
  • 9
  • 67
  • 114