```
using System;
namespace PrimeNumber
{
class Program
{
/// <summary>
/// Verify if given number is prime.
/// </summary>
/// <param name="number"></param>
/// <returns>true if number is prime, false otherwise.</returns>
static bool IsPrimeNumber(int number)
{
int divisionCount = 0;
int index_number = number;
while (index_number > 0)
{
if (number % index_number == 0)
divisionCount++;
index_number--;
}
return (divisionCount == 2);
}
/// <summary>
/// Aplication entry point
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
//by definition, composite odd number is a number that is not prime
for (int number = 1; number < 100; number++)
{
if (IsPrimeNumber(number))
Console.WriteLine("prime number -> {0}", number);
else
Console.WriteLine("composite odd number -> {0}", number);
}
Console.ReadKey();
}
}
}
```

12,894,200 members (51,915 online)

Email

Password

Sign in with

I need to input an Odd composite number then the answer must be in this form

Q = p + 2 * b^2

where: Q = is the input number

P and B must be an Prime number

For example:

25 = 7 + 2 * 3 ^ 2

25 = 25

I have my code BUT I only have ONE Problem, i can only input an ODD number which is not searching if its composite number.

I need to input an Odd composite number then the answer must be in this form

Q = p + 2 * b^2

where: Q = is the input number

P and B must be an Prime number

For example:

25 = 7 + 2 * 3 ^ 2

25 = 25

I have my code BUT I only have ONE Problem, i can only input an ODD number which is not searching if its composite number.

In that Odd numbers, I need to have only the Odd Composite number.. (Odd numbers which is Composite number also)