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 A267140 #14 Aug 15 2021 12:12:04 %S A267140 1,35,12,72,180,336,45,792,1092,208,1836,2280,112,315,3900,4536,644, %T A267140 5952,6732,7560,225,715,10332,627,12420,13536,924,1575,17172,840,396, %U A267140 21240,22692,3267,2565,27336,28980,3392,32412,34200,1881,3795,637,1400,1785,45936,2240 %N A267140 Least m>0 for which m + n^2 is a square and m + triangular(n) is a triangular number (A000217). %C A267140 For n>1, a(n) <= b(n), where b(n) = 24*n^2 - 60*n + 36 = A143698(n-1), because b(n) + n^2 = (5*n-6)^2, and b(n) + n*(n+1)/2 = (7*n-9)*(7*n-8)/2 = triangular(7*n-9). %H A267140 Chai Wah Wu, <a href="/A267140/b267140.txt">Table of n, a(n) for n = 0..10000</a> %e A267140 12 + 2^2 = 16 is a square, and 12 + 2*3/2 = 15 is a triangular number, and 12 is the least such integer, so a(2)=12. %t A267140 lmst[n_]:=Module[{m=1,n2=n^2,nt=(n(n+1))/2},While[ !IntegerQ[Sqrt[ m+n2]] || !OddQ[Sqrt[1+8(m+nt)]],m++];m]; Join[{1},Array[lmst,50]] (* _Harvey P. Dale_, Aug 15 2021 *) %o A267140 (PARI) a(n) = {m = 1; while (! (issquare(m+n^2) && ispolygonal(m+n*(n+1)/2, 3)), m++); m;} \\ _Michel Marcus_, Jan 11 2016 %o A267140 (Python) %o A267140 from math import sqrt %o A267140 def A267140(n): %o A267140 u,r,k,m = 2*n+1,4*n*(n+1)+1,0,2*n+1 %o A267140 while True: %o A267140 if int(sqrt(8*m+r))**2 == 8*m+r: %o A267140 return m %o A267140 k += 2 %o A267140 m += u + k # _Chai Wah Wu_, Jan 13 2016 %Y A267140 Cf. A000217, A000290, A143698, A267077. %K A267140 nonn %O A267140 0,2 %A A267140 _Alex Ratushnyak_, Jan 10 2016