# Sum of first K primes is triangle number

I was reading something this morning and came across the fact that 28 is both the sum of the first five prime numbers and of the first seven natural numbers. Naturally, I then tried to find other numbers U such that for some integers n and k $$U=\sum_{a=1}^{n}a=\sum_{a=1}^{k}p_a$$ I quickly noticed that 10 is both the sum of the first four natural numbers and of the first three prime numbers, but that I couldn't find any others off the top of my head. After sitting at a computer, I found that the next such number is 133386, which is the sum of the first 516 natural numbers and of the first 217 prime numbers. There were no other examples that for which $$k\leq1000$$.

Before sitting at the computer, I hypothesized that there were no other examples, and tried to go about proving it. Based on the fact that the sum of the first n natural numbers is $$\frac{n(n+1)}{2}$$, I was able to proceed: $$\frac{n(n+1)}{2}=U$$ $$n^2+n-2U=0$$ $$n=\frac{-1+\sqrt{1+8U}}{2}$$

Is there any way of proceeding past this point, either proving that there are infinitely many numbers k that $$1+8\sum_{a=1}^{k}p_a$$ is a perfect square or that there are only a finite number that fulfill this criterion?

• The first five $n$ such that $\frac{n(n+1)}{2}$ is the sum of the first $k$ prime numbers (for some $k$) are $4,7,516,2904,328777$. I haven't determined the corresponding $k$ (for the last two). I'd expect those aren't all, but no idea how one might go about proving such things (and I don't know whether to expect infinitely many). – Daniel Fischer Jun 13 '20 at 21:10
• One thing can be considered by looking at the last digit.The sum of those primes couldnot end with 2,4,7,9 for the expression to be square of something. – user-492177 Jun 13 '20 at 21:44

You noted that $$10$$, $$28$$, and $$133386$$ were the first three numbers that were initial sums both of primes and of naturals. We can then search Sloane's (the On-line Encyclopedia of Integer Sequences) for those terms and get A066527.
That page reveals that the next terms are $$4218060$$, $$54047322253$$, $$14756071005948636$$, $$600605016143706003$$, $$41181981873797476176$$, $$240580227206205322973571$$, and $$1350027226921161196478736$$. And since the keyword "more" is listed on the page, it is thought that there are likely more numbers like this to be found, but no proof is given/referenced.
The next term, if it exists, is greater than $$6640510710493148698166596$$ according to the late Donovan Johnson.
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 18, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}