--- include/permlib/bsgs.h.orig	2016-07-16 17:37:15 UTC
+++ include/permlib/bsgs.h
@@ -39,6 +39,7 @@
 
 #include <boost/cstdint.hpp>
 #include <boost/foreach.hpp>
+#include <boost/next_prior.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/utility.hpp>
--- include/permlib/change/base_transpose.h.orig	2016-07-16 17:37:15 UTC
+++ include/permlib/change/base_transpose.h
@@ -38,6 +38,7 @@
 
 #include <boost/scoped_ptr.hpp>
 #include <boost/iterator/indirect_iterator.hpp>
+#include <boost/next_prior.hpp>
 
 namespace permlib {
 
--- include/permlib/generator/schreier_generator.h.orig	2016-07-16 17:37:15 UTC
+++ include/permlib/generator/schreier_generator.h
@@ -39,6 +39,7 @@
 #include <stack>
 #include <boost/scoped_ptr.hpp>
 #include <boost/tuple/tuple.hpp>
+#include <boost/next_prior.hpp>
 
 namespace permlib {
 
--- include/permlib/permutation.h.orig	2016-07-16 17:37:15 UTC
+++ include/permlib/permutation.h
@@ -48,7 +48,7 @@
 #include <boost/dynamic_bitset.hpp>
 #include <boost/foreach.hpp>
 #include <boost/cstdint.hpp>
-#include <boost/math/common_factor_rt.hpp>
+#include <boost/integer/common_factor_rt.hpp>
 
 namespace permlib {
 
@@ -343,7 +343,7 @@ inline boost::uint64_t Permutation::order() const {
 	std::list<CyclePair> cycleList = this->cycles();
 	boost::uint64_t ord = 1;
 	BOOST_FOREACH(const CyclePair& cyc, cycleList) {
-		ord = boost::math::lcm(ord, static_cast<boost::uint64_t>(cyc.second));
+		ord = boost::integer::lcm(ord, static_cast<boost::uint64_t>(cyc.second));
 	}
 	return ord;
 }
--- include/permlib/test/giant_test.h.orig	2016-07-16 17:37:15 UTC
+++ include/permlib/test/giant_test.h
@@ -40,7 +40,7 @@
 #include <permlib/prime_helper.h>
 
 #include <boost/foreach.hpp>
-#include <boost/math/common_factor_rt.hpp>
+#include <boost/integer/common_factor_rt.hpp>
 #include <cmath>
 #include <algorithm>
 
@@ -195,7 +195,7 @@ GiantTestBase::GiantGroupType GiantTest<PERM>::determi
 				for (unsigned int k = 0; k < cycleLength.size(); ++k) {
 					if (j == k)
 						continue;
-					if (boost::math::gcd(cycleLength[j], cycleLength[k]) != 1) {
+					if (boost::integer::gcd(cycleLength[j], cycleLength[k]) != 1) {
 						isCoprime = false;
 						break;
 					}
--- include/permlib/test/primitivity_sgs_test.h.orig	2016-07-16 17:37:15 UTC
+++ include/permlib/test/primitivity_sgs_test.h
@@ -39,6 +39,7 @@
 #include <boost/foreach.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/utility.hpp>
+#include <boost/next_prior.hpp>
 #include <vector>
 #include <list>
 
--- include/permlib/test/type_recognition.h.orig	2016-07-16 17:37:15 UTC
+++ include/permlib/test/type_recognition.h
@@ -44,7 +44,7 @@
 #include <permlib/permlib_api.h>
 
 #include <boost/shared_ptr.hpp>
-#include <boost/math/common_factor_rt.hpp>
+#include <boost/integer/common_factor_rt.hpp>
 #include <iostream>
 
 
@@ -344,7 +344,7 @@ GroupType* TypeRecognition<PERM,TRANSVERSAL>::largeSym
 	
 	size_t orbitGCD = orbits.front()->size();
 	BOOST_FOREACH(const OrbitPtr& orbit, orbits) {
-		orbitGCD = boost::math::gcd(orbitGCD, orbit->size());
+		orbitGCD = boost::integer::gcd(orbitGCD, orbit->size());
 	}
 	
 	GroupType* lastType = 0;
