login

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”).

a(n) is the number of different sizes of integer-sided rectangles which can be placed inside an n X n square and with length greater than n.
1

%I #23 Aug 26 2019 08:27:11

%S 0,0,0,0,1,1,1,3,3,6,6,6,10,10,15,15,21,21,21,28,28,36,36,36,45,45,55,

%T 55,66,66,66,78,78,91,91,91,105,105,120,120,120,136,136,153,153,171,

%U 171,171,190,190,210,210,210,231,231,253,253,276,276,276,300,300,325,325

%N a(n) is the number of different sizes of integer-sided rectangles which can be placed inside an n X n square and with length greater than n.

%C Conditions for rectangles L x W which have length L > n: n - L/sqrt(2) > W/sqrt(2) where L/sqrt(2) and W/sqrt(2) are projections on the n X n square's sides.

%C If a rectangle with sides k X m fits in an n X n square then it fits by putting a parallel (without loss of generality, the longest) on the diagonal of the n X n square. Only the sum k + m really matters in order to see if the k X m rectangle fits in the square; it fits if k + m < sqrt(2) * n. - _David A. Corneth_, Aug 24 2019

%F a(n) = binomial(floor(n * sqrt(2)) - n, 2). - _David A. Corneth_, Aug 24 2019

%F a(n) = A327141(n) - A000217(n).

%e For n = 1, 2, 3, 4 we cannot place rectangles with side length L > n.

%e For n = 5 we can place a 6 X 1 rectangle inside a 5 X 5 square, so a(5) = 1.

%e For n = 8 we can place 9 X 1, 9 X 2 and 10 X 1 rectangles inside an 8 X 8 square, so a(8) = 3.

%o (C++)

%o #include <iostream>

%o #include <cmath>

%o #include <vector>

%o using namespace std;

%o int main() {

%o int n;

%o cin>>n;

%o vector <int> v;

%o for (int i=1; i<=n; i++)

%o {int count=0;

%o // ii-length, jj-width of diagonal rectangle

%o for (int ii=i+1; ii<=int(sqrt(2)*i); ii++)

%o for (int jj=1; jj<=i; jj++)

%o if ((double(i)-double(ii)/sqrt(2))-double(jj)/sqrt(2)>0)

%o {count++;}

%o v.push_back(count);

%o }

%o for (int i=0; i<v.size(); i++)

%o cout << v[i] << ", ";

%o return 0;

%o }

%o (PARI) a(n) = {binomial(floor(n * sqrt(2)) - n, 2)} \\ _David A. Corneth_, Aug 24 2019

%Y Cf. A080754, A327141.

%K nonn,easy

%O 1,8

%A _Kirill Ustyantsev_, Aug 23 2019