SHELL=/bin/ksh
PREFIX=$(HOME)
CPPFLAGS=-I/opt/local/include
#CPPFLAGS=-DDONT_USE_EVEN_OMISSION_IN_BIT_TABLE -I/opt/local/include
CFLAGS=-W -Wall -O3
LDFLAGS=-L/opt/local/lib
LDLIBS=-lm

EXES=\
isprime	\
iscomposite	\
primes	\
primes_reverse	\
n_primes	\
n_primes_reverse	\
composites	\
factorize	\
composite	\
gcd	\
lcm	\
divisors	\
n_divisors	\
sum_divisors	\
\
next_prime	\
previous_prime	\
\
next_composite	\
previous_composite	\
\
integer_valued_polynomial_progression	\
prime_polynomial_progression	\
\
highlycomposites	\
highlyabundants	\
superabundants	\
\
naturals	\
\
totient_function	\
cototient_function	\
mebius_function	\

all: $(EXES)

clean:
	rm -f $(EXES)

install:
	for f in $(EXES); do cp "$$f" $(PREFIX)/bin/c-"$$f"; done

uninstall:
	for f in $(EXES); do rm $(PREFIX)/bin/c-"$$f"; done

archive:
	gnutar --transform='s|^.|prime_util-c|' -cjf ../../../prime_util-c-$$(date +'%Y%m%d').tar.bz2 ./

