cp's OEIS Frontend

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.

A232608 Triangular numbers t such that distances from t to three nearest squares are three triangular numbers.

This page as a plain text file.
%I A232608 #15 Jan 25 2025 13:55:26
%S A232608 1,10,15,253,325,11026,237016,8439886,1119946128
%N A232608 Triangular numbers t such that distances from t to three nearest squares are three triangular numbers.
%C A232608 Triangular numbers in A232501.
%o A232608 (C)
%o A232608 #include <stdio.h>
%o A232608 #include <math.h>
%o A232608 typedef unsigned long long U64;
%o A232608 int isTriang(U64 x) {
%o A232608     x+=x;
%o A232608     U64 r = sqrt(x);
%o A232608     return (r*(r+1)==x);
%o A232608 }
%o A232608 int main() {
%o A232608   for (U64 n=0, i=0; i < (1ULL<<32); ++i) {
%o A232608     U64 s, d, d1, d2, d3;
%o A232608     s = sqrt(n+=i);
%o A232608     d1 = n - s*s;
%o A232608     if (!isTriang(d1)) continue;
%o A232608     d2 = (s+1)*(s+1) - n;
%o A232608     if (!isTriang(d2)) continue;
%o A232608     d3 = (s+2)*(s+2) - n;
%o A232608     if (s) {
%o A232608         d = n - (s-1)*(s-1);
%o A232608         if (d < d3)  d3 = d;
%o A232608     }
%o A232608     if (isTriang(d3))   printf("%llu, ", n);
%o A232608   }
%o A232608 }
%o A232608 (Haskell)
%o A232608 a232608 n = a232608_list !! (n-1)
%o A232608 a232608_list = filter f $ tail a000217_list where
%o A232608    f x = all ((== 1) . a010054) $ init $ sort $
%o A232608          map (abs . (x -) . (^ 2) . (+ (a000196 x))) [-1..2]
%o A232608 -- _Reinhard Zumkeller_, Mar 16 2014
%Y A232608 Cf. A000217, A000290, A232501.
%Y A232608 Cf. A000196, A010054.
%K A232608 nonn,hard,more
%O A232608 1,2
%A A232608 _Alex Ratushnyak_, Feb 23 2014