########################################################################## # Copyright (C) 2006 Jaap Spies, jaapspies@gmail.com # # Distributed under the terms of the GNU General Public License (GPL): # # http://www.gnu.org/licenses/ ########################################################################## def f(g, h): r""" This function returs $f(g,h)$ from Sloan's A079908-A079928 INPUT: g -- integer h -- integer OUTPUT: permanent of the g x (g+h) matrix, etc. EXAMPLES: AUTHOR: - Jaap Spies (2006) """ m = g n = m + h M = MatrixSpace(QQ, m, n) A = M([0 for i in range(m*n)]) for i in range(m): for j in range(n): if i <= j and j <= i + h: A[i,j] = 1 return A.permanent()