Skip to content

Instantly share code, notes, and snippets.

@user140242
user140242 / mersenne_first_factor.cpp
Last active November 28, 2023 15:36
Mersenne trial factoring function
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <stdint.h>
int64_t Euclidean_Diophantine( int64_t coeff_a, int64_t coeff_b)
{
// return y in Diophantine equation coeff_a x + coeff_b y = 1
@user140242
user140242 / SegmentedWheelSieve.py
Last active March 31, 2024 10:22
segmented wheel sieve python
# segmented wheel sieve python
import time
import numpy as np
from math import isqrt
def segmented_wheel_sieve(n , max_bW):
dim_seg = 2**22
bW = 30
n_PB = 3