Skip to content

Instantly share code, notes, and snippets.

@jjrscott
jjrscott / RecursiveSequence.swift
Created March 31, 2022 11:23
Closure based recursive sequence for Swift
//
// RecursiveSequence.swift
//
// Created by John Scott on 31/03/2022.
//
///
/// To define a sequence by recursion, one needs a rule, called recurrence relation to construct each
/// element in terms of the ones before it. In addition, enough initial elements must be provided so
/// that all subsequent elements of the sequence can be computed by successive applications of