Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to figure out how to solve these types of repeating number sequence problems. Here is one I made up:

Consider the following repeating number sequence: {4, 8, 15, 16, 23, 42, 4, 8, 15, 16, 23, 42, 4, 8, 15, 16, 23, 42,…} in which the first 6 numbers keep repeating. What is the 108th term of the sequence?

I was told that when a group of k numbers repeats itself, to find the *n*th number, divide n by k and take the remainder r. The *r*th term and the *n*th term are always the same. 108 / 6 = 18, r = 0 So the 108th term is equal to the 0th term? Undefined?

I'm confused at how this works.


share|cite|improve this question
Think of your sequence as doubly infinite, $\dots,4,8,15,\dots$, and the zeroth term is the term just before the first term. PS: I just noticed what sequence you are using. Are you sure you're confused, not lost? – Gerry Myerson Jul 22 '11 at 1:52
Yes, hahaha :) Thanks though, I understand now. – stoicfury Jul 22 '11 at 1:57
up vote 5 down vote accepted

You are looking for modular arithmetic. The procedure you described of dividing and taking the remainder is encapsulated in modular arithmetic.

share|cite|improve this answer


In such cases, look at more manageable sample problems. So what would the 5th, 10th, 12th, 17th element (etc.) be? All these can be found by hand, and you can see how the remainder matters.

share|cite|improve this answer

HINT: write the numbers in six columns, and work out how the row number and column number relate to the position in the sequence.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.