This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A214697 #33 Mar 21 2025 18:33:59 %S A214697 2,3,5,17,7,2,89,125,3,215,269,13,10,8,11,27,719,815,21,57,316,11,26, %T A214697 1517,17,1799,30,26,7,5,2609,11,2975,10,2,76,3779,1251,208,4445,115, %U A214697 4919,1045,5417,11,17,1205,6485,38,2860,7349,18,25,8267,8585,8909 %N A214697 Least k > 1 such that tri(n)+ ... + tri(n+k-1) is a triangular number. %C A214697 tri(n) = n*(n+1)/2 is the n-th triangular number, A000217(n). %C A214697 a(n) is how many consecutive triangular numbers starting from tri(n) are needed to sum up to tri(x) for some x. The requirement a(n) > 1 is needed, because otherwise all a(n) = 1. %C A214697 Because an oblong number (A002378) is twice a triangular number, this sequence is also the least k > 1 such that oblong(n) + ... + oblong(n+k-1) is an oblong number. %C A214697 a(n) is least k > 1 such that 12*k^3 + 36*n*k^2 + 36*k*n^2 - 12*k + 9 is a perfect square. - _Chai Wah Wu_, Mar 01 2016 %C A214697 a(n) <= 3*n^2 - 3*n - 1 for n > 1, since 12*k^3 + 36*n*k^2 + 36*k*n^2 - 12*k + 9 is a square when k = 3*n^2 - 3*n - 1. - _Robert Israel_, Mar 03 2016 %H A214697 Chai Wah Wu, <a href="/A214697/b214697.txt">Table of n, a(n) for n = 0..5000</a> %e A214697 0+1 = 1 is a triangular number, two summands, so a(0)=2. %e A214697 1+3+6 = 10 is a triangular number, three summands, so a(1)=3. %e A214697 3+6+10+15+21 = 55 is a triangular number, five summands, so a(2)=5. %e A214697 Starting from Triangular(5)=15: 15+21=36 is a triangular number, two summands, so a(5)=2. %p A214697 f:= proc(n) local k; %p A214697 for k from 2 do if issqr(12*k^3+36*k^2*n+36*k*n^2-12*k+9) then return k fi od %p A214697 end proc: %p A214697 map(f, [$0..100]); # _Robert Israel_, Mar 03 2016 %t A214697 triQ[n_] := IntegerQ[Sqrt[1+8*n]]; Table[k = n+1; s = k^2; While[! triQ[s], k++; s = s + k*(k+1)/2]; k - n + 1, {n, 0, 55}] (* _T. D. Noe_, Jul 26 2012 *) %o A214697 (Python) %o A214697 for n in range(77): %o A214697 i = ti = n %o A214697 sum = 0 %o A214697 tn_gte_sum = 0 # least oblong number >= sum %o A214697 while i-n<=1 or tn_gte_sum!=sum: %o A214697 sum += i*(i+1) %o A214697 i+=1 %o A214697 while tn_gte_sum<sum: %o A214697 tn_gte_sum = ti*(ti+1) %o A214697 ti+=1 %o A214697 print(i-n, end=', ') %o A214697 (Python) %o A214697 from math import sqrt %o A214697 def A214697(n): %o A214697 k, a1, a2, m = 2, 36*n, 36*n**2 - 12, n*(72*n + 144) + 81 %o A214697 while int(round(sqrt(m)))**2 != m: %o A214697 k += 1 %o A214697 m = k*(k*(12*k + a1) + a2) + 9 %o A214697 return k # _Chai Wah Wu_, Mar 01 2016 %Y A214697 Cf. A000217, A000292, A214648, A214696. %K A214697 nonn,look %O A214697 0,1 %A A214697 _Alex Ratushnyak_, Jul 26 2012