Slow prime-related algorithms