this works: -module(create). -export([create_list/2, create/1]). create(0) -> []; create(Number) -> create_list(Number, [] ). create_list(0, List) -> List; create_list(Number, List) -> create_list( Number -1, [Number | List] ).