collate_naturals.oeis:
	diff <(./naturals -type abundant -u 271) <(/usr/bin/curl -s https://oeis.org/A005101/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/ //g' -e 's/,/\n/g')
	diff <(./naturals -type alternating_factorial -u 442386620) <(/usr/bin/curl -s https://oeis.org/A005165/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 13 | sed -e 1d)
		-diff <(./naturals -type amicable -u 142311 | sed "s/`printf '\t'`/\n/g") <(/usr/bin/curl -s https://oeis.org/A063990/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/ //g' -e 's/,/\n/g')
	diff <(./naturals -type arithmetic -u 106 | cut -d "`printf '\t'`" -f 1) <(/usr/bin/curl -s https://oeis.org/A003601/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/ //g' -e 's/,/\n/g')
# augumented_amicable
#		diff <(./naturals -type betrothed -u 1081184 | sed "s/`printf '\t'`/\n/g") <(/usr/bin/curl -s https://oeis.org/A005276/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/ //g' -e 's/,/\n/g')
		-diff <(./naturals -type betrothed -u 196665 | sed "s/`printf '\t'`/\n/g") <(/usr/bin/curl -s https://oeis.org/A005276/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/ //g' -e 's/,/\n/g' | head -n 20)
		diff <(./naturals -type catalan -u 477638701) <(/usr/bin/curl -s https://oeis.org/A000108/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/ //g' -e 's/,/\n/g' | head -n 19)
	diff <(./naturals -type composite -u 89) <(/usr/bin/curl -s https://oeis.org/A002808/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/ //g' -e 's/,/\n/g')
	diff <(./naturals -type cousin_primes -u 1484 | cut -d "`printf '\t'`" -f 1) <(/usr/bin/curl -s https://oeis.org/A023200/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type cousin_primes -u 1430 | cut -d "`printf '\t'`" -f 2) <(/usr/bin/curl -s https://oeis.org/A046132/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type cube_free -u 86) <(/usr/bin/curl -s http://oeis.org/A004709/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
# cullen
	diff <(./naturals -type cullen_prime -u "`echo '10^9' | bc`" | cut -d "`printf '\t'`" -f 2) <(/usr/bin/curl -s https://oeis.org/A005849/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 1)
	diff <(./naturals -type deficient -u 87) <(/usr/bin/curl -s https://oeis.org/A005100/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type derangement -u 176214842) <(/usr/bin/curl -s https://oeis.org/A000166/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 13)
# doublly_even
	diff <(./naturals -type euclid -u 223092872) <(/usr/bin/curl -s https://oeis.org/A006862/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 10 | sed -e 1d)
	diff <(./naturals -type euclid_prime -u 1000000000) <(/usr/bin/curl -s https://oeis.org/A018239/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 6 | sed -e 1d)
	-diff <(./naturals -type exponential_factorial -u 262145) <(/usr/bin/curl -s https://oeis.org/A049384/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type even_semifactrial -u 1000000000) <(/usr/bin/curl -s https://oeis.org/A000165/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 10)
	diff <(./naturals -type factorial_prime -u 479001600 | uniq) <(/usr/bin/curl -s https://oeis.org/A088054/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 9)
	diff <(./naturals -type fermat -u 65538) <(/usr/bin/curl -s https://oeis.org/A000215/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 5)
	diff <(./naturals -type fibonacci -u 39088170) <(/usr/bin/curl -s https://oeis.org/A000045/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type fortunate -u 1000000000 | cut -d "`printf '\t'`" -f 1) <(/usr/bin/curl -s https://oeis.org/A005235/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 9)
# friendly
		diff <(./naturals -type harmonic_divisor -u 1539721) <(/usr/bin/curl -s https://oeis.org/A001599/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type hemiperfect -u 4321 | cut -d "`printf '\t'`" -f 1) <(/usr/bin/curl -s https://oeis.org/A088912/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 3)
# !
	diff <(./naturals -type highly_cototient | cut -d "`printf '\t'`" -f 1) <(/usr/bin/curl -s https://oeis.org/A100827/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 2)
# !
	diff <(./naturals -type highly_totient | cut -d "`printf '\t'`" -f 1) <(/usr/bin/curl -s https://oeis.org/A097942/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 3)
	diff <(./naturals -type highlyabundant -u 2101) <(/usr/bin/curl -s https://oeis.org/A002093/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
		diff <(./naturals -type highlycomposite -u 2162161) <(/usr/bin/curl -s https://oeis.org/A002182/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type hilbert -u 238) <(/usr/bin/curl -s https://oeis.org/A016813/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type hyperfactorial -u 1000000000) <(/usr/bin/curl -s https://oeis.org/A002109/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 6 | sed -e 1d)
	diff <(./naturals -type interprime -u 311) <(/usr/bin/curl -s https://oeis.org/A024675/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type jacobsthal -u 10000000000) <(/usr/bin/curl -s https://oeis.org/A001045/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type jacobsthal_lucas -u 10000000000) <(/usr/bin/curl -s https://oeis.org/A014551/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type kummer -u 1000000000) <(/usr/bin/curl -s https://oeis.org/A057588/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 9)
	diff <(./naturals -type kummer_prime -u 1000000000) <(/usr/bin/curl -s https://oeis.org/A057705/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 4)
	diff <(./naturals -type kynea -u 10000000000) <(/usr/bin/curl -s https://oeis.org/A093069/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 16)
	diff <(./naturals -type lazy_caterer -u 1380) <(/usr/bin/curl -s https://oeis.org/A000124/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type leonardo -u 100000000) <(/usr/bin/curl -s https://oeis.org/A001595/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type lucas -u 33385283) <(/usr/bin/curl -s https://oeis.org/A000032/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type lucas_carmichael -u 10000) <(/usr/bin/curl -s https://oeis.org/A006972/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 8)
	diff <(./naturals -type mersenne -u 1000000000) <(/usr/bin/curl -s https://oeis.org/A001348/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 10)
	diff <(./naturals -type mersenne_prime -u 1000000000) <(/usr/bin/curl -s https://oeis.org/A000668/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 7)
	diff <(./naturals -type motzkin -u 400763224) <(/usr/bin/curl -s https://oeis.org/A001006/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 23)
	diff <(./naturals -type multiperfect -u 523777) <(/usr/bin/curl -s https://oeis.org/A007691/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 10)
	diff <(./naturals -type natural -u 78) <(/usr/bin/curl -s https://oeis.org/A000027/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
#		diff <(./naturals -type non_prime_unusual -u 1000000000) <(/usr/bin/curl -s https://oeis.org/A064052/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
		diff <(./naturals -type noncototient -u 10000) <(/usr/bin/curl -s https://oeis.org/A005278/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 7)
		diff <(./naturals -type nontotient -u 10000) <(/usr/bin/curl -s https://oeis.org/A005277/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 13)
	diff <(./naturals -type odd -u 132) <(/usr/bin/curl -s https://oeis.org/A005408/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type odd_semifactrial -u 1000000000) <(/usr/bin/curl -s https://oeis.org/A001147/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 11 | sed -e '1d')
	-diff <(./naturals -type padovan -u 170626) <(/usr/bin/curl -s https://oeis.org/A000931/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type pell -u 543339721) <(/usr/bin/curl -s https://oeis.org/A000129/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 25)
	diff <(./naturals -type perfect -u 8129) <(/usr/bin/curl -s https://oeis.org/A000396/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 4)
	diff <(./naturals -type perfect_power -u 1765) <(/usr/bin/curl -s https://oeis.org/A001597/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type perfect_square -l 0 -u 2501) <(/usr/bin/curl -s https://oeis.org/A000290/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type perfect_totient -u 10000) <(/usr/bin/curl -s https://oeis.org/A082897/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 22)
	diff <(./naturals -type perrin -u 313008) <(/usr/bin/curl -s https://oeis.org/A001608/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type power_of_two -u 8589934593) <(/usr/bin/curl -s https://oeis.org/A000079/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type powerful -u 161) <(/usr/bin/curl -s https://oeis.org/A013929/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type practical -u 253) <(/usr/bin/curl -s https://oeis.org/A005153/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type primary_pseudoperfect -u 100000) <(/usr/bin/curl -s https://oeis.org/A054377/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 5)
	diff <(./naturals -type prime -u 272) <(/usr/bin/curl -s https://oeis.org/A000040/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type prime_kynea -u 1000000000) <(/usr/bin/curl -s https://oeis.org/A091514/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 8 | sed -e 1d)
	diff <(./naturals -type prime_thabit -u 1000000000) <(/usr/bin/curl -s https://oeis.org/A007505/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 9)
	diff <(./naturals -type primitive_abundant -u 4289) <(/usr/bin/curl -s https://oeis.org/A071395/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type primitive_abundant_have_no_abundant_proper_divisor -u 823) <(/usr/bin/curl -s https://oeis.org/A091191/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type primitive_pseudoperfect -u 5000) <(/usr/bin/curl -s http://oeis.org/A006036/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type pronic -u 2551) <(/usr/bin/curl -s https://oeis.org/A002378/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type pseudoperfect -u 265) <(/usr/bin/curl -s https://oeis.org/A005835/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
# primorial_ruth_aaron_pair
	diff <(./naturals -type refactorable -u 537) <(/usr/bin/curl -s https://oeis.org/A033950/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	-diff <(./naturals -type regular -u 406 | sort -n) <(/usr/bin/curl -s https://oeis.org/A051037/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
# regular
	diff <(./naturals -type round_number -u 196) <(/usr/bin/curl -s http://oeis.org/A048098/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
		diff <(./naturals -type ruth_aaron_pair -u 43216 | cut -d "`printf '\t'`" -f 1) <(/usr/bin/curl -s https://oeis.org/A039752/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type schreder_hipparchus -u 372693520) <(/usr/bin/curl -s https://oeis.org/A001003/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 15)
	diff <(./naturals -type semiprime -u 200 | cut -d "`printf '\t'`" -f 1 | head -n 61) <(/usr/bin/curl -s https://oeis.org/A001358/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type sexy_primes -u 648 | cut -d "`printf '\t'`" -f 1) <(/usr/bin/curl -s https://oeis.org/A023201/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type sexy_primes -u 608 | cut -d "`printf '\t'`" -f 2) <(/usr/bin/curl -s https://oeis.org/A046117/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type sophie_germain_prime -u 1560 | cut -d "`printf '\t'`" -f 1) <(/usr/bin/curl -s https://oeis.org/A005384/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type sphenic -u 500 | cut -d "`printf '\t'`" -f 1 | head -n 53) <(/usr/bin/curl -s https://oeis.org/A007304/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type square_free -u 114) <(/usr/bin/curl -s https://oeis.org/A005117/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type square_triangular -u 1631432882) <(/usr/bin/curl -s https://oeis.org/A001110/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 8)
	diff <(./naturals -type squared_triangular -u 549082) <(/usr/bin/curl -s https://oeis.org/A000537/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type superabundant -u 10081) <(/usr/bin/curl -s https://oeis.org/A004394/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 20)
	diff <(./naturals -type superperfect -u 100000) <(/usr/bin/curl -s https://oeis.org/A019279/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 6)
	diff <(./naturals -type sylvester -u 3263444) <(/usr/bin/curl -s https://oeis.org/A000058/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 6)
	diff <(./naturals -type telephone -u 997313825) <(/usr/bin/curl -s https://oeis.org/A000085/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 19)
	diff <(./naturals -type thabit -u 1610612736) <(/usr/bin/curl -s https://oeis.org/A055010/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | sed -e 1d)
	diff <(./naturals -type triangular -u 1432) <(/usr/bin/curl -s https://oeis.org/A000217/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type tetrahedral -u 15181) <(/usr/bin/curl -s https://oeis.org/A000292/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	-diff <(./naturals -type pentatope -u 123411) <(/usr/bin/curl -s https://oeis.org/A000332/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type pentagonal -u 3152) <(/usr/bin/curl -s https://oeis.org/A000326/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type twin_prime -u 1608 | cut -d "`printf '\t'`" -f 1 | head -n 53) <(/usr/bin/curl -s https://oeis.org/A001359/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	diff <(./naturals -type unitary_perfect -u 87361) <(/usr/bin/curl -s https://oeis.org/A002827/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 4)
	diff <(./naturals -type unusual -u 103) <(/usr/bin/curl -s https://oeis.org/A064052/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
	-diff <(./naturals -type weird -u 19671) <(/usr/bin/curl -s https://oeis.org/A006037/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g')
# wilson_prime
	diff <(./naturals -type wilson_quotient -u 1000000000) <(/usr/bin/curl -s https://oeis.org/A007619/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 6)
	diff <(./naturals -type woodall -u 838860800 | cut -d "`printf '\t'`" -f 1) <(/usr/bin/curl -s https://oeis.org/A003261/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 25)
	diff <(./naturals -type woodall_prime -u 1000000000 | cut -d "`printf '\t'`" -f 1) <(/usr/bin/curl -s https://oeis.org/A050918/list | xmllint --html --xpath '/html/body/center[2]/table/tr/td/center/table/tr/td[pre]/pre/text()' - | sed -ne 'H;$${x;s/\n//g;p}' | sed -e 's/\[\(.*\)\]/\1\n/' -e 's/[ \\]//g' -e 's/,/\n/g' | head -n 3)

collate_naturals: collate_naturals.00 collate_naturals.01 collate_naturals.02

collate_naturals.00:
	diff <(time ./naturals -type natural -u 1000000) <(time ../gmpxx/naturals -type natural -u 1000000) > /dev/null
	diff <(time ./naturals -type odd -u 1000000) <(time ../gmpxx/naturals -type odd -u 1000000) > /dev/null
	diff <(time ./naturals -type even -u 1000000) <(time ../gmpxx/naturals -type even -u 1000000) > /dev/null
	diff <(time ./naturals -type singly_even -u 1000000) <(time ../gmpxx/naturals -type singly_even -u 1000000) > /dev/null
	diff <(time ./naturals -type composite -u 1000000) <(time ../gmpxx/naturals -type composite -u 1000000) > /dev/null
	diff <(time ./naturals -type prime -u 1000000) <(time ../gmpxx/naturals -type prime -u 1000000) > /dev/null
	diff <(time ./naturals -type sophie_germain_prime -u 1000000) <(time ../gmpxx/naturals -type sophie_germain_prime -u 1000000) > /dev/null
	diff <(time ./naturals -type twin_prime -u 1000000) <(time ../gmpxx/naturals -type twin_prime -u 1000000) > /dev/null
	diff <(time ./naturals -type cousin_primes -u 1000000) <(time ../gmpxx/naturals -type cousin_primes -u 1000000) > /dev/null
	diff <(time ./naturals -type sexy_primes -u 1000000) <(time ../gmpxx/naturals -type sexy_primes -u 1000000) > /dev/null
	diff <(time ./naturals -type powerful -u 10000) <(time ../gmpxx/naturals -type powerful -u 10000) > /dev/null
	diff <(time ./naturals -type highlycomposite -u 100000) <(time ../gmpxx/naturals -type highlycomposite -u 100000) > /dev/null
	diff <(time ./naturals -type superabundant -u 100000) <(time ../gmpxx/naturals -type superabundant -u 100000) > /dev/null
	diff <(time ./naturals -type abundant -u 100000) <(time ../gmpxx/naturals -type abundant -u 100000) > /dev/null
	diff <(time ./naturals -type perfect -u 100000) <(time ../gmpxx/naturals -type perfect -u 100000) > /dev/null
	diff <(time ./naturals -type multiperfect -u 100000) <(time ../gmpxx/naturals -type multiperfect -u 100000) > /dev/null
	diff <(time ./naturals -type deficient -u 100000) <(time ../gmpxx/naturals -type deficient -u 100000) > /dev/null
	diff <(time ./naturals -type ruth_aaron_pair -u 10000) <(time ../gmpxx/naturals -type ruth_aaron_pair -u 10000) > /dev/null
	diff <(time ./naturals -type primorial_ruth_aaron_pair -u 10000) <(time ../gmpxx/naturals -type primorial_ruth_aaron_pair -u 10000) > /dev/null
	diff <(time ./naturals -type amicable -u 10000) <(time ../gmpxx/naturals -type amicable -u 10000) > /dev/null
	diff <(time ./naturals -type betrothed -u 10000) <(time ../gmpxx/naturals -type betrothed -u 10000) > /dev/null
	diff <(time ./naturals -type augumented_amicable -u 100000) <(time ../gmpxx/naturals -type augumented_amicable -u 100000) > /dev/null
	diff <(time ./naturals -type harmonic_divisor -u 100000) <(time ../gmpxx/naturals -type harmonic_divisor -u 100000) > /dev/null
	diff <(time ./naturals -type sphenic -u 1000) <(time ../gmpxx/naturals -type sphenic -u 1000) > /dev/null
	diff <(time ./naturals -type fortunate -u 10000000) <(time ../gmpxx/naturals -type fortunate -u 10000000) > /dev/null
	diff <(time ./naturals -type power_of_two -u 1000000000) <(time ../gmpxx/naturals -type power_of_two -u 1000000000) > /dev/null
	diff <(time ./naturals -type cullen -u 10000000) <(time ../gmpxx/naturals -type cullen -u 10000000) > /dev/null
	diff <(time ./naturals -type cullen_prime -u 10000000) <(time ../gmpxx/naturals -type cullen_prime -u 10000000) > /dev/null
	diff <(time ./naturals -type fibonacci -u 1000000000) <(time ../gmpxx/naturals -type fibonacci -u 1000000000) > /dev/null
	diff <(time ./naturals -type lucas -u 1000000000) <(time ../gmpxx/naturals -type lucas -u 1000000000) > /dev/null
	diff <(time ./naturals -type pell -u 1000000000) <(time ../gmpxx/naturals -type pell -u 1000000000) > /dev/null
	diff <(time ./naturals -type perrin -u 1000000000) <(time ../gmpxx/naturals -type perrin -u 1000000000) > /dev/null

collate_naturals.01:
	diff <(time ./naturals -type doubly_even -u 1000000) <(time ../gmpxx/naturals -type doubly_even -u 1000000) > /dev/null
	diff <(time ./naturals -type interprime -u 1000000) <(time ../gmpxx/naturals -type interprime -u 1000000) > /dev/null
	diff <(time ./naturals -type non_prime_unusual -u 10000) <(time ../gmpxx/naturals -type non_prime_unusual -u 10000) > /dev/null
	diff <(time ./naturals -type unitary_perfect -u 100000) <(time ../gmpxx/naturals -type unitary_perfect -u 100000) > /dev/null
	diff <(time ./naturals -type primary_pseudoperfect -u 100000) <(time ../gmpxx/naturals -type primary_pseudoperfect -u 100000) > /dev/null
	diff <(time ./naturals -type refactorable -u 100000) <(time ../gmpxx/naturals -type refactorable -u 100000) > /dev/null
	diff <(time ./naturals -type unusual -u 10000) <(time ../gmpxx/naturals -type unusual -u 10000) > /dev/null
	diff <(time ./naturals -type arithmetic -u 100000) <(time ../gmpxx/naturals -type arithmetic -u 100000) > /dev/null
	diff <(time ./naturals -type friendly -u 1000) <(time ../gmpxx/naturals -type friendly -u 1000) > /dev/null
	diff <(time ./naturals -type semiprime -u 1000) <(time ../gmpxx/naturals -type semiprime -u 1000) > /dev/null
	diff <(time ./naturals -type mersenne -u 1000000000) <(time ../gmpxx/naturals -type mersenne -u 1000000000) > /dev/null
	diff <(time ./naturals -type mersenne_prime -u 1000000000) <(time ../gmpxx/naturals -type mersenne_prime -u 1000000000) > /dev/null
	diff <(time ./naturals -type wilson_quotient -u 1000000000) <(time ../gmpxx/naturals -type wilson_quotient -u 1000000000) > /dev/null
	diff <(time ./naturals -type pronic -u 1000000000) <(time ../gmpxx/naturals -type pronic -u 1000000000) > /dev/null
	diff <(time ./naturals -type woodall -u 1000000000) <(time ../gmpxx/naturals -type woodall -u 1000000000) > /dev/null
	diff <(time ./naturals -type woodall_prime -u 1000000000) <(time ../gmpxx/naturals -type woodall_prime -u 1000000000) > /dev/null
#	diff <(time ./naturals -type regular -u 1000000000) <(time ../gmpxx/naturals -type regular -u 1000000000) > /dev/null
	diff <(time ./naturals -type regular -u 10000) <(time ../gmpxx/naturals -type regular -u 10000) > /dev/null
	diff <(time ./naturals -type factorial_prime -u 1000000000) <(time ../gmpxx/naturals -type factorial_prime -u 1000000000) > /dev/null
	diff <(time ./naturals -type euclid -u 1000000000) <(time ../gmpxx/naturals -type euclid -u 1000000000) > /dev/null
	diff <(time ./naturals -type euclid_prime -u 1000000000) <(time ../gmpxx/naturals -type euclid_prime -u 1000000000) > /dev/null
	diff <(time ./naturals -type triangular -u 1000000000) <(time ../gmpxx/naturals -type triangular -u 1000000000) > /dev/null
	diff <(time ./naturals -type square_triangular -u 1000000000) <(time ../gmpxx/naturals -type square_triangular -u 1000000000) > /dev/null
	diff <(time ./naturals -type squared_triangular -u 1000000000) <(time ../gmpxx/naturals -type squared_triangular -u 1000000000) > /dev/null
	diff <(time ./naturals -type lazy_caterer -u 1000000000) <(time ../gmpxx/naturals -type lazy_caterer -u 1000000000) > /dev/null
	diff <(time ./naturals -type jacobsthal -u 1000000000) <(time ../gmpxx/naturals -type jacobsthal -u 1000000000) > /dev/null
	diff <(time ./naturals -type jacobsthal_lucas -u 1000000000) <(time ../gmpxx/naturals -type jacobsthal_lucas -u 1000000000) > /dev/null
	diff <(time ./naturals -type kynea -u 1000000000) <(time ../gmpxx/naturals -type kynea -u 1000000000) > /dev/null
	diff <(time ./naturals -type prime_kynea -u 1000000000) <(time ../gmpxx/naturals -type prime_kynea -u 1000000000) > /dev/null
	diff <(time ./naturals -type thabit -u 1000000000) <(time ../gmpxx/naturals -type thabit -u 1000000000) > /dev/null
	diff <(time ./naturals -type prime_thabit -u 1000000000) <(time ../gmpxx/naturals -type prime_thabit -u 1000000000) > /dev/null
	diff <(time ./naturals -type leonardo -u 1000000000) <(time ../gmpxx/naturals -type leonardo -u 1000000000) > /dev/null
	diff <(time ./naturals -type padovan -u 1000000000) <(time ../gmpxx/naturals -type padovan -u 1000000000) > /dev/null
	diff <(time ./naturals -type motzkin -u 1000000000) <(time ../gmpxx/naturals -type motzkin -u 1000000000) > /dev/null
	diff <(time ./naturals -type schreder_hipparchus -u 1000000000) <(time ../gmpxx/naturals -type schreder_hipparchus -u 1000000000) > /dev/null
	diff <(time ./naturals -type sylvester -u 1000000000) <(time ../gmpxx/naturals -type sylvester -u 1000000000) > /dev/null
	diff <(time ./naturals -type telephone -u 1000000000) <(time ../gmpxx/naturals -type telephone -u 1000000000) > /dev/null

collate_naturals.02:
	diff <(time ./naturals -type primitive_abundant -u 100000) <(time ../gmpxx/naturals -type primitive_abundant -u 100000) > /dev/null
	diff <(time ./naturals -type primitive_abundant_have_no_abundant_proper_divisor -u 100000) <(time ../gmpxx/naturals -type primitive_abundant_have_no_abundant_proper_divisor -u 100000) > /dev/null
	diff <(time ./naturals -type pseudoperfect -u 1000) <(time ../gmpxx/naturals -type pseudoperfect -u 1000) > /dev/null
	diff <(time ./naturals -type primitive_pseudoperfect -u 1000) <(time ../gmpxx/naturals -type primitive_pseudoperfect -u 1000) > /dev/null
	diff <(time ./naturals -type superperfect -u 100000) <(time ../gmpxx/naturals -type superperfect -u 100000) > /dev/null
	diff <(time ./naturals -type hemiperfect -u 100000) <(time ../gmpxx/naturals -type hemiperfect -u 100000) > /dev/null
	diff <(time ./naturals -type weird -u 10000) <(time ../gmpxx/naturals -type weird -u 10000) > /dev/null
	diff <(time ./naturals -type practical -u 1000) <(time ../gmpxx/naturals -type practical -u 1000) > /dev/null
	diff <(time ./naturals -type round_number -u 10000) <(time ../gmpxx/naturals -type round_number -u 10000) > /dev/null
	diff <(time ./naturals -type lucas_carmichael -u 10000) <(time ../gmpxx/naturals -type lucas_carmichael -u 10000) > /dev/null
	diff <(time ./naturals -type square_free -u 100000) <(time ../gmpxx/naturals -type square_free -u 100000) > /dev/null
	diff <(time ./naturals -type cube_free -u 1000000) <(time ../gmpxx/naturals -type cube_free -u 1000000) > /dev/null
	diff <(time ./naturals -type wilson_prime -u 1000000000) <(time ../gmpxx/naturals -type wilson_prime -u 1000000000) > /dev/null
	diff <(time ./naturals -type hilbert -u 10000000) <(time ../gmpxx/naturals -type hilbert -u 10000000) > /dev/null
	diff <(time ./naturals -type kummer -u 1000000000) <(time ../gmpxx/naturals -type kummer -u 1000000000) > /dev/null
	diff <(time ./naturals -type kummer_prime -u 1000000000) <(time ../gmpxx/naturals -type kummer_prime -u 1000000000) > /dev/null
	diff <(time ./naturals -type primorial_prime -u 100000000) <(time ../gmpxx/naturals -type primorial_prime -u 100000000) > /dev/null
	diff <(time ./naturals -type nontotient -u 10000) <(time ../gmpxx/naturals -type nontotient -u 10000) > /dev/null
	diff <(time ./naturals -type noncototient -u 10000) <(time ../gmpxx/naturals -type noncototient -u 10000) > /dev/null
	diff <(time ./naturals -type perfect_totient -u 10000) <(time ../gmpxx/naturals -type perfect_totient -u 10000) > /dev/null
	diff <(time ./naturals -type highly_totient -u 10000) <(time ../gmpxx/naturals -type highly_totient -u 10000) > /dev/null
	diff <(time ./naturals -type highly_cototient -u 10000) <(time ../gmpxx/naturals -type highly_cototient -u 10000) > /dev/null
	diff <(time ./naturals -type catalan -u 1000000000) <(time ../gmpxx/naturals -type catalan -u 1000000000) > /dev/null
	diff <(time ./naturals -type alternating_factorial -u 1000000000) <(time ../gmpxx/naturals -type alternating_factorial -u 1000000000) > /dev/null
	diff <(time ./naturals -type hyperfactorial -u 1000000000) <(time ../gmpxx/naturals -type hyperfactorial -u 1000000000) > /dev/null
	-diff <(time ./naturals -type exponential_factorial -u 1000000000) <(time ../gmpxx/naturals -type exponential_factorial -u 1000000000) > /dev/null
	diff <(time ./naturals -type fermat -u 1000000000) <(time ../gmpxx/naturals -type fermat -u 1000000000) > /dev/null
	diff <(time ./naturals -type perfect_power -u 100000) <(time ../gmpxx/naturals -type perfect_power -u 100000) > /dev/null
	diff <(time ./naturals -type perfect_square -u 100000) <(time ../gmpxx/naturals -type perfect_square -u 100000) > /dev/null
	diff <(time ./naturals -type derangement -u 1000000000) <(time ../gmpxx/naturals -type derangement -u 1000000000) > /dev/null

collate:
	diff <(./primes) <(../gmpxx/primes)
	diff <(./primes_reverse) <(../gmpxx/primes_reverse)
	diff <(./n_primes) <(../gmpxx/n_primes)
	diff <(./n_primes_reverse) <(../gmpxx/n_primes_reverse)
	diff <(./composites) <(../gmpxx/composites)
	diff <(./next_prime 1000) <(../gmpxx/next_prime 1000)
	diff <(./previous_prime 1000) <(../gmpxx/previous_prime 1000)
	diff <(time ./highlycomposites) <(time ../gmpxx/highlycomposites)
	diff <(time ./highlyabundants) <(time ../gmpxx/highlyabundants)
	diff <(time ./superabundants) <(time ../gmpxx/superabundants)
	diff <(time ./totient_function) <(time ../gmpxx/totient_function)
	diff <(time ./cototient_function) <(time ../gmpxx/cototient_function)
	diff <(time ./mebius_function) <(time ../gmpxx/mebius_function)

check: $($(EXES):%=%.cc)
#	time ./isprime $$(./integer_valued_polynomial_progression -c 56211383760397 44546738095860 -k 23)
	diff -w <(time ./factorize $$(./primes -u 10000) | cut -d "`printf '\t'`" -f 2 | sed 's/\^1//') <(./primes -u 10000)
	time ./factorize $$(./composites -v 2 3 5 -m 4) | while read n p; do\
	  [ $$n = $$(echo $$p | sed 's/ /*/g' | bc) ] || return 1;\
	done
	time ./factorize $$(./composites -v 3 -m 10) | while read n p; do\
	  [ $$n = $$(echo $$p | sed 's/ /*/g' | bc) ] || return 1;\
	done
	for ((a=1; a<10; a++)); do for ((b=a; b<10; b++)); do\
	  [ $$(echo $$(./gcd $$a $$b)'*'$$(./lcm $$a $$b) | bc) = $$(echo $$a'*'$$b | bc) ] || return 1;\
	done; done
	for ((a=1; a<100; a++)); do\
	  [ $$(echo $$(./divisors $$a) | sed 's/ /+/g' | bc) = $$(./sum_divisors $$a | cut -d "`printf '\t'`" -f 2) ] || return 1;\
	done
	for ((a=1; a<100; a++)); do\
	  [ $$(echo $$(./factorize $$a | cut -d "`printf '\t'`" -f 2- | sed 's/[0-9][0-9]*^/1+/g;s/\([+0-9][+0-9]*\)/(\1)/g') | sed 's/ /*/g' | bc) = $$(./n_divisors $$a | cut -d "`printf '\t'`" -f 2) ] || return 1;\
	done
	time ./iscomposite $$(./composites -u 10000)

confirm: confirm_spiral confirm_upperrightspiral confirm_upperspiral

confirm_spiral: $($(EXES):%=%.cc)
	./isprime $$(./integer_valued_polynomial_progression -k 17 -c 9281	-2 4)
	./isprime $$(./integer_valued_polynomial_progression -k 18 -c 653	4 4)
	./isprime $$(./integer_valued_polynomial_progression -k 20 -c 41	2 4)
	./isprime $$(./integer_valued_polynomial_progression -k 20 -c 163	0 4)
	./isprime $$(./integer_valued_polynomial_progression -k 21 -c 41	-2 4)
	./isprime $$(./integer_valued_polynomial_progression -k 21 -c 43	-12 16)
	./isprime $$(./integer_valued_polynomial_progression -k 21 -c 3527	-2 4)
	./isprime $$(./integer_valued_polynomial_progression -k 21 -c 3779	24 48)
	./isprime $$(./integer_valued_polynomial_progression -k 22 -c 41	-4 16)
	./isprime $$(./integer_valued_polynomial_progression -k 22 -c 59	-8 16)
	./isprime $$(./integer_valued_polynomial_progression -k 22 -c 947	24 48)
	./isprime $$(./integer_valued_polynomial_progression -k 22 -c 15451	-10 20)

confirm_upperrightspiral: $($(EXES):%=%.cc)
	./isprime $$(./integer_valued_polynomial_progression -k 18 -c 19	2 2)
	./isprime $$(./integer_valued_polynomial_progression -k 18 -c 653	4 4)
	./isprime $$(./integer_valued_polynomial_progression -k 19 -c 167	8 4)
	./isprime $$(./integer_valued_polynomial_progression -k 20 -c 163	0 4)
	./isprime $$(./integer_valued_polynomial_progression -k 22 -c 23	3 3)
	./isprime $$(./integer_valued_polynomial_progression -k 28 -c 31	4 2)
	./isprime $$(./integer_valued_polynomial_progression -k 29 -c 29	0 2)
	./isprime $$(./integer_valued_polynomial_progression -k 29 -c 31	6 6)
	./isprime $$(./integer_valued_polynomial_progression -k 40 -c 41	1 1)

confirm_upperspiral: $($(EXES):%=%.cc)
	./isprime $$(./integer_valued_polynomial_progression -k 17 -c 17	0 6)
	./isprime $$(./integer_valued_polynomial_progression -k 18 -c 19	2 2)
	./isprime $$(./integer_valued_polynomial_progression -k 18 -c 653	4 4)
	./isprime $$(./integer_valued_polynomial_progression -k 20 -c 41	-2 4)
	./isprime $$(./integer_valued_polynomial_progression -k 20 -c 43	6 4)
	./isprime $$(./integer_valued_polynomial_progression -k 20 -c 163	0 4)
	./isprime $$(./integer_valued_polynomial_progression -k 20 -c 3529	6 4)
	./isprime $$(./integer_valued_polynomial_progression -k 21 -c 41	-2 4)
	./isprime $$(./integer_valued_polynomial_progression -k 21 -c 67	24 16)
	./isprime $$(./integer_valued_polynomial_progression -k 21 -c 3527	-2 4)
	./isprime $$(./integer_valued_polynomial_progression -k 21 -c 15461	30 20)
	./isprime $$(./integer_valued_polynomial_progression -k 22 -c 59	-8 16)
	./isprime $$(./integer_valued_polynomial_progression -k 22 -c 15451	-10 20)
	./isprime $$(./integer_valued_polynomial_progression -k 29 -c 29	0 2)
	./isprime $$(./integer_valued_polynomial_progression -k 29 -c 31	6 6)
