Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #8 Jun 03 2022 10:06:36
%S 1,1,1,2,3,3,8,14,17,17,56,104,138,155,155,608,1160,1608,1918,2073,
%T 2073,9440,18272,25944,32008,36154,38227,38227,198272,387104,557664,
%U 702280,814888,891342,929569,929569,5410688,10623104,15448416,19716064,23281432,26031912
%N The Genocchi triangle read by rows, T(n,k) for n>=0 and 0<=k<=n.
%e The triangle starts:
%e 0: [ 1]
%e 1: [ 1, 1]
%e 2: [ 2, 3, 3]
%e 3: [ 8, 14, 17, 17]
%e 4: [ 56, 104, 138, 155, 155]
%e 5: [ 608, 1160, 1608, 1918, 2073, 2073]
%e 6: [ 9440, 18272, 25944, 32008, 36154, 38227, 38227]
%e 7: [198272, 387104, 557664, 702280, 814888, 891342, 929569, 929569]
%o (Julia)
%o function A297703Triangle(len::Int)
%o A = fill(BigInt(0), len+2); A[2] = 1
%o for n in 2:len+1
%o for k in n:-1:2 A[k] += A[k+1] end
%o for k in 2: 1:n A[k] += A[k-1] end
%o println(A[2:n])
%o end
%o end
%o println(A297703Triangle(9))
%o (Python)
%o from functools import cache
%o @cache
%o def T(n): # returns row n
%o if n == 0: return [1]
%o row = [0] + T(n - 1) + [0]
%o for k in range(n, 0, -1): row[k] += row[k + 1]
%o for k in range(2, n + 2): row[k] += row[k - 1]
%o return row[1:]
%o for n in range(9): print(T(n)) # _Peter Luschny_, Jun 03 2022
%Y Row sums are A005439 with offset 0.
%Y T(n,0) = A005439 with A005439(0) = 1.
%Y T(n,n) = A110501 with offset 0.
%Y Cf. A001469, A014781, A099959, A226158.
%K nonn,tabl
%O 0,4
%A _Peter Luschny_, Jan 03 2018