|
|
A270826
|
|
Maximum number of iterations needed in the Euclid algorithm for gcd(x,y) in [1..n].
|
|
0
|
|
|
0, 2, 2, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
REFERENCES
|
R. Crandall and C. Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see Theorem 2.1.3 p. 84.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = ceiling(log(n*sqrt(5))/log((sqrt(5)+1)/2)) - 2.
|
|
MATHEMATICA
|
With[{s = Sqrt@ 5}, Table[Ceiling[Log[n s]/Log[(s + 1)/2]] - 2, {n, 89}]] (* Michael De Vlieger, Mar 24 2016 *)
|
|
PROG
|
(PARI) a(n) = ceil(log(n*sqrt(5))/log((sqrt(5)+1)/2)) - 2;
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|