A343037
Triangle T(n,k), n >= 2, 1 <= k <= n-1, read by rows, where T(n,k) is the difference between smallest square >= binomial(n,k) and binomial(n,k).
Original entry on oeis.org
2, 1, 1, 0, 3, 0, 4, 6, 6, 4, 3, 1, 5, 1, 3, 2, 4, 1, 1, 4, 2, 1, 8, 8, 11, 8, 8, 1, 0, 0, 16, 18, 18, 16, 0, 0, 6, 4, 1, 15, 4, 15, 1, 4, 6, 5, 9, 4, 31, 22, 22, 31, 4, 9, 5, 4, 15, 5, 34, 49, 37, 49, 34, 5, 15, 4, 3, 3, 3, 14, 9, 48, 48, 9, 14, 3, 3, 3, 2, 9, 36, 23, 23, 22, 49, 22, 23, 23, 36, 9, 2
Offset: 2
binomial(50,3) = binomial(50,47) = 140^2. So T(50,3) = T(50,47) = 0.
Triangle begins:
2;
1, 1;
0, 3, 0;
4, 6, 6, 4;
3, 1, 5, 1, 3;
2, 4, 1, 1, 4, 2;
1, 8, 8, 11, 8, 8, 1;
0, 0, 16, 18, 18, 16, 0, 0;
6, 4, 1, 15, 4, 15, 1, 4, 6;
5, 9, 4, 31, 22, 22, 31, 4, 9, 5;
4, 15, 5, 34, 49, 37, 49, 34, 5, 15, 4;
3, 3, 3, 14, 9, 48, 48, 9, 14, 3, 3, 3;
2, 9, 36, 23, 23, 22, 49, 22, 23, 23, 36, 9, 2;
1, 16, 29, 4, 22, 36, 126, 126, 36, 22, 4, 29, 16, 1;
0, 1, 16, 29, 121, 92, 9, 126, 9, 92, 121, 29, 16, 1, 0;
-
diff[n_] := Ceiling[Sqrt[n]]^2 - n; T[n_, k_] := diff @ Binomial[n, k]; Table[T[n, k], {n, 2, 14}, {k, 1, n - 1}] // Flatten (* Amiram Eldar, Apr 03 2021 *)
-
T(n, k) = my(m=binomial(n, k)); if(issquare(m), 0, (sqrtint(m)+1)^2-m);
A205184
Period 12: repeat (1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1, 9).
Original entry on oeis.org
1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1, 9, 1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1, 9, 1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1, 9, 1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1, 9, 1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1, 9, 1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1, 9, 1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1, 9, 1, 8
Offset: 1
As the fourth nonzero triangular number that is also a perfect square is A000217(288), and 288 has digital root A010888(288)=9, then a(4)=9.
-
LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1, 9}, 86]
LinearRecurrence[{0, 1, 0, 0, 0, -1, 0, 1},{1, 8, 4, 9, 7, 8, 7, 9},86] (* Ray Chandler, Aug 03 2015 *)
-
a(n)=[9, 1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1][n%12+1] \\ Charles R Greathouse IV, Jul 17 2016
A374087
a(n) is the number of ways to partition {1,2,...,n} into two sets X and Y such that the sum of the elements of each is a square.
Original entry on oeis.org
1, 1, 0, 0, 1, 0, 0, 0, 1, 8, 0, 0, 0, 0, 0, 0, 365, 8, 0, 0, 0, 0, 0, 0, 0, 91514, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104742767, 0, 0, 0, 6519062, 0, 0, 0, 0, 0, 0, 0, 0, 531168463492, 0, 0, 15329991499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11530164811834907, 0, 0, 0, 0
Offset: 0
If n = 4, then the only way is {1}, {2, 3, 4}.
If n = 8, then the only way is { }, {1, 2, 3, 4, 5, 6, 7, 8}.
If n = 9, there are 8 ways, which are shown below:
{9}, {1, 2, 3, 4, 5, 6, 7, 8}
{1, 8}, {2, 3, 4, 5, 6, 7, 9}
{2, 7}, {1, 3, 4, 5, 6, 8, 9}
{3, 6}, {1, 2, 4, 5, 7, 8, 9}
{4, 5}, {1, 2, 3, 6, 7, 8, 9}
{1, 2, 6}, {3, 4, 5, 7, 8, 9}
{1, 3, 5}, {2, 4, 6, 7, 8, 9}
{2, 3, 4}, {1, 5, 6, 7, 8, 9}
In each of the 8 cases, the sum of the elements of the subsets are 9 and 36, respectively.
If n = 25, there are 91514 ways. Some examples with sums different from each other:
{1}, {2, 3, ..., 25}, where the sums are 1^2 and 18^2, respectively.
{1, 2, 3, 4, 5, 6, 7, 8}, {9, 10, 11, ..., 25}, where the sums are 6^2 and 17^2.
X = {6, 22, 23, 24, 25}, Y = {1, 2, ..., 25} - X, whose sums are 10^2 and 15^2.
Comments