The first two positive integers n for which 1 + 2 + ... + n is a perfect square are 1 and 8. What are the next two?
a=1;b=1;d=0;c=a+b;d=d+b;e=2#d;printb,e;b++;if(b<300, goto3, 0)
n Perfect Square
1 1(1)
8 36(6)
49 1,225(35)
288 41,616(204)
The first two positive integers \(n\) for which \(1 + 2 + \ldots + n\) is a perfect square are \(1\) and \(8\).
What are the next two?
Definition:
\(\text{Triangular numbers: $a(n) = \dbinom{n+1}{2} =\dfrac{ n(n+1)}{2} = 1 + 2 +3+4+ \ldots + n$. }\\\\ 1, 3, 6, 10, 15, 21, 28, 36,\ldots \)
\(\text{$a(m)$-th triangular number is a square: $\\\mathbf{a(m+1) = 6*a(m)-a(m-1)+2}$, with $a(1) = 1$, $a(2) = 8$. } \\\\ 1, 8, 49, 288, 1681, 9800, 57121, 332928, \ldots \)
Example:
\(\begin{array}{|c|r|r|r|} \hline & a(m+1) & & s_n \\ m+1 & = 6*a(m)-a(m-1)+2 & n & = \dfrac{ n(n+1)}{2} \\ \hline 3 & 6*a(2)-a(1)+2 \\ & = 6*8-1+2 \\ & = 49 & 49 & 35^2 \\\\ \hline 4 & 6*a(3)-a(2)+2 \\ & 6*49-8 +2 \\ & 288 & 288 & 204^2 \\\\ \hline 5 & 6*a(4)-a(3)+2 \\ & 6*288-49 +2 \\ & 1681 & 1681 & 1189^2 \\\\ \hline \ldots \\ \hline \end{array} \)
The next two positive integers n are 49 and 288.