-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.cpp
More file actions
37 lines (31 loc) · 1.36 KB
/
tests.cpp
File metadata and controls
37 lines (31 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "tests.h"
void test_mobius() {
std::cout << "Values of the Mobius function for the integers from 0 to 100." << std::endl;
for (unsigned int u = 0; u < 101; u++) {
std::cout << "Mobius(" << u << ") = " << mobiusFunction(u) << std::endl;
}
}
void test_phiFunction() {
std::cout << "Values of the Phi function for the integers from 0 to 100." << std::endl;
for (unsigned int u = 0; u < 101; u++) {
std::cout << "Phi(" << u << ") = " << phiFunction(u) << std::endl;
}
}
void test_tauFunction() {
std::cout << "Values of the Tau function for the integers from 0 to 100." << std::endl;
for (unsigned int u = 0; u < 1000; u++) {
std::cout << "Tau(" << u << ") = " << tauFunction(u) << std::endl;
}
}
void test_sigmaFunction() {
std::cout << "Values of the Sigma function for the integers from 0 to 100." << std::endl;
for (unsigned int u = 0; u < 101; u++) {
std::cout << "Sigma(" << u << ") = " << sigmaFunction(u) << std::endl;
}
}
void test_specialFunction() {
std::cout << "Values of the special function for the integers from 0 to 100." << std::endl;
for (unsigned int u = 0; u < 1000; u++) {
std::cout << "Special(" << u << ") = " << int(pow(double(tauFunction(u)*phiFunction(u)), mobiusFunction(u))*sigmaFunction(u) + phiFunction(u)*mobiusFunction(u)) << std::endl;
}
}