|
|
A266394
|
|
Square array a(n,k) is the number of terms in the "continued fraction" of the form -k1 + 1/(k2 - 1/(k3 -1/( ... for the fraction -k/n.
|
|
0
|
|
|
1, 4, 2, 7, 1, 3, 10, 5, 5, 4, 13, 4, 1, 2, 5, 16, 8, 6, 8, 6, 6, 19, 7, 8, 1, 6, 3, 7, 22, 11, 4, 7, 11, 2, 7, 8, 25, 10, 9, 5, 1, 5, 9, 4, 9, 28, 14, 11, 11, 8, 14, 7, 7, 8, 10, 31, 13, 7, 4, 9, 1, 9, 2, 3, 5, 11, 34, 17, 12, 10, 9, 9, 17, 9, 12, 10, 9, 12
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
a(n,k) is the number of steps to reach 0 for the fraction -k/n in the following process: if the fraction f is positive, it is replaced by 1/f; and if it is negative, it is replaced by f+1.
|
|
LINKS
|
|
|
EXAMPLE
|
a(1, 3) is the number of steps for -3/1: -3 -> -2 -> -1 -> 0 = 3 steps.
a(3, 1) is the number of steps for -1/3: -1/3 -> 2/3 -> -3/2 -> -1/2 -> 1/2 -> -2 -> -1 -> 0 = 7 steps.
The array begins:
1, 2, 3, 4, 5, ...
4, 1, 5, 2, 6, ...
7, 5, 1, 8, 6, ...
10, 4, 6, 1, 11, ...
13, 8, 8, 7, 1, ...
...
|
|
PROG
|
(PARI) trans(f) = if (f > 0, -1/f, if (f < 0, f+1, f));
count(f) = nb = 0; while(f!=0, f = trans(f); nb++); nb;
tabl(nn) = {for (n=1, nn, for (k=1, nn, print1(count(-k/n), ", "); ); print(); ); }
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|