Ulam-Applet

  long ulam(long x){
if (x==1) {
return 1;
}
else{
if ((x%2)==0){
return ulam (x/2);
}
else{
return ulam (3*x+1);
}
}
}