login
Numbers of the form (x^2) OR (y^2) with x, y >= 0 (where OR denotes the bitwise OR operator).
3

%I #13 Jan 20 2020 12:54:32

%S 0,1,4,5,9,13,16,17,20,25,29,36,37,45,49,52,53,57,61,64,65,68,73,80,

%T 81,85,89,100,101,109,113,116,117,121,125,144,145,148,153,169,173,177,

%U 180,185,196,197,205,208,209,212,213,221,225,228,229,233,237,241

%N Numbers of the form (x^2) OR (y^2) with x, y >= 0 (where OR denotes the bitwise OR operator).

%C All squares belong to the sequence.

%H Rémy Sigrist, <a href="/A331531/b331531.txt">Table of n, a(n) for n = 1..10000</a>

%e The first terms, alongside the corresponding decompositions, are:

%e n a(n) Corresponding (x, y) (with x<=y)

%e -- ---- -----------------------------------------

%e 1 0 (0, 0)

%e 2 1 (0, 1) (1, 1)

%e 3 4 (0, 2) (2, 2)

%e 4 5 (1, 2)

%e 5 9 (0, 3) (1, 3) (3, 3)

%e 6 13 (2, 3)

%e 7 16 (0, 4) (4, 4)

%e 8 17 (1, 4)

%e 9 20 (2, 4)

%e 10 25 (0, 5) (1, 5) (3, 4) (3, 5) (4, 5) (5, 5)

%o (PARI) is(n) = setsearch(setbinop(bitor, select(x2 -> bitand(n, x2)==x2, vector(1+sqrtint(n), x, (x-1)^2))), n)>0

%Y Cf. A000290, A331534 (least x), A331535 (corresponding y).

%K nonn,base

%O 1,3

%A _Rémy Sigrist_, Jan 19 2020