OFFSET
1,2
COMMENTS
First quotient=[ n/k ]=Q1; 2nd=[ k/(n-k*Q1) ]; ...
Number of squares in a greedy tiling of an n-by-k rectangle by squares. [David Radcliffe, Nov 14 2012]
LINKS
R. J. Mathar, Table of n, a(n) for n = 1..5050
N. J. A. Sloane, Rows 1 through 100
EXAMPLE
Rows:
1;
2,1;
3,3,1;
4,2,4,1;
5,4,4,5,1;
6,3,2,3,6,1;
7,5,5,5,5,7,1;
...
MAPLE
A049834 := proc(n, k)
local a, b, r, s ;
a := n ;
b := k ;
r := 1;
s := 0 ;
while r > 0 do
q := floor(a/b);
r := a-b*q ;
s := s+q ;
a := b;
b := r;
end do:
s ;
end proc: # R. J. Mathar, May 06 2016
# second Maple program:
T:= (n, k)-> add(i, i=convert(k/n, confrac)):
seq(seq(T(n, k), k=1..n), n=1..14); # Alois P. Heinz, Jan 31 2023
MATHEMATICA
T[n_, k_] := T[n, k] = Which[n < 1 || k < 1, 0, n == k, 1, n < k, T[k, n], True, 1 + T[k, n - k]];
Table[T[n, k], {n, 1, 13}, {k, 1, n}] // Flatten (* Jean-François Alcover, Mar 29 2020 *)
PROG
(PARI) tabl(nn) = {for (n=1, nn, for (k=1, n, a = n; b = k; r = 1; s = 0; while (r, q = a\b; r = a - b*q; s += q; a = b; b = r); print1(s, ", "); ); print(); ); } \\ Michel Marcus, Aug 17 2015
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
STATUS
approved