Say I have a sequence a(n) = 100 + n^2 with n ranging through the positive integers. I want to find the largest number g(n) such that g(n) = gcd(a(n), a(n+1)).(adsbygoogle = window.adsbygoogle || []).push({});

Let g be a number that divides both a(n) and a(n+1)

g | 100 + n^2 and g | 100 + n^2 + 2n + 1 therefore g | 2n + 1. This means that g must be an odd number since it divides another odd number.

g | 100 + n^2 so g | 100(1 + (n^2)/100) -> g | 100 or g | 1 + (n/10)^2

if g | 100 then g | n^2 which means that n is a multiple of 5 since the only odd divisors of 100 are 5, 25 and 1 with 1 being trivial. This cannot be the case since g must also divide 2n + 1. Therefore g | 1 + (n/10)^2 which implies that n is a multiple of 10 since 1 + (n/10)^2 must be an integer. Let n = 10k.

So now we have

g | k^2 + 1 and g | 20k + 1

I have no idea how to proceed from this point. In fact I'm not even sure that I'm on the right track. If anyone can show me how to proceed from this point, or even if they have a completely alternate solution I'd much appreciate it. I am not used to these kinds of problems so please be as thorough as possible otherwise I will have trouble keeping up.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Largest GCD of consequtive elements in a sequence.

**Physics Forums | Science Articles, Homework Help, Discussion**