cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 61-63 of 63 results.

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

Views

Author

Seiichi Manyama, Apr 03 2021

Keywords

Examples

			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;
		

Crossrefs

Column k=1..2 give A068527, A175032.

Programs

  • Mathematica
    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 *)
  • PARI
    T(n, k) = my(m=binomial(n, k)); if(issquare(m), 0, (sqrtint(m)+1)^2-m);

Formula

T(n,k) = T(n,n-k) = A068527(binomial(n,k)).
T(n^2,1) = T(n^2,n^2-1) = 0.
If 3 <= k <= n-3 and (n,k) is not (50,3) or (50,47), T(n,k) > 0.

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

Views

Author

Ant King, Jan 23 2012

Keywords

Comments

The terms of this sequence are the digital roots of the indices of those nonzero triangular numbers that are also perfect squares (A001108).

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • PARI
    a(n)=[9, 1, 8, 4, 9, 7, 8, 7, 9, 4, 8, 1][n%12+1] \\ Charles R Greathouse IV, Jul 17 2016

Formula

G.f.: x*(1+8*x+3*x^2+x^3+3*x^4-x^5+x^6+9*x^7) / ((1-x)*(1+x)*(1+x^2)*(1-sqrt(3)*x+x^2)*(1+sqrt(3)*x+x^2)).
a(n) = a(n-12).
a(n) = 25-a(n-1)-a(n-6)-a(n-7).
a(n) = a(n-2)-a(n-6)+a(n-8).
a(n) = 1/4*(25+(-1)^n*(9+4*sqrt(3)*(cos(n*Pi/6)-cos(5*n*Pi/6))+2*cos(n*Pi/2))).

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

Views

Author

Gonzalo Martínez, Jun 27 2024

Keywords

Comments

{X, Y} satisfies the property if there exists an integer k such that n*(n+1)/2 - k^2 is a square, where k^2 is the sum of the elements of X and n*(n + 1)/2 - k^2 the sum of the elements of Y.
Note that k can also be zero. If n is A001108(k), i.e., if n*(n + 1)/2 is a perfect square, it suffices to take X = {1, 2, ..., n} and Y = { }.
a(n) > 0 if and only if n is a term of A140612.
Proof: (==>) If n is such that a(n) > 0, then it is possible to partition {1,2,...,n} into two sets, X and Y, whose sums of elements are b^2 and c^2, respectively, for some integers b, c. Then, n*(n + 1)/2 = b^2 + c^2, so, n*(n + 1) = 2*(b^2 + c^2) = (b + c)^2 + (b - c)^2, i.e., n*(n + 1) is a sum of two squares, whence necessarily n and (n + 1) are sums of two squares. Thus, n is in A140612.
(<==) If n is A140612, then n and (n + 1) are sums of two squares, whence it follows that n*(n + 1) is a sum of 2 squares and is also even. Then n*(n + 1)/2 is also a sum of two squares. Then, there exist integers k and m such that n*(n + 1)/2 = k^2 + m^2, so that n*(n + 1)/2 - k^2 = m^2. Therefore, given the set {1,2,...,n}, if we choose X such that the sum of the elements is k^2, it follows that a(n) > 0.

Examples

			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.
		

Crossrefs

Extensions

a(36)-a(68) from Alois P. Heinz, Jun 29 2024
Previous Showing 61-63 of 63 results.