Defined is the recursive relation
Demanded is modulo .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
The generating function of the sequence is ( 1 − x ) ( 1 − 3 x ) 1 + 4 x , with gives the closed form formula for the sequence
a n = 2 7 × 3 n − 5
the rest is some modular arithmetic, when n = 1 0 0 0 is plugged in.