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.

Showing 1-10 of 16 results. Next

A113881 Table of smallest number of squares, T(m,n), needed to tile an m X n rectangle, read by antidiagonals.

Original entry on oeis.org

1, 2, 2, 3, 1, 3, 4, 3, 3, 4, 5, 2, 1, 2, 5, 6, 4, 4, 4, 4, 6, 7, 3, 4, 1, 4, 3, 7, 8, 5, 2, 5, 5, 2, 5, 8, 9, 4, 5, 3, 1, 3, 5, 4, 9, 10, 6, 5, 5, 5, 5, 5, 5, 6, 10, 11, 5, 3, 2, 5, 1, 5, 2, 3, 5, 11, 12, 7, 6, 6, 5, 5, 5, 5, 6, 6, 7, 12, 13, 6, 6, 4, 6, 4, 1, 4, 6, 4, 6, 6, 13, 14, 8, 4, 6, 2, 3, 7, 7, 3, 2, 6, 4, 8, 14
Offset: 1

Views

Author

Devin Kilminster (devin(AT)27720.net), Jan 27 2006

Keywords

Comments

a(n) = A338573(n) for n <= 105, as stated by R. J. Mathar. These sequences are essentially different though, because a(13433) = T(67,98) = T(98,67) = a(13464), but A338573(13433) != A338573(13464). The relationship between the tiling problem and resistor networks is remarkable. There are explanations in M. Ortolano et al., 2013. - Rainer Rosenthal, Nov 09 2020

Examples

			T(n,n) = 1 (1 n X n square).
T(n,1) = n (n 1 X 1 squares).
T(6,7) = 6 (2 3 X 3, 1 4 X 4, 1 2 X 2, 2 1 X 1).
T(11,13) = 6 (1 7 X 7, 1 6 X 6, 1 5 X 5, 2 4 X 4 1 1 X 1).
Table T(m,n) begins:
:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...
:   2, 1, 3, 2, 4, 3, 5, 4, 6,  5, ...
:   3, 3, 1, 4, 4, 2, 5, 5, 3,  6, ...
:   4, 2, 4, 1, 5, 3, 5, 2, 6,  4, ...
:   5, 4, 4, 5, 1, 5, 5, 5, 6,  2, ...
:   6, 3, 2, 3, 5, 1, 5, 4, 3,  4, ...
:   7, 5, 5, 5, 5, 5, 1, 7, 6,  6, ...
:   8, 4, 5, 2, 5, 4, 7, 1, 7,  5, ...
:   9, 6, 3, 6, 6, 3, 6, 7, 1,  6, ...
:  10, 5, 6, 4, 2, 4, 6, 5, 6,  1, ...
		

Crossrefs

