Project Euler #225: Tribonacci non-divisors

  • + 0 comments

    Scanner obj = new Scanner(System.in); int t1= obj.nextInt(); int t2 = obj.nextInt(); int t3 = obj.nextInt(); // int k = obj.nextInt(); int d=t3+t1+t2; int x=3; int[] a = new int[100000]; for(int i=5;i<100000;i++) { a[i] = d; t1=t2; t2=t3; t3=d;

            d=t1+t2+t3;
    
        }
        for(int l=5;l<100000;l++)
        {
            for(x=3;x<100000;)
            {
               if(a[l]%x==0)
                    break;
                x=x+2;
            }
        }
        System.out.println(x);
    

    What's wrong in this?