OFFSET
0,1
COMMENTS
The classical Euclidean algorithm iterates the mapping u(x,y) = (y, (x mod y)) until reaching g = GCD(x,y) in a pair ( . , g). In much the same way, the modified algorithm (A228247) iterates the mapping v(x,y) = (y, y - (x mod y)). The accelerated Euclidean algorithm uses w(x,y) = min(u(x,y),v(x,y)). Let s(x,y) be the number of applications of u, starting with (x,y) -> u(x,y) needed to reach ( . , g), and let u'(x,y) be the number of applications of w to reach ( . , g). Then u'(x,y) <= u(x,y) for all (x,y).
Starting with a pair (x,y), at each application of w, record 0 if w( . , . ) = u( . , . ) and 1 otherwise. The trace of (x,y), denoted by trace(x,y), is the resulting 01 word, whose length is the total number of applications of w.
Conjecture: a(n) is the least positive integer c for which there is a positive integer b for which trace(b,c) consists of the first n letters of 01010101010101...
LINKS
Clark Kimberling, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,6,0,1).
FORMULA
G.f.: (x^3 + x^2 + 8*x + 2)/(1 - 6*x^2 - x^4). - Ralf Stephan, Aug 24 2013
EXAMPLE
a(3) = 13 because trace(18/13) = 010, and 13 is the least c for which there is a number b such that trace(b/c) = 010. Successive applications of w are indicated by (18,13)->(13,5)->(5,2)->(2,1). Whereas w finds GCD in 3 steps, u takes 4 steps, as indicated by (18,3)->(13,5)->(5,3)->(3,2)->(2,1).
MATHEMATICA
c1 = CoefficientList[Series[(2 + 8 x + x^2 + x^3)/(1 - 6 x^2 - x^4), {x, 0, 40}], x]; c2 = CoefficientList[Series[(3 + 11 x + 2 x^3)/(1 - 6 x^2 - x^4), {x, 0, 40}], x]; pairs = Transpose[CoefficientList[Series[{-((3 + 11 x + 2 x^3)/(-1 + 6 x^2 + x^4)), -((2 + 8 x + x^2 + x^3)/(-1 + 6 x^2 + x^4))}, {x, 0, 20}], x]]; t[{x_, y_, _}] := t[{x, y}]; t[{x_, y_}] := Prepend[If[# > y - #, {y - #, 1}, {#, 0}], y] &[Mod[x, y]]; userIn2[{x_, y_}] := Most[NestWhileList[t, {x, y}, (#[[2]] > 0) &]]; Map[Map[#[[3]] &, Rest[userIn2[#]]] &, pairs] (* Peter J. C. Moses, Aug 20 2013 *)
LinearRecurrence[{0, 6, 0, 1}, {2, 8, 13, 49}, 30] (* T. D. Noe, Aug 23 2013 *)
PROG
(PARI) Vec((x^3+x^2+8*x+2)/(1-6*x^2-x^4)+O(x^99)) \\ Charles R Greathouse IV, Jun 12 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Aug 22 2013
STATUS
approved