OFFSET
1,2
LINKS
Pontus von Brömssen, Table of n, a(n) for n = 1..10000
PROG
(Python)
from bisect import insort
from itertools import islice
def A375999_generator():
yield 1
nkN_list = [(3, 2, 3)] # List of triples (n, k, A001263(n, k)), sorted by the last element.
while 1:
N0 = nkN_list[0][2]
yield N0
while 1:
n, k, N = nkN_list[0]
if N > N0: break
del nkN_list[0]
insort(nkN_list, (n+1, k, n*(n+1)*N//((n-k+1)*(n-k+2))), key=lambda x:x[2])
if n == 2*k-1:
insort(nkN_list, (n+2, k+1, 4*n*(n+2)*N//(k+1)**2), key=lambda x:x[2])
def A375999_list(nmax):
return list(islice(A375999_generator(), nmax))
CROSSREFS
KEYWORD
nonn
AUTHOR
Pontus von Brömssen, Sep 06 2024
STATUS
approved