Please give the next 4 terms of this sequence. Thanks for any help:
2, 4, 7, 10, 15, 18, 23, 26............640 (is 100th term)
We need the prime number table
\(\text{The prime numbers. }\\ \begin{array}{|r|r||r|r|||r|r|||r|r|||r|r||r|r|} \hline n & p(n) & n & p(n) & n & p(n)& n & p(n)& n & p(n)& n & p(n) \\ \hline 1 & 2 &21 & 73 &41 & 179 & 61 & 283 &81 & 419 & 101 & 547 \\ 2 & 3 &22 & 79 &42 & 181 & 62 & 293 &82 & 421 & \cdots & \cdots \\ 3 & 5 &23 & 83 &43 & 191 & 63 & 307 &83 & 431 & \cdots & \cdots \\ 4 & 7 &24 & 89 &44 & 193 & 64 & 311 &84 & 433 & \cdots & \cdots \\ 5 & 11 &25 & 97 &45 & 197 & 65 & 313 &85 & 439 & \cdots & \cdots \\ 6 & 13 &26 & 101 &46 & 199 & 66 & 317 &86 & 443 & \cdots & \cdots \\ 7 & 17&27 & 103 &47 & 211 & 67 & 331 &87 & 449 & \cdots & \cdots \\ 8 & 19 &28 & 107 &48 & 223 & 68 & 337 &88 & 457 & \cdots & \cdots \\ 9 & 23 &29 & 109 &49 & 227 & 69 & 347 &89 & 461 & \cdots & \cdots \\ 10 & 29&30 & 113 &50 & 229 & 70 & 349 &90 & 463 & \cdots & \cdots \\ 11 & 31& 31 & 127& 51 & 233& 71 & 353 &91 & 467 & \cdots & \cdots \\ 12 & 37&32 & 131 &52 & 239 & 72 & 359 &92 & 479 & \cdots & \cdots \\ 13 & 41& 33 & 137 &53 & 241& 73 & 367 &93 & 487 & \cdots & \cdots \\ 14 & 43& 34 & 139 &54 & 251& 74 & 373 &94 & 491 & \cdots & \cdots \\ 15 & 47& 35 & 149 &55 & 257& 75 & 379 &95 & 499 & \cdots & \cdots \\ 16 & 53& 36 & 151 &56 & 263& 76 & 383 &96 & 503 & \cdots & \cdots \\ 17 & 59& 37 & 157 &57 & 269& 77 & 389 &97 & 509 & \cdots & \cdots \\ 18 & 61& 38 & 163 &58 & 271& 78 & 397 &98 & 521 & \cdots & \cdots \\ 19 & 67& 39 & 167 &59 & 277& 79 & 401 &99 & 523 & \cdots & \cdots \\ 20 & 71& 40 & 173 &60 & 281& 80 & 409 &100 & 541 & \cdots & \cdots \\ \hline \end{array} \)
The formula is \(\boxed{~ a_n = a_{n-1} + p(n) -p(n-1) +1 \qquad n \ge 2 \qquad a_1 = 2 ~}\)
\(\begin{array}{lcl} a_1 &=& 2 \\ \hline a_2 &=& a_{1} + p(2) -p(1) +1 \\ &=& 2 +3-2+1 \\ &=& 4 \\ \hline a_3 &=& a_{2} + p(3) -p(2) +1 \\ &=& 4 +5-3+1 \\ &=& 7 \\ \hline a_4 &=& a_{3} + p(4) -p(3) +1 \\ &=& 7 +7-5+1 \\ &=& 10 \\ \hline a_5 &=& a_{4} + p(5) -p(4) +1 \\ &=& 10 +11-7+1 \\ &=& 15 \\ \hline a_6 &=& a_{5} + p(6) -p(5) +1 \\ &=& 15 +13-11+1 \\ &=& 18 \\ \hline a_7 &=& a_{6} + p(7) -p(6) +1 \\ &=& 18 +17-13+1 \\ &=& 23 \\ \hline a_8 &=& a_{7} + p(8) -p(7) +1 \\ &=& 23 +19-17+1 \\ &=& 26 \\ \hline \hline a_9 &=& a_{8} + p(9) -p(8) +1 \\ &=& 26 +23-19+1 \\ &=& 31 \\ \hline a_{10} &=& a_{9} + p(10) -p(9) +1 \\ &=& 31 +29-23+1 \\ &=& 38 \\ \hline a_{11} &=& a_{10} + p(11) -p(10) +1 \\ &=& 38 +31-29+1 \\ &=& 41 \\ \hline a_{12} &=& a_{11} + p(12) -p(11) +1 \\ &=& 41 +37-31+1 \\ &=& 48 \\ \hline \cdots \\ \hline a_{100} &=& a_{99} + p(100) -p(99) +1 \\ &=& 621 +541-523+1 \\ &=& 640 \\ \hline \end{array} \)
\(a_1 \cdots a_{50}\\ \begin{array}{|r|r||r|r|||r|r|||r|r|||r|r|} \hline n & a(n) & n & a(n) & n & a(n)& n & a(n)& n & a(n)\\ \hline 1 & 2 & 11 & 41 & 21 & 93 &31 & 157 &41 & 219\\ 2 & 4 & 12 & 48 & 22 & 100 &32 & 162&42 & 222\\ 3 & 7 & 13 & 53 & 23 & 105 &33 & 169&43 & 233\\ 4 & 10 & 14 & 56 & 24 & 112 &34 & 172&44 & 236\\ 5 & 15 & 15 & 61 & 25 & 121 &35 & 183&45 & 241\\ 6 & 18 & 16 & 68 & 26 & 126 &36 & 186&46 & 244\\ 7 & 23 & 17 & 75 & 27 & 129 &37 & 193&47 & 257\\ 8 & 26 & 18 & 78 & 28 & 134 &38 & 200&48 & 270\\ 9 & 31 & 19 & 85 & 29 & 137 &39 & 205&49 & 275\\ 10 & 38 & 20 & 90 & 30 & 142 &40 & 212&50 & 278\\ \hline \end{array} \)
\(a_{51} \cdots a_{101}\\ \begin{array}{|r|r||r|r|||r|r|||r|r|||r|r||r|r|} \hline n & a(n) & n & a(n) & n & a(n)& n & a(n)& n & a(n)& n & a(n) \\ \hline 51 & 283 &61 & 343&71 & 423&81 & 499&91 & 557&101 & 647 \\ 52 & 290 &62 & 354&72 & 430&82 & 502&92 & 570&\cdots & \cdots \\ 53 & 293 &63 & 369&73 & 439&83 & 513&93 & 579&\cdots & \cdots \\ 54 & 304 &64 & 374&74 & 446&84 & 516&94 & 584&\cdots & \cdots \\ 55 & 311 &65 & 377&75 & 453&85 & 523&95 & 593&\cdots & \cdots \\ 56 & 318 &66 & 382&76 & 458&86 & 528&96 & 598&\cdots & \cdots \\ 57 & 325 &67 & 397&77 & 465&87 & 535&97 & 605&\cdots & \cdots \\ 58 & 328 &68 & 404&78 & 474&88 & 544&98 & 618&\cdots & \cdots \\ 59 & 335 &69 & 415&79 & 479&89 & 549&99 & 621&\cdots & \cdots \\ 60 & 340 &70 & 418&80 & 488&90 & 552&100 & 640&\cdots & \cdots \\ \hline \end{array} \)