Function to find the maximum among repeated sum and repeated product
public static long maxSumProduct ( long N ) { if ( N < 10 ) return N ; return Math . Max ( repeatedSum ( N ) , repeatedProduct ( N ) ) ; }