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.

A224928 Numbers of pairs {x, y} such that x <= y and triangular(x) + triangular(y) = 2^n.

This page as a plain text file.
%I A224928 #29 May 26 2021 08:32:19
%S A224928 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,
%T A224928 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,
%U A224928 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
%N A224928 Numbers of pairs {x, y} such that x <= y and triangular(x) + triangular(y) = 2^n.
%C A224928 Conjectures:
%C A224928 1. a(n) = 0 for odd n > 1.
%C A224928 2. a(n) is even for even n > 14.
%H A224928 Antti Karttunen, <a href="/A224928/b224928.txt">Table of n, a(n) for n = 0..329</a>
%F A224928 a(n) = A052343(2^n).
%e A224928 2^1 = 1 + 1, the only representation of 2 as a sum of two triangular numbers, so a(1)=1.
%e A224928 2^4 = 16 = 1+15 = 6+10, two representations, so a(4) = 2.
%e A224928 2^8 = 256 = 3+253 = 66+190 = 120+136, so a(8) = 3.
%e A224928 2^12 = 4096 = 1+4095 = 91+4005 = 1540+2556 = 2016+2080, so a(12) = 4.
%o A224928 (C)
%o A224928 #include <stdio.h>
%o A224928 #include <math.h>
%o A224928 typedef unsigned long long U64;
%o A224928 U64 isTriangular(U64 a) {      // ! Must be a <= (1<<63)
%o A224928     U64 s = sqrt(a*2);
%o A224928     if (a>=(1ULL<<63)) {
%o A224928         if (a==(1ULL<<63)) return 0;
%o A224928         printf("Error: a = %llu\n", a), exit(1);
%o A224928     }
%o A224928     return (s*(s+1)/2 == a);
%o A224928 }
%o A224928 int main() {
%o A224928   U64 c, n, x, tx;
%o A224928   for (n = 1; n; n+=n) {
%o A224928     for (c = x = tx = 0; tx*2 <= n; ++x, tx+=x)
%o A224928       if (isTriangular(n - tx))
%o A224928         ++c;//, printf("(%llu+%llu) ", tx, n-tx);
%o A224928     printf("%llu, ", c);
%o A224928   }
%o A224928   return 0;
%o A224928 }
%o A224928 (PARI)
%o A224928 A008441(n) = if(!n,n,sumdiv(4*n + 1, d, (d%4==1) - (d%4==3)));
%o A224928 A052343(n) = if(!n,1,my(u=A008441(n)); ((u\2)+(u%2)));
%o A224928 A224928(n) = A052343(2^n); \\ _Antti Karttunen_, May 24 2021
%Y A224928 Cf. A000217, A052343, A006307, A225437.
%K A224928 nonn
%O A224928 0,5
%A A224928 _Alex Ratushnyak_, May 08 2013
%E A224928 More terms from _Antti Karttunen_, May 24 2021