OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
FORMULA
For n > k >= 1, define d(1)=n, d(2)=k, d(j) = d(j-2) - d(j-1) for j >= 3. Then d(j) = F(j-2)*n - F(j-1)*k for odd j>=1 and d(j) = F(j-1)*k - F(j-2)*n for even j>=2, where F(h)=A000045(h) = h-th Fibonacci number. The sequence d is the aforementioned sequence n, k, n-k, 2k-n, 2n-3k, 5k-3n, ...
T(m*n,m*k) = m*T(n,k). - Robert Israel, Jan 20 2018
EXAMPLE
Rows 2,3,4,5,6:
1
2 1
3 2 2
4 3 1 3
5 4 3 2 4
T(8,5)=1, last term before 0 in 8,5,3,2,1,1,0,1,-1,...
T(8,6)=4, last term before -2 in 8,6,2,4,-2,6,-8,14,...
MATHEMATICA
f[n_] := Fibonacci[n]; d[n_, k_, 1] := n; d[n_, k_, 2] := k;
d[n_, k_, j_] := ((-1)^j) (k*f[j - 1] - n*f[j - 2]);
s[n_, k_] := Select[Range[100], d[n, k, # + 1] <= 0 &, 1];
t = Table[d[n, k, s[n, k]], {n, 2, 20}, {k, 1, n - 1}]; (* A097367 array *)
Flatten[t] (* A097367 sequence *)
Table[Min[Flatten[Table[d[n, k, s[n, k]], {k, 1, n - 1}]]], {n, 2, 100}] (* A097368 *)
(* Clark Kimberling, Oct 14 2016 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Clark Kimberling, Aug 09 2004
STATUS
approved