Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #13 Jul 19 2016 11:36:09
%S 0,3,130456,342096,1226720,291575011,379894587,523040160,15216609776,
%T 136622606520
%N Numbers k such that k^2 XOR (k+1)^2 is a square, and k^2 XOR (k+2)^2 is also a square, where XOR is the bitwise logical exclusive-or operator.
%C A subsequence of A221643.
%C Conjecture: the sequence is infinite.
%o (C)
%o #include <stdio.h>
%o #include <math.h>
%o int main() {
%o unsigned long long a, i, t;
%o for (i=0; i < (1L<<32)-2; ++i) {
%o a = (i*i) ^ ((i+1)*(i+1));
%o t = sqrt(a);
%o if (a != t*t) continue;
%o a = (i*i) ^ ((i+2)*(i+2));
%o t = sqrt(a);
%o if (a != t*t) continue;
%o printf("%llu, ", i);
%o }
%o return 0;
%o }
%o (Java)
%o class A224241 {
%o static public BigInteger isqrt(final BigInteger n)
%o {
%o if ( n.compareTo(BigInteger.ZERO) < 0 )
%o throw new ArithmeticException("Negative argument "+ n.toString()) ;
%o BigInteger x ;
%o final int bl = n.bitLength() ;
%o if ( bl > 120)
%o x = n.shiftRight(bl/2-1) ;
%o else
%o {
%o final double resul= Math.sqrt(n.doubleValue()) ;
%o x = new BigInteger(""+Math.round(resul)) ;
%o }
%o final BigInteger two = new BigInteger("2") ;
%o while ( true)
%o {
%o BigInteger x2 = x.pow(2) ;
%o BigInteger xplus2 = x.add(BigInteger.ONE).pow(2) ;
%o if ( x2.compareTo(n) <= 0 && xplus2.compareTo(n) > 0)
%o return x ;
%o xplus2 = xplus2.subtract(x.shiftLeft(2)) ;
%o if ( xplus2.compareTo(n) <= 0 && x2.compareTo(n) > 0)
%o return x.subtract(BigInteger.ONE) ;
%o xplus2 = x2.subtract(n).divide(x).divide(two) ;
%o x = x.subtract(xplus2) ;
%o }
%o }
%o static public void main(String[] argv)
%o {
%o for(BigInteger k = BigInteger.ZERO ; ; k= k.add(BigInteger.ONE) )
%o {
%o final BigInteger k2 = k.pow(2) ;
%o final BigInteger kplus1 = k.add(BigInteger.ONE) ;
%o final BigInteger k12 = kplus1.pow(2) ;
%o final BigInteger xor1 = k2.xor(k12) ;
%o final BigInteger roo1 = isqrt(xor1) ;
%o if ( roo1.pow(2).compareTo(xor1) == 0 )
%o {
%o final BigInteger k22 = kplus1.add(BigInteger.ONE).pow(2) ;
%o final BigInteger xor2 = k2.xor(k22) ;
%o final BigInteger roo2 = isqrt(xor2) ;
%o if ( roo2.pow(2).compareTo(xor2) == 0 )
%o System.out.println(k) ;
%o }
%o }
%o }
%o }
%o // _R. J. Mathar_, Apr 25 2013
%Y Cf. A221643.
%K nonn,base,more,less
%O 1,2
%A _Alex Ratushnyak_, Apr 01 2013