rlm@0: program euler6 rlm@0: rlm@0: implicit none rlm@0: character (len = 100) :: file_name rlm@0: integer, parameter :: big = selected_int_kind(11) rlm@0: integer (kind = big) :: n,ans rlm@0: call getarg( 1, file_name ) rlm@0: OPEN(unit = 7, file = file_name) rlm@0: read (7,*) n rlm@0: rlm@0: ans = ((n * (n + 1))/2)**2 - ((n * (n + 1) * (1 + ( 2 * n)))/6) rlm@0: rlm@0: write (unit = *, fmt = "(I0)") ans rlm@0: rlm@0: rlm@0: rlm@0: rlm@0: end program euler6