|
|
A224928
|
|
Numbers of pairs {x, y} such that x <= y and triangular(x) + triangular(y) = 2^n.
|
|
2
|
|
|
1, 1, 1, 0, 2, 0, 1, 0, 3, 0, 2, 0, 4, 0, 1, 0, 8, 0, 2, 0, 4, 0, 4, 0, 8, 0, 2, 0, 24, 0, 2, 0, 8, 0, 8, 0, 8, 0, 2, 0, 32, 0, 4, 0, 16, 0, 4, 0, 32, 0, 4, 0, 32, 0, 4, 0, 4, 0, 8, 0, 16, 0, 2, 0, 32, 0, 6, 0, 48, 0, 16, 0, 16, 0, 8, 0, 384, 0, 4, 0, 16, 0, 16, 0, 16, 0, 8, 0, 768, 0, 2, 0, 8, 0, 4, 0, 32, 0, 32, 0, 256
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
COMMENTS
|
Conjectures:
1. a(n) = 0 for odd n > 1.
2. a(n) is even for even n > 14.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
2^1 = 1 + 1, the only representation of 2 as a sum of two triangular numbers, so a(1)=1.
2^4 = 16 = 1+15 = 6+10, two representations, so a(4) = 2.
2^8 = 256 = 3+253 = 66+190 = 120+136, so a(8) = 3.
2^12 = 4096 = 1+4095 = 91+4005 = 1540+2556 = 2016+2080, so a(12) = 4.
|
|
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;
for (n = 1; n; n+=n) {
for (c = x = tx = 0; tx*2 <= n; ++x, tx+=x)
if (isTriangular(n - tx))
++c; //, printf("(%llu+%llu) ", tx, n-tx);
printf("%llu, ", c);
}
return 0;
}
(PARI)
A008441(n) = if(!n, n, sumdiv(4*n + 1, d, (d%4==1) - (d%4==3)));
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|