#ifndef CA3
#define CA3

#include <stdio.h>
#include<math.h>
#include "bn_prime.h"
#include "mpi.h"


#define STATUS "status.txt"
#define n 10069
#define trials 1676.0
#define M_ARY 2

/*
7 -- 2
11 -- 4
1019 -- 508
2579 -- 1288
10069 -- 1676

99923  -- 48852
99961  -- 10752
99971  -- 36864
99989  -- 21420
99991  -- 24000
100003 -- 28560
100019 -- 48840
100049 -- 22464
100069 -- 16080
100103 -- 50050


100057 -- 15120
100043 -- 50020
106261 -- 10560
250007 -- 125002
300023 -- 150010
500231 -- 200088
*/


#define bool char
#define false 0
#define true 1

void run();
void run2();
int m_expn(int b, int r, int num);
int m_exp(int b, int r);
long long ml_exp(long long, int, long long);
void computeResults( const int*, const int*, int*, int* );
void setArrays(int*,bool*, int*, bool*);
bool isPrimRoot(int);
bool isRelPrime(int);
void writeTotalResults(int*, int*, int*, int*, int*, int*, int*);
		
int gcd(int, int);
bool isPrime(int);
bool MillerRabin(int, int, int, int);


#endif