/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package dagobert;

/**
 *
 * @author julia
 */
public class Dagobert {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        int n=1414;
        int m=1000;
        int d=1;
        int q=1;
        int ausgabe=1;
        while (ausgabe<1000000){
            n=n+1;
            d=(n*(n+1))/2;
            while (q<d){
                m=m+1;
                q=m*m;
            }
            if (q==d){
                ausgabe=q;
            }
        }System.out.println("Die gesuchte Zahl ist die "+ausgabe);
    }
    
}
