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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

1, 10, 15, 253, 325, 11026, 237016, 8439886, 1119946128
Offset: 1

Views

Author

Alex Ratushnyak, Feb 23 2014

Keywords

Comments

Triangular numbers in A232501.

Crossrefs

Programs

  • C
    #include 
    #include 
    typedef unsigned long long U64;
    int isTriang(U64 x) {
        x+=x;
        U64 r = sqrt(x);
        return (r*(r+1)==x);
    }
    int main() {
      for (U64 n=0, i=0; i < (1ULL<<32); ++i) {
        U64 s, d, d1, d2, d3;
        s = sqrt(n+=i);
        d1 = n - s*s;
        if (!isTriang(d1)) continue;
        d2 = (s+1)*(s+1) - n;
        if (!isTriang(d2)) continue;
        d3 = (s+2)*(s+2) - n;
        if (s) {
            d = n - (s-1)*(s-1);
            if (d < d3)  d3 = d;
        }
        if (isTriang(d3))   printf("%llu, ", n);
      }
    }
    
  • Haskell
    a232608 n = a232608_list !! (n-1)
    a232608_list = filter f $ tail a000217_list where
       f x = all ((== 1) . a010054) $ init $ sort $
             map (abs . (x -) . (^ 2) . (+ (a000196 x))) [-1..2]
    -- Reinhard Zumkeller, Mar 16 2014
Showing 1-1 of 1 results.