How to defined a function that will cache the values of a sequence and print "Cached" to standard output every time the value requested from the sequence is actual