login
Numbers n such that n^2 XOR triangular(n) is a perfect square. XOR is the bitwise logical exclusive-or operator.
0

%I #7 Jun 12 2013 13:29:45

%S 0,1,6,8,4086,24136,162297,7868054,29792904,22666693375

%N Numbers n such that n^2 XOR triangular(n) is a perfect square. XOR is the bitwise logical exclusive-or operator.

%C Indices of perfect squares in A226470. No other terms below 2^35. Roots of generated squares: 0, 0, 7, 10, 2915, 29506, 149434, 6328037, 27602118, 20243443647.

%e 8^2 XOR triangular(8) = 64 XOR 36 = 100, because 100 is a perfect square, 8 is in the sequence.

%o (C)

%o #include <stdio.h>

%o #include <math.h>

%o int main() {

%o for (unsigned long long a, r, n=0; n < (1ULL<<32); ++n) {

%o a = (n*n) ^ (n*(n+1)/2);

%o r = sqrt(a);

%o if (r*r==a) printf("%llu, ", n);

%o }

%o return 0;

%o }

%Y Cf. A000217, A000290, A226470, A221643.

%K nonn,more,base

%O 1,3

%A _Alex Ratushnyak_, Jun 08 2013