Exercise: Proc seq
You are given the function:
def procseq(n, sequencer, alive, update, init):
"""Return the accumulated value in the sequence seeded by n using sequencer function. """
store = init
while alive(n):
store = update(store, n)
n = sequencer(n)
return store
Also a function collatz(n) that computes the next number in the Collatz sequence.
Find the largest positive integer \(n\) with the largest Collatz length and \(1 < n < k\) for a given \(k\)?