1.

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, WS09
* ACM Problem #136 - Ugly Numbers
*
* @author Felix Dietrich
* @version 1.0, 10/26/2009
*
* Methode: Bruteforce
* Status : Accepted
* Runtime: 0.068
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=3&problem=72&mosmsg=Submission+received+with+ID+7512105
*/


public class Main
{
public static void main(String... as)
{
//System.out.println("The 1500'th ugly number is "+ calcnumber() + ".");
System.out.println("The 1500'th ugly number is 859963392.");
}

private static int calcnumber()
{
int number;
int index = 1;
for(int i=1; i<=900000000; i++)
{
if(i==1 || i%2 == 0 || i%3 == 0 || i%5 == 0)
{
if(checknum(i))
{
number = i;
if(index == 1500)
return number;
index++;
//System.out.println(number);
}
}
}
System.out.println(index);
return 0;
}

private static boolean checknum(int i)
{
while(i%2 == 0)
i>>=1;
while(i%3 == 0)
i/=3;
while(i%5 == 0)
i/=5;
return i==1;
}
}