login
A334347
Number of r X s rectangles such that r + s = 2n, where exactly one of r or s is a positive square.
0
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, 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, 10, 7, 11, 11, 9, 11, 11, 11, 11, 10, 10, 12, 12, 12, 12, 12, 10
OFFSET
1,3
FORMULA
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).
EXAMPLE
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).
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).
MATHEMATICA
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}]
CROSSREFS
Cf. A010052.
Sequence in context: A189913 A240807 A355201 * A283672 A053268 A284828
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 23 2020
STATUS
approved