Program to print the number as a sum of consecutives
Your algorithm, being \$O(\sqrt n)\$, is pretty efficient.  I just think that your code could just a bit of cleanup.

Your print() function does all kinds of things, mostly unrelated to printing.  You should separate the code for the user interaction from the calculation.  (Since each result is a pair of numbers, and there will be an indeterminate number of results, I'd use a callback.)  You should also extract the loop the prints each series into a helper function.  (Executing many System.out.print() statements can be surprisingly slow, as each one is a separate I/O operation.)

Your mathematical reasoning was not clear to me at first.  I would have preferred a comment that more clearly explained the nomenclature and used fewer words.

// n = a + (a+1) + ... + (a+i-1) (Given n, find all a&gt;0 and i&gt;=2)
//
// 2n = i(2a + (i-1))            (arithmetic series formula)
//
// a = (2n - i(i-1)) / 2i
//
// 2n &gt; i(i-1)                   (because a&gt;0 and i&gt;0)
//
// 2 &lt;= i &lt; (1+sqrt(1+8n))/2     (quadratic formula)


Since this is supposed to be an exercise in integer arithmetic, you should avoid using doubles.  Use either int or long.  Note that I have avoided your a = n/i - (i-1)/2, which involves non-integer division.

Actually, you don't need to calculate max_i.  You don't really trust that bound, and you test for a &gt; 0 anyway.

Suggested solution

import java.util.Scanner;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;
import java.util.stream.LongStream;

public class Consecutives {
    /**
     * Find integers a&gt;0 and i&gt;=2 such that n = a + (a+1) + ... + (a+i-1).
     *
     * @param n        The target sum.
     * @param callback A function that will be called with parameters a and i
     *                 for each solution found.
     */
    public static void findSeries(long n, BiConsumer&lt;Long, Long&gt; callback) {
        // n = a + (a+1) + ... + (a+i-1) (Given n, find all a&gt;0 and i&gt;=2)
        //
        // 2n = i(2a + (i-1))            (arithmetic series formula)
        //
        // a = (2n - i(i-1)) / 2i

        for (long i = 2; ; i++) {
            long aNumer = 2 * n - i * (i - 1);
            long aDenom = 2 * i;
            if (aNumer &lt;= 0) break;
            if (aNumer % aDenom == 0) {
                callback.accept(aNumer / aDenom, i);
            }
        }
    }

    /**
     * Form a string of all integers in the range [a, a+i), separated by space.
     */
    private static String spaceDelimitedRange(long a, long i) {
        return LongStream.range(a, a+i)
                         .mapToObj(String::valueOf)
                         .collect(Collectors.joining(" "));
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter number: ");
        findSeries(
            scanner.nextLong(),
            (a, i) -&gt; System.out.println(spaceDelimitedRange(a, i))
        );
    }
}