# Thread: calculate the factors of a positive integer number

1. Member Join Date
Mar 2014
Posts
6
Rep Power
0

## calculate the factors of a positive integer number

lines 7, 8, &12 "primes" are underline in red (prime cannot be resolved) is what pops up when i hover over the x's.
i don't get why that is.
Java Code:
```package assignment7;

public class Exercise3
{
public static void main(String[] args)
{
Prime.setSize(1000);
for (int p = Primes.next(); p < 30; p = Primes.next())
{
int n = (int)Math.round(Math.pow(2,p)) - 1;
System.out.printf("%d\t2^%d-1%d", p, p, n);
if (Primes.isPrime(n))
{
System.out.println(" is prime ");
} else
{
System.out.println(" is not prime ");
}
}
}
}```
Last edited by ATB; 03-17-2014 at 01:49 AM.  Reply With Quote

2. Senior Member Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
6,226
Rep Power
14

## Re: calculate the factors of a positive integer number

What is Prime vs Primes? Perhaps you are missing an import statement. And in the future, please place your code
between [code][/code] tags.

Regards,
Jim  Reply With Quote

3. Senior Member Join Date
Feb 2014
Posts
219
Rep Power
7

## Re: calculate the factors of a positive integer number  Reply With Quote

factoring, integers, positive integers 