login
Number of r X s rectangles such that r + s = 2n, where exactly one of r or s is a positive square.
0

%I #5 Apr 27 2020 03:50:21

%S 0,1,2,1,1,3,3,3,3,2,4,4,3,5,5,4,3,5,6,4,6,6,6,6,4,5,7,7,5,7,7,7,8,6,

%T 8,7,6,8,8,6,7,9,9,9,7,9,9,9,8,7,10,8,8,10,10,10,10,8,10,10,9,11,11,

%U 10,7,11,11,9,11,11,11,11,10,10,12,12,12,12,12,10

%N Number of r X s rectangles such that r + s = 2n, where exactly one of r or s is a positive square.

%F a(n) = Sum_{i=1..n-1} (1 - c(i))*c(2*n-i) + c(i)*(1 - c(2*n-i)), where c is the square characteristic (A010052).

%e a(5) = 1; 2*5 = 10 has the rectangle 4 X 6, which has one square side (Note that we don't count the 1 X 9 rectangle for 10 since both sides are positive squares).

%e a(11) = 4; 2*11 = 22 has four rectangles with exactly one square side. They are 1 X 21, 4 X 18, 6 X 16, 9 X 13 (with squares 1, 4, 16 and 9).

%t Table[Sum[(1 - (Floor[Sqrt[i]] - Floor[Sqrt[i - 1]])) (Floor[Sqrt[2 n - i]] - Floor[Sqrt[2 n - i - 1]]) + (Floor[Sqrt[i]] - Floor[Sqrt[i - 1]]) (1 - (Floor[Sqrt[2 n - i]] - Floor[Sqrt[2 n - i - 1]])), {i, n - 1}], {n, 100}]

%Y Cf. A010052.

%K nonn,easy

%O 1,3

%A _Wesley Ivan Hurt_, Apr 23 2020