You have the operator [End|Acc] to cons End on to the list Acc. See below. Preferably, you implement seq from the end to the start. seq(Start, End) -> seq(Start, End, []). seq(Start, End, Acc) when Start =< End -> seq(Start, End-1, [End|Acc]); seq(_, _, Acc) -> Acc.