I attempting to test a discrete math theory (for a class) the object of this lesson is determine if we should attempt to prove or disprove the theory by writing a program that runs numbers on it so to speak. If someone could look at my work and let me know if you think I am on the right track or not.
bool __theorem__1();
mpz_class is_odd ( mpz_class input );
mpz_class const RANGEMAX = 10;
int main ( int argc, constchar * argv[] )
{
__theorem__1();
return 0;
}
mpz_class is_odd ( mpz_class input )
{
return input % 2;
}
bool __theorem__1()
{
// set result to 0
mpz_class result = 0;
// for all m
for ( mpz_class m = 0 ; m < RANGEMAX; m++ )
{
// if m is odd
if ( is_odd ( m ) )
{
// set k to 0, and n to 1,
// increment loop until k is greater or equal to m-1
mpz_class k = 0 , n = 1;
for ( ; k >= m - 1; k++, n++ )
{
result += ( n + k );
}
// if m does not a multiple of m then print counter example.
if ( ( result % m ) != 0 )
{
cout << "found counter example with k = : " << k << "and n " << n << endl;
}
else
{
cout << "No counter example found " << endl;
}
}
}
// this is just here for now. I will update bool logic later.
returntrue;
}