Anonymous ID: 98f9b8 Jan. 16, 2020, 12:11 a.m. No.7828107   🗄️.is 🔗kun   >>8119 >>8172

>>7827591

 

from my_math import *

from math import log

from time import clock

from argparse import ArgumentParser

 

# Multiple Polynomial Quadratic Sieve

def mpqs(n, verbose=False):

if verbose:

time1 = clock()

 

root_n = isqrt(n)

root_2n = isqrt(n+n)

 

# formula chosen by experimentation

# seems to be close to optimal for n < 10^50

bound = int(5 * log(n, 10)**2)

 

prime = []

mod_root = []

log_p = []

num_prime = 0

 

# find a number of small primes for which n is a quadratic residue

p = 2

while p < bound or num_prime < 3:

 

# legendre (n|p) is only defined for odd p

if p 2:

leg = legendre(n, p)

else:

leg = n & 1

 

if leg == 1:

prime += [p]

mod_root += [int(mod_sqrt(n, p))]

log_p += [log(p, 10)]

num_prime += 1

elif leg == 0:

if verbose:

print 'trial division found factors:'

print p, 'x', n/p

return p

 

p = next_prime(p)

 

# size of the sieve

x_max = len(prime)*60

 

# maximum value on the sieved range

m_val = (x_max * root_2n) >1

 

# fudging the threshold down a bit makes it easier to find powers of primes as factors

# as well as partial-partial relationships, but it also makes the smoothness check slower.

# there's a happy medium somewhere, depending on how efficient the smoothness check is

thresh = log(m_val, 10) * 0.735

 

# skip small primes. they contribute very little to the log sum

# and add a lot of unnecessary entries to the table

# instead, fudge the threshold down a bit, assuming ~1/4 of them pass

min_prime = int(thresh*3)

fudge = sum(log_p[i] for i,p in enumerate(prime) if p < min_prime)/4

thresh -= fudge

 

if verbose:

print 'smoothness bound:', bound

print 'sieve size:', x_max

print 'log threshold:', thresh

print 'skipping primes less than:', min_prime

 

smooth = []

used_prime = set()

partial = {}

num_smooth = 0

num_used_prime = 0

num_partial = 0

num_poly = 0

root_A = isqrt(root_2n / x_max)

 

if verbose:

print 'sieving for smooths…'

while True:

# find an integer value A such that:

# A is =~ sqrt(2*n) / x_max

# A is a perfect square

# sqrt(A) is prime, and n is a quadratic residue mod sqrt(A)

while True:

root_A = next_prime(root_A)

leg = legendre(n, root_A)

if leg == 1:

break

elif leg == 0:

if verbose:

print 'dumb luck found factors:'

print root_A, 'x', n/root_A

return root_A

 

A = root_A * root_A

 

# solve for an adequate B

# BB is a quadratic residue mod n, such that BB-A*C = n

# this is unsolvable if n is not a quadratic residue mod sqrt(A)

b = mod_sqrt(n, root_A)

B = (b + (n - b*b) * mod_inv(b + b, root_A))%A

 

# BB-AC = n <=C = (B*B-n)/A

C = (B*B - n) / A

Anonymous ID: 98f9b8 Jan. 16, 2020, 12:20 a.m. No.7828135   🗄️.is 🔗kun   >>8146 >>8172 >>8182

>>7828119

Sorry anon

Was a shit post

Thought it better than a meme from Office Space

That said: why does it say paper jam when there is no paper jam

OP I was responding to

Looked to be factoring subprimes

So I found some Python

Somebody worked on that does the same thing

Code is bit complete, body too long

But you can see the start of a program

Built to factor subprimes

Anonymous ID: 98f9b8 Jan. 16, 2020, 12:28 a.m. No.7828157   🗄️.is 🔗kun

>>7828141

 

Probs turn your electronic devices off

Go hang around people

Or outside

Dogs = good

Proven to calm

 

>>7828146

 

https://codegolf.stackexchange.com/questions/8629/fastest-semiprime-factorization

Anonymous ID: 98f9b8 Jan. 16, 2020, 12:39 a.m. No.7828194   🗄️.is 🔗kun

>>7828086

 

Easiest way to ensure no EXIF data

Makes it into a pic you post here…

Open the pic on your comp or mobile

Take a screenshot

Name the pic and save to photos or wherever

EXIF data in a pic is in the original pic

Not your screenshot

Good practice never to load an original pic (you) took.

Anonymous ID: 98f9b8 Jan. 16, 2020, 12:57 a.m. No.7828239   🗄️.is 🔗kun   >>8254

>>7828222

 

Depends on what root cause is anon.

 

> https://www.spine-health.com/blog/what-your-back-muscle-spasm-telling-you

 

If it were me I would start with rest

Hot / cold therapy (ice / heating pad)

Treat inflammation with grounding (earthing)

Mobility stretching

 

Thats just muh $.02

Non medical opinion

When I deadlift and squat a alot

Sometimes the hammies and posterior chain

Refer pain to the lower back

I always start by stretching glutes and hams

And roll out trigger points in glutes and hams

If muh lower back gets stiff

Trigger Point Therapy workbook changed my life

No bullshit