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.

A225437 Numbers of triples {x, y, z} such that z >= y > 0 and triangular(x) + triangular(y) * triangular(z) = 2^n.

This page as a plain text file.
%I A225437 #12 May 13 2013 18:50:09
%S A225437 1,1,2,0,4,0,5,1,7,0,4,0,18,0,2,0,17,0,16,0,15,0,9,0,39,0,9,0,61,0,10,
%T A225437 3,27,0,18,0,56,0,8,0,80,0,48,1,41,0,12,0,118,1,10,0,90,0,30,2,24,0,24
%N A225437 Numbers of triples {x, y, z} such that z >= y > 0 and triangular(x) + triangular(y) * triangular(z) = 2^n.
%e A225437 {0, 1, 1} is the only triple producing 2^0, so a(0) = 1.
%e A225437 {1, 1, 3} and {3, 1, 1} are the triples producing 2^2, so a(2) = 2.
%o A225437 (C)
%o A225437 #include <stdio.h>
%o A225437 #include <math.h>
%o A225437 typedef unsigned long long U64;
%o A225437 U64 isTriangular(U64 a) {  // ! Must be a <= (1<<63)
%o A225437     U64 s = sqrt(a*2);
%o A225437     if (a>=(1ULL<<63)) {
%o A225437       if (a==(1ULL<<63)) return 0;
%o A225437       printf("Error: a = %llu\n", a), exit(1);
%o A225437     }
%o A225437     return (s*(s+1)/2 == a);
%o A225437 }
%o A225437 int main() {
%o A225437   U64 c, n, x, tx, y, ty, z, prod;
%o A225437   for (n = 1; n>0 && n <= (1ULL<<63); n+=n) {
%o A225437     for (c = 0, x = tx = 0; tx <= n; ++x, tx+=x)
%o A225437       for (z=prod=n-tx, y=ty=1; ty<=z; ++y, ty+=y, z=prod/ty)
%o A225437         if ((z * ty == prod) && isTriangular(z))  c++;
%o A225437     printf("%llu, ", c);
%o A225437   }
%o A225437   return 0;
%o A225437 }
%Y A225437 Cf. A000217, A224928, A225536.
%K A225437 nonn,hard,more
%O A225437 0,3
%A A225437 _Alex Ratushnyak_, May 08 2013