diff git a/sage/coding/delsarte_bounds.py b/sage/coding/delsarte_bounds.py
a

b


8  8  AUTHORS: 
9  9  
10  10   Dmitrii V. (Dima) Pasechnik (201210): initial implementation. 
11   
12   
13  11  """ 
14  12  #***************************************************************************** 
15  13  # Copyright (C) 2012 Dima Pasechnik <dimpase@gmail.com> 
… 
… 

22  20  """ 
23  21  Compute ``K^{n,q}_l(i)``, the Krawtchouk polynomial: see 
24  22  `en.wikipedia.org/wiki/Kravchuk_polynomials <http://en.wikipedia.org/wiki/Kravchuk_polynomials>`_. 
 23  It is given by 
25  24  
 25  .. math:: 
 26  
 27  K^{n,q}_l(i)=\sum_{j=0}^l (1)^j(q1)^{(lj)}{i \choose j}{ni \choose lj} 
26  28  """ 
27  29  from sage.rings.arith import binomial 
 30  # Use the expression in equation (55) of MacWilliams & Sloane, pg 151 
 31  # We write jth term = some_factor * (j1)th term 
 32  kraw = jth_term = (q1)**l * binomial(n, l) # j=0 
 33  for j in range(1,l+1): 
 34  jth_term *= q*(lj+1)*(ij+1)/((q1)*j*(nj+1)) 
 35  kraw += jth_term 
 36  return kraw 
28  37  
29   return sum([((1)**j)*((q1)**(lj))*binomial(i,j)*binomial(ni,lj) 
30   for j in range(l+1)]) 
31  38  
32  39  def delsarte_bound_hamming_space(n, d, q, \ 
33  40  isinteger=False, return_data=False, solver="PPL"): 
… 
… 

47  54   ``isinteger``  if ``True``, uses an integer programming solver (ILP), rather 
48  55  that an LP solver. Can be very slow if set to ``True``. 
49  56  
50    ``return_data``  if ``True``, return a weights vector, which actually need not 
51   be a proper weight enumerator, or even have integer entries, and the LP. 
 57   ``return_data``  if ``True``, return a triple (W,LP,bound), where W is 
 58  a weights vector. W need not be a weight distribution of a code, or, 
 59  if ``isinteger==False``, even have integer entries, and the Delsarte bound LP. 
52  60  
53  61   ``solver``  the LP/ILP solved to be used. Defaults to ``PPL``. It is arbitrary 
54  62  precision, thus there will be no rounding errors. With other solvers, you are on 
… 
… 

138  146   ``isinteger``  if ``True``, uses an integer programming solver (ILP), rather 
139  147  that an LP solver. Can be very slow if set to ``True``. 
140  148  
141    ``return_data``  if ``True``, return a weights vector, which actually need not 
142   be a proper weight enumerator, or even have integer entries, and the LP. 
 149   ``return_data``  if ``True``, return a triple (W,LP,bound), where W is 
 150  a weights vector. W need not be a weight distribution of a code, or, 
 151  if ``isinteger==False``, even have integer entries, and the Delsarte bound LP. 
143  152  
144  153   ``solver``  the LP/ILP solved to be used. Defaults to ``PPL``. It is arbitrary 
145  154  precision, thus there will be no rounding errors. With other solvers, you are on 