PrimzahlenFinden
Aus ProgrammingWiki
Archivierte Version vom 2010-08-26T19:18:59+00:00. Aktuelle Version
<eval id="4c76bdbc4c38f"> boolean istPrimzahl(int n) { int counter = 2; boolean value = true; while(counter < n) { if((n % counter) == 0) { value = false; } counter++; } return value; }</eval>
for(int x = 1; x < 1000; x++){
if(istPrimzahl(x)) {
if((909947.0f / x) == Math.floor(909947.0f / x)) {
System.out.println(x);
}
}}