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 A292310 #37 Jun 25 2023 05:44:23 %S A292310 3,21,28,36,78,105,153,171,190,210,253,325,351,378,465,528,666,703, %T A292310 903,946,990,1035,1128,1176,1275,1378,1485,1540,1596,1653,1711,1770, %U A292310 1891,1953,2278,2346,2556,2628,2775,2926,3003,3081,3160,3403,3570,3741,3828,4095,4186,4278,4371,4656 %N A292310 Triangular numbers that are equidistant from two other triangular numbers. %C A292310 Triangular numbers which are the arithmetic mean of two other triangular numbers. - _R. J. Mathar_, Oct 01 2017 %F A292310 a(n) = A292309(n)/3. %e A292310 3 is in the sequence because 0 = A000217(0), 6 = A000217(3), and the distances from 3 to 0 and 3 to 6 are the same. %e A292310 153 is in the sequence because 153 = A000217(17), 6 = A000217(2), 300 = A000217(24), and the two distances 300-153 = 153-6 = 147 are the same. %p A292310 isA292310 := proc(n) %p A292310 local ilow ; %p A292310 if isA000217(n) then %p A292310 for ilow from 0 do %p A292310 tilow := A000217(ilow) ; %p A292310 if tilow >= n then %p A292310 return false ; %p A292310 elif isA000217(2*n-tilow) then %p A292310 return true ; %p A292310 end if; %p A292310 end do: %p A292310 else %p A292310 false; %p A292310 end if; %p A292310 end proc: %p A292310 for n from 1 to 5000 do %p A292310 if isA292310(n) then %p A292310 printf("%d,",n) ; %p A292310 end if; %p A292310 end do: # _R. J. Mathar_, Oct 01 2017 %t A292310 Module[{t = 3, k = 2, i, e, v}, Reap[While[t <= 6000, i = k; e = 0; v = t + i; While[i > 0 && e == 0, If[IntegerQ@Sqrt[8v + 1], e = 1; Sow[t]]; i--; v += i]; k++; t += k]][[2, 1]]] (* _Jean-François Alcover_, Jun 25 2023, after first PARI code *) %o A292310 (PARI) t=3; k=2; while(t<=6000, i=k; e=0; v=t+i; while(i>0&&e==0, if(issquare(8*v+1), e=1; print1(t,", ")); i--; v+=i); k++; t+=k) %o A292310 (PARI) upto(n) = {my(t = 0, i = 0, triangulars = List([0]), res = List); while(t <= n, i++; t+=i; listput(triangulars, t)); for(i=2,#triangulars, tr = triangulars[i]<<1; for(j = 1, i-1, if(issquare(8 * (tr - triangulars[j]) + 1), listput(res, triangulars[i]); next(2)))); res} \\ _David A. Corneth_, Oct 04 2017 %Y A292310 Cf. A000217, A292309, A292313, A292314, A292316. %K A292310 nonn %O A292310 1,1 %A A292310 _Antonio Roldán_, Sep 14 2017 %E A292310 Term 105 added by _David A. Corneth_, Oct 04 2017