-module(program1). -export([start/1]). start( N ) -> sum( N - 1). sum( 1 ) -> 1; sum( M ) -> if ( M rem 3 ) =:= 0 -> M + sum(M-1); ( M rem 5 ) =:= 0 -> M + sum(M-1); true -> sum(M-1) end.