Answer
procedure repeated $(a_1, a_2, ... a_n: $ a sequence of $n$ integers $)$
for $i:= 2$ to $n$
$\space\space\space$ for $k:=1$ to $i$
$\space\space\space$$\space\space\space$ if $a_i$ is equal to $a_k$ then return $a_i$
return undefined
{Since the question does not specify what to return in case no match is made - we cannot choose to return 0 or -1 since an integer can take these values; however, an integer may not be undefined which indicates to a user that an error has occurred}
Work Step by Step
This algorithm attempts to find the first integer value that is equal to a preceding term. The solution is a brute-force type of solution since it just compares each value to each value before it and checks if they are the same.
There are more elegant solutions but those require techniques that are beyond a discrete mathematics course (An example for example would be efficiently storing a list of the values that we've already found and then referencing the new value to see if it matches any previous result.)