In the 17th century, Blaise Pascal invented a sequence of numbers for calculating the remainder in Euclidean division, and hence for testing whether one integer is divisible by another.

Given a number n, Pascal considers the sequence of remainders obtained by dividing the powers of 10 by n, starting with the zeroth power. For n = 7, this gives:

The remainder of 1 is indeed 1 (!), the remainder of 10 is 3, that of 100 is 2… and the sequence of remainders is periodic. This result is not peculiar to the number 7; it holds in general. There are n possible remainders (from 0 to n – 1). Thus, among the remainders of the powers with exponents from 0 to n, at least two are equal—say, those corresponding to the powers k and k’ (with k > k’, for example). This can be written as 10 k ≡ 10 k \[n\], or equivalently 10 k k ≡ 1 \[n\]. It follows that the sequence is periodic and that its period divides kk ’.

This sequence is the Pascal ribbon associated with 7.