# Is my conjecture correct? Any advice on how to solve this conjecture?

I was doing problem 6.3 from here.

To make this less programming and more math oriented: GCDMany is equivalent to using Euclid's method (using mods and NOT subtraction) on an arbitrary number of elements. The problem essentially wants me to calculate how many times I have to recursively call GCDMany given numbers that are $n$ bits long (i.e. 3 (11) is 2 bits long, 1 (1) is 1 bit long 0 (0) is 1 bit long and so on).

The GCDMany upper bound ultimately given was $2n$ as you can see in the answer. I believe I came up with a tighter upper bound.

I did a bit of experimenting with this program I made to test values:

from itertools import combinations
for i in range(1, 25+1): #1 to 200 bits
j = range(i)
best = 0
for c in combs:
count = gcd_many(list(c))[1] if count > best:
best = count
print best


First off, I realized after experimenting the worst case scenario always seemed to be when GCDMany was passed only two numbers, making my testing essentially concerned with only the standard GCD function. My logic was: Given there is a longest recursive call, any addition of numbers would result in a path less than or equal to the current path, hence 2 numbers would be the worse case.

My program came up with the following: 1, 3, 4, 6, 7 ... Using OEIS.org I found a series of closed forms for it. Most notably this one seemed legit:

$$a(n) = \frac{6n - 1 + (-1)^n}{4}$$

Can anyone confirm or deny my upper bound, and possibly help me figure out what I can do to prove my conjecture if it is correct?

• I don't quite understand. Can you state concisely exactly what property it is that you think the sequence 1,3,4,6,7,... has? – Nate Eldredge Apr 22 '14 at 5:20
• Also, you talk about GCDmany being given a number that is less than $n$ bits; but I thought it was supposed to take as input several numbers? – Nate Eldredge Apr 22 '14 at 5:23
• @NateEldredge: All my stuff is from experimentation as I can't think of anyway to prove this with my knowledge of discrete math. Honestly, the reason why I choose that particular $a(n)$ is relatively arbitrary, simply because it was the simplest closed form that matched up with my experimentation. – Dair Apr 22 '14 at 5:56
• @NateEldredge: Edited question to reflect it is multiple numbers, that was a typo. – Dair Apr 22 '14 at 5:57
• @NateEldredge: Also, I am not looking for an answer necessarily, just guidance on what to do to confirm or deny this conjecture, and if it is false, advice as what to look into to come up with a correct solution, as I believe I can find a better upper bound than the solution given. – Dair Apr 22 '14 at 5:58