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.

A220518 Numbers n such that A193232(n) is a triangular number.

This page as a plain text file.
%I A220518 #27 Mar 29 2013 13:34:47
%S A220518 0,1,5,9,45,49,101,153,1569,7163,7171,8162,18974,18976,24467,33490,
%T A220518 60290,63046,359539,551494,1769418,2813691,4140392,4649729,6675935,
%U A220518 9653486,59131393,158169499,243345386,588183781,1315697727,1387290631,1522472645,1879098546
%N A220518 Numbers n such that A193232(n) is a triangular number.
%C A220518 Numbers k such that bitwise XOR of first k triangular numbers is a triangular number.
%o A220518 (C)
%o A220518 #include <stdio.h>
%o A220518 typedef unsigned long long U64;
%o A220518 U64 rootTriangular(U64 a) {
%o A220518     U64 sr = 1L<<32, s, b;
%o A220518     if (a < (sr/2)*(sr+1)) {
%o A220518       sr>>=1;
%o A220518       while (a < sr*(sr+1)/2)  sr>>=1;
%o A220518     }
%o A220518     for (b = sr>>1; b; b>>=1) {
%o A220518         s = sr+b;
%o A220518         if (a >= s*(s+1)/2)  sr = s;
%o A220518     }
%o A220518     return sr;
%o A220518 }
%o A220518 int main() {
%o A220518   U64 a=0, i, t;
%o A220518   for (i=0; i < 1L<<32; ++i) {
%o A220518       a ^= i*(i+1)/2;
%o A220518       t = rootTriangular(a);
%o A220518       if (a == t*(t+1)/2)  printf("%llu\n", i);
%o A220518   }
%o A220518   return 0;
%o A220518 }
%Y A220518 Cf. A193232.
%Y A220518 Cf. A145827 (bitwise XOR of first k squares is a square).
%K A220518 base,nonn
%O A220518 1,3
%A A220518 _Alex Ratushnyak_, Mar 27 2013