Programs

  • Mathematica
    (* *** Warning *** This empirical toy-program is based on the greedy algorithm. Its output was only verified for n+k <= 32. Any use outside this domain might produce only upper bounds instead of minimums. *)
    nmax = 31; Clear[T];
    Tmin[n_, k_] := Table[{1 + T[ c, k - c] + T[n - c, k], 1 + T[n, k - c] + T[n - c, c]}, {c, 1, k - 1}] // Flatten // Min;
    Tmin2[n_, k_] := Module[{n1, n2, k1, k2}, 1 + T[n2, k1 + 1] + T[n - n1, k2] + T[n - n2, k1] + T[n1, k - k1] /. {Reduce[1 <= n1 <= n - 1 && 1 <= n2 <= n - 1 && 1 <= k1 <= k - 1 && 1 <= k2 <= k - 1 && n1 + 1 + n2 == n && k1 + 1 + k2 == k, Integers] // ToRules} // Min];
    T[n_, n_] = 1;
    T[n_, 1] := n;
    T[1, k_] := k;
    T[n_, k_ /; k > 1] /; n > k && Divisible[n, k] := n/k;
    T[n_, k_ /; k > 1] /; n > k := T[n, k] = If[k >= 5 && n >= 6 && n - k <= 3, Min[Tmin[n, k], Tmin2[n, k], T[k, n - k] + 1], T[k, n - k] + 1];
    T[n_, k_ /; k > 1] /; n < k := T[n, k] = T[k, n];
    Table[T[n - k + 1, k], {n, 1, nmax}, {k, 1, n}] // Flatten (* Jean-François Alcover, Mar 11 2016, checked against first 496 terms of the b-file *)

A285721 Square array read by antidiagonals: A(n,k) = number of steps in simple Euclidean algorithm for gcd(n,k) to reach the termination test n=k, read by antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Original entry on oeis.org

0, 1, 1, 2, 0, 2, 3, 2, 2, 3, 4, 1, 0, 1, 4, 5, 3, 3, 3, 3, 5, 6, 2, 3, 0, 3, 2, 6, 7, 4, 1, 4, 4, 1, 4, 7, 8, 3, 4, 2, 0, 2, 4, 3, 8, 9, 5, 4, 4, 5, 5, 4, 4, 5, 9, 10, 4, 2, 1, 4, 0, 4, 1, 2, 4, 10, 11, 6, 5, 5, 4, 6, 6, 4, 5, 5, 6, 11, 12, 5, 5, 3, 5, 3, 0, 3, 5, 3, 5, 5, 12, 13, 7, 3, 5, 1, 2, 7, 7, 2, 1, 5, 3, 7, 13, 14, 6, 6, 2, 6, 3, 5, 0, 5, 3, 6, 2, 6, 6, 14
Offset: 1

Views

Author

Antti Karttunen, May 03 2017

Keywords

Examples

			The top left 18 X 18 corner of the array:
   0, 1, 2, 3, 4, 5, 6, 7, 8,  9, 10, 11, 12, 13, 14, 15, 16, 17
   1, 0, 2, 1, 3, 2, 4, 3, 5,  4,  6,  5,  7,  6,  8,  7,  9,  8
   2, 2, 0, 3, 3, 1, 4, 4, 2,  5,  5,  3,  6,  6,  4,  7,  7,  5
   3, 1, 3, 0, 4, 2, 4, 1, 5,  3,  5,  2,  6,  4,  6,  3,  7,  5
   4, 3, 3, 4, 0, 5, 4, 4, 5,  1,  6,  5,  5,  6,  2,  7,  6,  6
   5, 2, 1, 2, 5, 0, 6, 3, 2,  3,  6,  1,  7,  4,  3,  4,  7,  2
   6, 4, 4, 4, 4, 6, 0, 7, 5,  5,  5,  5,  7,  1,  8,  6,  6,  6
   7, 3, 4, 1, 4, 3, 7, 0, 8,  4,  5,  2,  5,  4,  8,  1,  9,  5
   8, 5, 2, 5, 5, 2, 5, 8, 0,  9,  6,  3,  6,  6,  3,  6,  9,  1
   9, 4, 5, 3, 1, 3, 5, 4, 9,  0, 10,  5,  6,  4,  2,  4,  6,  5
  10, 6, 5, 5, 6, 6, 5, 5, 6, 10,  0, 11,  7,  6,  6,  7,  7,  6
  11, 5, 3, 2, 5, 1, 5, 2, 3,  5, 11,  0, 12,  6,  4,  3,  6,  2
  12, 7, 6, 6, 5, 7, 7, 5, 6,  6,  7, 12,  0, 13,  8,  7,  7,  6
  13, 6, 6, 4, 6, 4, 1, 4, 6,  4,  6,  6, 13,  0, 14,  7,  7,  5
  14, 8, 4, 6, 2, 3, 8, 8, 3,  2,  6,  4,  8, 14,  0, 15,  9,  5
  15, 7, 7, 3, 7, 4, 6, 1, 6,  4,  7,  3,  7,  7, 15,  0, 16,  8
  16, 9, 7, 7, 6, 7, 6, 9, 9,  6,  7,  6,  7,  7,  9, 16,  0, 17
  17, 8, 5, 5, 6, 2, 6, 5, 1,  5,  6,  2,  6,  5,  5,  8, 17,  0
		

Crossrefs

One less than A072030.
Row 2 & column 2: A028242 (but with starting offset 1).
Row 3 & column 3 (from zero onward) seems to be A226576.
Compare also to arrays A049834, A113881, A219158.

Programs

  • Python
    def A(n, k): return 0 if n==k else 1 + A(abs(n - k), min(n, k))
    for n in range(1, 21): print([A(n - k + 1, k) for k in range(1, n + 1)]) # Indranil Ghosh, May 03 2017
  • Scheme
    (define (A285721 n) (A285721bi (A002260 n) (A004736 n)))
    (define (A285721bi row col) (cond ((= row col) 0) ((> row col) (+ 1 (A285721bi (- row col) col))) (else (+ 1 (A285721bi row (- col row))))))
    ;; Alternatively:
    (define (A285721bi row col) (if (= row col) 0 (+ 1 (A285721bi (abs (- row col)) (min col row)))))
    ;; Another implementation, as an one-dimensional sequence:
    (definec (A285721 n) (if (zero? (A285722 n)) 0 (+ 1 (A285721 (A285722 n)))))
    

Formula

If n = k, then A(n,k) = 0, if n > k, then A(n,k) = 1 + A(n-k,k), otherwise [when n < k], A(n,k) = 1 + A(n,k-n).
Or alternatively, when n <> k, A(n,k) = 1 + A(abs(n-k),min(n,k)).
A(n,k) = A072030(n,k)-1.
As an one-dimensional sequence:
a(n) = 0 if A285722(n) = 0, otherwise a(n) = 1 + a(A285722(n)). [Here A285722 is also used as an one-dimensional sequence.]

A030451 a(2*n) = n, a(2*n+1) = n+2.

Original entry on oeis.org

0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12, 11, 13, 12, 14, 13, 15, 14, 16, 15, 17, 16, 18, 17, 19, 18, 20, 19, 21, 20, 22, 21, 23, 22, 24, 23, 25, 24, 26, 25, 27, 26, 28, 27, 29, 28, 30, 29, 31, 30, 32, 31, 33, 32, 34, 33, 35, 34, 36, 35, 37, 36, 38, 37
Offset: 0

Views

Author

Daniel Smith (2true(AT)gte.net)

Keywords

Comments

Previous name was: Once started, this mixes the natural numbers and the natural numbers shifted by 1.
Smallest number of integer-sided squares needed to tile a 2 X n rectangle. a(5) = 4:
..._...
| | |_|
|_|___||. - _Alois P. Heinz, Jun 12 2013

Crossrefs

Cf. A168361 (first differences), A198442 (partial sums).
Row m=2 of A113881, A219158.
Essentially the same as A028242.

Programs

  • Maple
    a:= n-> iquo(n, 2, 'r') +[0, 2][r+1]:
    seq(a(n), n=0..80);  # Alois P. Heinz, Jun 12 2013
  • Mathematica
    Riffle[# + 1, #] &@ Range[0, 37] (* or *)
    Table[3/4 - (-1)^n 3/4 + n/2, {n, 0, 72}] (* or *)
    CoefficientList[Series[(2 x - x^2)/((1 - x) (1 - x^2)), {x, 0, 72}], x] (* Michael De Vlieger, Apr 25 2016 *)
  • PARI
    a(n)=n\2+2*(n%2)

Formula

a(n) = 3/4 -(-1)^n*3/4 +n/2.
G.f.: (2*x-x^2)/((1-x)*(1-x^2)).
a(2n) = n, a(2n+1) = n+2.
a(n+2) = a(n)+1.
a(n) = -a(-3-n).
a(n) = A110570(n,2) for n>1. - Reinhard Zumkeller, Jul 28 2005
a(n) = (n+1)-a(n-1) with n>0, a(0)=0. - Vincenzo Librandi, Nov 18 2010
a(n) = Sum_{k=1..n} (-1)^(n+k)*(k+1). - Arkadiusz Wesolowski, Nov 23 2012
a(n+1) = (a(0) + a(1) + ... + a(n))/a(n) for n>0. This formula with different initial conditions produces A008619. - Ivan Neretin, Apr 25 2016
E.g.f.: (x*exp(x) + 3*sinh(x))/2. - Ilya Gutkovskiy, Apr 25 2016
Sum_{n>=1} (-1)^n/a(n) = 1. - Amiram Eldar, Oct 04 2022

Extensions

New name (using existing formula) from Joerg Arndt, Apr 26 2016

A226576 Smallest number of integer-sided squares needed to tile a 3 X n rectangle.

Original entry on oeis.org

0, 3, 3, 1, 4, 4, 2, 5, 5, 3, 6, 6, 4, 7, 7, 5, 8, 8, 6, 9, 9, 7, 10, 10, 8, 11, 11, 9, 12, 12, 10, 13, 13, 11, 14, 14, 12, 15, 15, 13, 16, 16, 14, 17, 17, 15, 18, 18, 16, 19, 19, 17, 20, 20, 18, 21, 21, 19, 22, 22, 20, 23, 23, 21, 24, 24, 22, 25, 25, 23, 26
Offset: 0

Views

Author

Alois P. Heinz, Jun 12 2013

Keywords

Examples

			a(8) = 5:
  ._._._._._._._._.
  |     |     |   |
  |     |     |___|
  |_____|_____|_|_| .
		

Crossrefs

Cf. row m=3 of A113881, A219158.

Programs

  • Maple
    a:= n-> iquo(n, 3, 'r') +[0, 3, 3][r+1]:
    seq(a(n), n=0..80);
  • Mathematica
    CoefficientList[Series[(3 x - 2 x^3)/(1 - x - x^3 + x^4), {x, 0, 70}], x] (* Michael De Vlieger, Oct 01 2017 *)
  • PARI
    concat(0, Vec((3*x-2*x^3)/(1-x-x^3+x^4) + O(x^50))) \\ Felix Fröhlich, Oct 02 2017

Formula

G.f.: (3*x-2*x^3)/(1-x-x^3+x^4).
a(n) = 1 + a(n-3) for n>2; a(0)=0, a(1)=a(2)=3.
a(n) = (3*n+15+6*cos(2*(n-2)*Pi/3)-8*sqrt(3)*sin(2*(n-2)*Pi/3))/9. - Wesley Ivan Hurt, Oct 01 2017
a(n) = 3*floor((n+2)/3) - 2*floor(n/3). - Ridouane Oudra, Jan 25 2024

A226577 Smallest number of integer-sided squares needed to tile a 4 X n rectangle.

Original entry on oeis.org

0, 4, 2, 4, 1, 5, 3, 5, 2, 6, 4, 6, 3, 7, 5, 7, 4, 8, 6, 8, 5, 9, 7, 9, 6, 10, 8, 10, 7, 11, 9, 11, 8, 12, 10, 12, 9, 13, 11, 13, 10, 14, 12, 14, 11, 15, 13, 15, 12, 16, 14, 16, 13, 17, 15, 17, 14, 18, 16, 18, 15, 19, 17, 19, 16, 20, 18, 20, 17, 21, 19, 21, 18
Offset: 0

Views

Author

Alois P. Heinz, Jun 12 2013

Keywords

Examples

			a(11) = 6:
._._._._._._._._._._._.
|       |       |     |
|       |       |     |
|       |       |_____|
|_______|_______|_|_|_|
		

Crossrefs

Row m=4 of A113881, A219158.

Programs

  • Maple
    a:= n-> iquo(n, 4, 'r') +[0, 4, 2, 4][r+1]:
    seq(a(n), n=0..80);
  • Mathematica
    RecurrenceTable[{a[0] == 0, a[1] == 4, a[2] == 2, a[3] == 4, a[n] == 1 + a[n - 4]}, a[n], {n, 0, 80}] (* Bruno Berselli, Jun 12 2013 *)
    LinearRecurrence[{1,0,0,1,-1},{0,4,2,4,1},90] (* Harvey P. Dale, Jul 03 2019 *)
  • Maxima
    makelist(5+(2*n-1-(2+(-1)^n)*(11+2*%i^(n*(n+1))))/8, n, 0, 80); /* Bruno Berselli, Jun 12 2013 */

Formula

G.f.: (-3*x^4+2*x^3-2*x^2+4*x)/(x^5-x^4-x+1).
a(n) = 1 + a(n-4) for n>3.
a(n) = 5 + (2*n - 1 - (2 + (-1)^n)*(11 + 2*i^(n*(n+1))))/8, where i=sqrt(-1). [Bruno Berselli, Jun 12 2013]

A226578 Smallest number of integer-sided squares needed to tile a 5 X n rectangle.

Original entry on oeis.org

0, 5, 4, 4, 5, 1, 5, 5, 5, 6, 2, 6, 6, 6, 7, 3, 7, 7, 7, 8, 4, 8, 8, 8, 9, 5, 9, 9, 9, 10, 6, 10, 10, 10, 11, 7, 11, 11, 11, 12, 8, 12, 12, 12, 13, 9, 13, 13, 13, 14, 10, 14, 14, 14, 15, 11, 15, 15, 15, 16, 12, 16, 16, 16, 17, 13, 17, 17, 17, 18, 14, 18, 18
Offset: 0

Views

Author

Alois P. Heinz, Jun 12 2013

Keywords

Examples

			a(11) = 6:
._._._._._._._._._._._.
|         |     |     |
|         |     |     |
|         |_____|_____|
|         |   |   |   |
|_________|___|___|___|
		

Crossrefs

Row m=5 of A113881, A219158.

Programs

  • Maple
    a:= n-> `if`(n=1, 5, iquo(n, 5, 'r') +[0, 4$3, 5][r+1]):
    seq(a(n), n=0..80);

Formula

G.f.: x*(x^6-x^5-4*x^4+x^3-x+5)/(x^6-x^5-x+1).
a(n) = 1 + a(n-5) for n>6.

A226579 Smallest number of integer-sided squares needed to tile a 6 X n rectangle.

Original entry on oeis.org

0, 6, 3, 2, 3, 5, 1, 5, 4, 3, 4, 6, 2, 6, 5, 4, 5, 7, 3, 7, 6, 5, 6, 8, 4, 8, 7, 6, 7, 9, 5, 9, 8, 7, 8, 10, 6, 10, 9, 8, 9, 11, 7, 11, 10, 9, 10, 12, 8, 12, 11, 10, 11, 13, 9, 13, 12, 11, 12, 14, 10, 14, 13, 12, 13, 15, 11, 15, 14, 13, 14, 16, 12, 16, 15, 14
Offset: 0

Views

Author

Alois P. Heinz, Jun 12 2013

Keywords

Examples

			a(13) = 6:
._._._._._._._._._._._._._.
|           |       |     |
|           |       |     |
|           |       |_____|
|           |_______|     |
|           |   |   |     |
|___________|___|___|_____|
		

Crossrefs

Row m=6 of A113881, A219158.

Programs

  • Maple
    a:= n-> `if`(n=1, 6, iquo(n, 6, 'r') +[0, 4, 3, 2, 3, 5][r+1]):
    seq(a(n), n=0..100);
  • Mathematica
    Join[{0,6},LinearRecurrence[{0,1,1,0,-1},{3,2,3,5,1},80]] (* Harvey P. Dale, Jun 03 2014 *)

Formula

G.f.: x*(2*x^5-6*x^3-4*x^2+3*x+6)/(x^5-x^3-x^2+1).
a(n) = 1 + a(n-6) for n>7.

A226580 Smallest number of integer-sided squares needed to tile a 7 X n rectangle.

Original entry on oeis.org

0, 7, 5, 5, 5, 5, 5, 1, 7, 6, 6, 6, 6, 6, 2, 8, 7, 7, 7, 7, 7, 3, 9, 8, 8, 8, 8, 8, 4, 10, 9, 9, 9, 9, 9, 5, 11, 10, 10, 10, 10, 10, 6, 12, 11, 11, 11, 11, 11, 7, 13, 12, 12, 12, 12, 12, 8, 14, 13, 13, 13, 13, 13, 9, 15, 14, 14, 14, 14, 14, 10, 16, 15, 15, 15
Offset: 0

Views

Author

Alois P. Heinz, Jun 12 2013

Keywords

Examples

			a(15) = 8:
._._._._._._._._._._._._._._._.
|             |       |       |
|             |       |       |
|             |       |       |
|             |_______|_______|
|             |     |     |   |
|             |     |     |___|
|_____________|_____|_____|_|_|
		

Crossrefs

Row m=7 of A113881, A219158.

Programs

  • Maple
    a:= n-> `if`(n=1, 7, iquo(n, 7, 'r') +[0, 6, 5$5][r+1]):
    seq(a(n), n=0..100);
  • Mathematica
    CoefficientList[Series[x*(x^8 - x^7 - 4*x^6 - 2*x + 7)/(x^8 - x^7 - x + 1), {x, 0, 100}], x] (* Wesley Ivan Hurt, Jan 15 2017 *)

Formula

G.f.: x*(x^8-x^7-4*x^6-2*x+7)/(x^8-x^7-x+1).
a(n) = 1 + a(n-7) for n>8.

A226581 Smallest number of integer-sided squares needed to tile an 8 X n rectangle.

Original entry on oeis.org

0, 8, 4, 5, 2, 5, 4, 7, 1, 7, 5, 6, 3, 6, 5, 8, 2, 8, 6, 7, 4, 7, 6, 9, 3, 9, 7, 8, 5, 8, 7, 10, 4, 10, 8, 9, 6, 9, 8, 11, 5, 11, 9, 10, 7, 10, 9, 12, 6, 12, 10, 11, 8, 11, 10, 13, 7, 13, 11, 12, 9, 12, 11, 14, 8, 14, 12, 13, 10, 13, 12, 15, 9, 15, 13, 14, 11
Offset: 0

Views

Author

Alois P. Heinz, Jun 12 2013

Keywords

Examples

			a(17) = 8:
._._._._._._._._._._._._._._._._._.
|               |       |         |
|               |       |         |
|               |       |         |
|               |_______|         |
|               |       |_________|
|               |       |     |   |
|               |       |     |___|
|_______________|_______|_____|_|_|
		

Crossrefs

Row m=8 of A113881, A219158.

Programs

  • Maple
    a:= n-> `if`(n=1, 8, iquo(n, 8, 'r') +[0, 6, 4, 5, 2, 5, 4, 7][r+1]):
    seq(a(n), n=0..100);
  • Mathematica
    LinearRecurrence[{1,0,0,0,0,0,0,1,-1},{0,8,4,5,2,5,4,7,1,7,5},80] (* Harvey P. Dale, Sep 07 2016 *)

Formula

G.f.: x*(2*x^9-2*x^8-6*x^7+3*x^6-x^5+3*x^4-3*x^3+x^2-4*x+8) / (x^9-x^8-x+1).
a(n) = 1 + a(n-8) for n>9.

A226582 Smallest number of integer-sided squares needed to tile a 9 X n rectangle.

Original entry on oeis.org

0, 9, 6, 3, 6, 6, 3, 6, 7, 1, 6, 7, 4, 7, 7, 4, 7, 8, 2, 7, 8, 5, 8, 8, 5, 8, 9, 3, 8, 9, 6, 9, 9, 6, 9, 10, 4, 9, 10, 7, 10, 10, 7, 10, 11, 5, 10, 11, 8, 11, 11, 8, 11, 12, 6, 11, 12, 9, 12, 12, 9, 12, 13, 7, 12, 13, 10, 13, 13, 10, 13, 14, 8, 13, 14, 11, 14
Offset: 0

Views

Author

Alois P. Heinz, Jun 12 2013

Keywords

Examples

			a(19) = 7:
._._._._._._._._._._._._._._._._._._._.
|                 |         |         |
|                 |         |         |
|                 |         |         |
|                 |         |         |
|                 |_________|_________|
|                 |       |       |   |
|                 |       |       |___|
|                 |       |       |   |
|_________________|_______|_______|___|
		

Crossrefs

Row m=9 of A113881, A219158.

Programs

  • Maple
    a:= n-> `if`(n=1, 9, iquo(n, 9, 'r')+[0, 5, 6, 3, 6, 6, 3, 6, 7][r+1]):
    seq(a(n), n=0..100);

Formula

G.f.: x*(4*x^10-4*x^9-6*x^8+x^7+3*x^6-3*x^5+3*x^3-3*x^2-3*x+9) / (x^10-x^9-x+1).
a(n) = 1 + a(n-9) for n>10.
Showing 1-10 of 16 results. Next