Skip to main content
Spelling
Source Link
joro
  • 25.4k
  • 10
  • 66
  • 121

By the paper StallMichael Stoll cites,

By reapetedrepeated squaring $t(a^{2^k}) \le t(a)+k$.

The setMembers of $S$ can be computed in polynomial in $\log{n}$ time.

Here is alogrithmalgorithm (1) for multiples of $45\#$ and $55\#$:

By the paper Stall cites,

By reapeted squaring $t(a^{2^k}) \le t(a)+k$.

The set $S$ can be computed in polynomial in $\log{n}$ time.

Here is alogrithm (1) for multiples of $45\#$ and $55\#$:

By the paper Michael Stoll cites,

By repeated squaring $t(a^{2^k}) \le t(a)+k$.

Members of $S$ can be computed in polynomial in $\log{n}$ time.

Here is algorithm (1) for multiples of $45\#$ and $55\#$:

Source Link
joro
  • 25.4k
  • 10
  • 66
  • 121

Here is partial result about multiple of factorial based on heuristic code.

By the paper Stall cites,

$t(m) \le 2 \log{m}$.

By reapeted squaring $t(a^{2^k}) \le t(a)+k$.

Let $M=\log{n}$ and $S=\{a \cdot b^{2^k}+c : 1\le a \le 2M, 1\le b\le 2M, - 2M \le c \le 2M, 0\le k \le M\}$.

First we try to compute primorial $n$ and then square few times.

The set $S$ can be computed in polynomial in $\log{n}$ time.

So it depends if few members of $S$ contain all primes $\le n$.

Let $\{P\}$ be the set of primes $\le n$.

Greedy Algorithm 1. For $ a,b \in S$ and $c= a \{+,-,\times\} b$ find the $c$ which is divisible by largest number of members of $P$. Keep $c$ and remove the primes from $P$. Repeat. Terminate when $P$ is empty. I can't prove this always terminate ;).

Certainly $S$ can be extended by the other answers.

Here is alogrithm (1) for multiples of $45\#$ and $55\#$:

sage: greedyfactorial(45,planc=False,allb=1)
#S= 1637
1 9 [2, 3, 5, 7, 11, 13, 17, 31, 41] -340282366920938463463374607431768211200 = (1*2^8+0)-(1*2^128+0)
early 2 5 [19, 23, 29, 37, 43] 10301051460877537454126135158480 = (1*5^16+6)+(3*3^64+6)
sage: greedyfactorial(55,planc=False,allb=1)
#S= 5821
1 11 [2, 3, 5, 7, 11, 13, 17, 19, 31, 37, 41] -39402006196394479212279040100143613805079739270465446667948293404245721771497210611414266254884915640806627973529600 = (1*2^24+0)-(1*2^384+0)
2 4 [23, 29, 47, 53] 19295810734578656668031216686940366563098640636282442092649989 = (6*2^8+1)*(2*2^192+5)
early 3 1 [43] 258 = 1+(1*2^8+1)

Sage code written in a hurry:

def greedyfactorial(n,deg=2,allb=True,planc=False):
    pri=list(primes(2,n+1)) #primorial
    k=floor(log(n))^deg
    lk=2*floor(log(n))
    pri1=[ 0 .. lk ]        
    pows=[]
    for p in pri1:
        if p==0:  continue
        for e in [ 2 .. lk]:
            pows += [p**(2**e)]
    pri1=[(i,str(i)) for i in pri1[:]]
    S=pri1[:]
    ca={}
    for p,_ in S:  ca[p]=1
    
    for p,_ in pri1:
      for q,_ in pri1:
        for b in pows:
            T=p*b+q
            if T in ca:  continue
            ca[T]=1
            S += [(p*b+q,'('+str(p)+'*'+str(factor(b))+ '+'+str(q)+')')]
            T=p*b-q
            if T in ca:  continue
            ca[T]=1
            S += [(p*b+q,'('+str(p)+'*'+str(factor(b))+ '-'+str(q)+')')]
    S=[(i,j) for i,j in S if i!=0]
    B=[(1,'1')]
    if allb:  B=S

    ops2=[ (lambda x,y:  x*y,'*'),(lambda x,y:  x + y,'+'), (lambda x,y:   x - y,'-')]
    print '#S=',len(S)
    def countp(A,S):
        r=[]
        for p in S:
            if A%p==0:  r += [p]
        return r    

    S=uniq(S)

    for ste in [ 1 .. k]:
        ma,br,BA=0,[],0
        for a,an in S:
            #for b,bn in S:
            for b,bn in B:
                for f,o in ops2:
                    A=f(a,b)
                    if A==0:  continue
                    r=countp(A,pri)
                    if len(r)>ma:
                        br=r
                        bs=an+o+bn
                        ma=len(r)
                        BA=A
                        if ma==len(pri):
                            print 'early',ste,ma,br,BA,'=',bs
                            return
                    if planc and ma>=len(pri)//2:  break    
                if planc and ma>=len(pri)//2:  break    
                            
        print ste,ma,br,BA,'=',bs
        pri=[p for p in pri if not p in br]
        if pri==[]:
            print ' Done'
            return