

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

Table of n, a(n) for n=1..89.


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

Sequence in context: A326539 A297995 A081228 * A003002 A087180 A029121
Adjacent sequences: A270823 A270824 A270825 * A270827 A270828 A270829


KEYWORD

nonn


AUTHOR

Michel Marcus, Mar 23 2016


STATUS

approved



