def test_serie_1(dim,vol,loud):
 if dim<20:
  max_k=dim+1
 else:
  max_k=21
 for k in range(1,max_k):
  assert k <= dim
  for x in range(vol):
   ' create matrice with abs(det)<2**63 and diagonal with k entries>1 '
   nums=small_nums(k)
   A=sage.all.identity_matrix(ZZ,dim)
   for i in range(k-1):
    A[i,i]=nums[i]
   A[dim-1,dim-1]=nums[k-1]
   A *= unimodular(dim)
   A *= unimodular(dim)
   A=left_trans(A,dim)
   A=left_trans(A,dim)
   test(A,loud)
def test_serie_1(be, m, c, vol):
    if c < 30:
        max_k = c + 1
    else:
        max_k = 30
    for x in range(vol):
        for k in range(1, max_k):
            assert k <= c
            " create matrice with abs(det)<2**128 and diagonal with k entries>1 "
            nums = small_nums(k)
            A = identity_matrix(ZZ, c)
            if m > c:
                A = A.stack(matrix(m - c, c))
            for i in range(k - 1):
                A[i, i] = nums[i]
            A[c - 1, c - 1] = nums[k - 1]
            A *= unimodular(c)
            A = left_trans(A, m)
            d = three_det_divisors(nums)
            test_serie_2(be, A, d)
        # don't start new iteration if too many experiments done
        if be[-1] >= 1000:
            return
def test_serie_1(m,c,vol,loud):
 if c<30:
  max_k=c+1
 else:
  max_k=30
 for k in range(1,max_k):
  assert k <= c
  for x in range(vol):
   ' create matrice with abs(det)<2**128 and diagonal with k entries>1 '
   nums=small_nums(k)
   A=identity_matrix(ZZ,c)
   if m>c:
    A=A.stack( matrix( m-c, c ) )
   for i in range(k-1):
    A[i,i]=nums[i]
   A[c-1,c-1]=nums[k-1]
   A *= unimodular(c)
   A=left_trans(A,m)
   d=three_det_divisors( nums )
   if 1:
    write('.')
   else:
    print 'nums=%s divisors=%s' % (nums,d)
   test_serie_2(A,d,loud)