begin
        comment
                        ALGOL Praktikum, Dr. Karl Nickel, 1964,
                        page 215 (Aufgabe 40)

                ``Teilsummen-Formel nach Euler.
                  Bearbeitung nach Herrn Ulrich Arnold.
                  Optimum''
        ;


        integer K, N, U, T, L; integer array B[1:30], S[0:200] ;


        B[1] := 1 ;

        for K := 2 step 2 until K + 200 - B[K - 1]  do

        begin   B[K] := B[K - 1] + K/2 ;

                B[K + 1] := B[K] + K + 1

        end ;

        for N := 1 step 1 until 200 do

        begin   S[0] := N ;  U := -1 ;  T := 0 ;  L := N - 1 ;

                for K := 2 step 1 until K + L do

                begin   T := S[L] + T*U ;

                        L := N - B[K] ;

                        U := -U
                end ;

                S[N] := abs( T ) ;

                outinteger (1, N);
                outinteger (1, S[N]);
                outstring (1, "\n")
        end
end
