Created
August 25, 2023 14:27
-
-
Save Hermann-SW/b375da7a0136abc665435734b32f8700 to your computer and use it in GitHub Desktop.
client demonstrating working with range_server.py, Cullen prime demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ "$3" != '' ]] | |
then | |
for((i=1; i<=$3; ++i)) | |
do | |
$0 "$1" "$2" & | |
done | |
exit | |
fi | |
tmp=$(mktemp -d) | |
curl "$1":"$2"/ 2>/dev/null | |
k=$(curl "$1":"$2"/? 2>/dev/null) | |
while [[ "$k" != '' ]] | |
do | |
if [[ $(grep "is prime" <(./sllr64 -w"$tmp" -t1 -d -q"$k*2^$k+1")) != '' ]] | |
then | |
s="$k" | |
else | |
s="?" | |
fi | |
k=$(curl "$1":"$2"/"$s" 2>/dev/null) | |
done | |
rm -rf "$tmp" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works with range_server.py:
range_server.py reports 2 found Cullen primes in range(4700, 5800):