The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A225437 Numbers of triples {x, y, z} such that z >= y > 0 and triangular(x) + triangular(y) * triangular(z) = 2^n. 2
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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
EXAMPLE
{0, 1, 1} is the only triple producing 2^0, so a(0) = 1.
{1, 1, 3} and {3, 1, 1} are the triples producing 2^2, so a(2) = 2.
PROG
(C)
#include <stdio.h>
#include <math.h>
typedef unsigned long long U64;
U64 isTriangular(U64 a) { // ! Must be a <= (1<<63)
U64 s = sqrt(a*2);
if (a>=(1ULL<<63)) {
if (a==(1ULL<<63)) return 0;
printf("Error: a = %llu\n", a), exit(1);
}
return (s*(s+1)/2 == a);
}
int main() {
U64 c, n, x, tx, y, ty, z, prod;
for (n = 1; n>0 && n <= (1ULL<<63); n+=n) {
for (c = 0, x = tx = 0; tx <= n; ++x, tx+=x)
for (z=prod=n-tx, y=ty=1; ty<=z; ++y, ty+=y, z=prod/ty)
if ((z * ty == prod) && isTriangular(z)) c++;
printf("%llu, ", c);
}
return 0;
}
CROSSREFS
Sequence in context: A114402 A035647 A357487 * A065806 A331185 A228087
KEYWORD
nonn,hard,more
AUTHOR
Alex Ratushnyak, May 08 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 7 11:52 EDT 2024. Contains 373173 sequences. (Running on oeis4.)