%I #89 Oct 24 2024 01:15:54
%S 0,0,1,0,1,2,0,1,3,3,0,1,5,6,4,0,1,9,14,10,5,0,1,17,36,30,15,6,0,1,33,
%T 98,100,55,21,7,0,1,65,276,354,225,91,28,8,0,1,129,794,1300,979,441,
%U 140,36,9,0,1,257,2316,4890,4425,2275,784,204,45,10
%N Square array T(m,n) read by antidiagonals: Sum_{k=1..n} k^m.
%C For the o.g.f.s of the column sequences for this array, see A196837 and the link given there. - _Wolfdieter Lang_, Oct 15 2011
%C T(m,n)/n is the m-th moment of the discrete uniform distribution on {1,2,...,n}. - _Geoffrey Critzer_, Dec 31 2018
%C T(1,n) divides T(m,n) for odd m. - _Franz Vrabec_, Dec 23 2020
%D J. Faulhaber, Academia Algebrae, Darinnen die miraculosische inventiones zu den höchsten Cossen weiters continuirt und profitirt werden, Augspurg, bey Johann Ulrich Schönigs, 1631.
%H G. C. Greubel, <a href="/A103438/b103438.txt">Antidiagonals n = 0..50, flattened</a>
%H José L. Cereceda, <a href="https://arxiv.org/abs/2005.03407">Sums of powers of integers and hyperharmonic numbers</a>, arXiv:2005.03407 [math.NT], 2020.
%H T. A. Gulliver, <a href="http://www.m-hikari.com/imf-2010/61-64-2010/gulliverIMF61-64-2010.pdf">Divisibility of sums of powers of odd integers</a>, Int. Math. For. 5 (2010) 3059-3066.
%H T. A. Gulliver, <a href="http://www.m-hikari.com/ijcms/ijcms-2012/37-40-2012/gulliverIJCMS37-40-2012.pdf">Sums of Powers of Integers Divisible by Three</a>, Int. J. Contemp. Math. Sciences, Vol. 7, 2012, no. 38, pp. 1895-1901. - From _N. J. A. Sloane_, Dec 22 2012
%H V. J. W. Guo and J. Zeng, <a href="https://arxiv.org/abs/math/0501441">A q-analogue of Faulhaber's formula for sums of powers</a>, arXiv:math/0501441 [math.CO], 2005.
%H H. Helfgott and I. M. Gessel, <a href="https://arxiv.org/abs/math/9810143">Enumeration of tilings of diamonds and hexagons with defects</a>, arXiv:math/9810143 [math.CO], 1998.
%H T. Kim, <a href="https://arxiv.org/abs/math/0502113">q-analogues of the sums of powers of consecutive integers</a>, arXiv:math/0502113 [math.NT], 2005.
%H D. E. Knuth, <a href="http://dx.doi.org/10.1090/S0025-5718-1993-1197512-7">Johann Faulhaber and sums of powers</a>, Math. Comp. 61 (1993), no. 203, 277-294.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/DiscreteUniformDistribution.html">Discrete Uniform Distribution</a>.
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Faulhaber%27s_formula">Faulhaber's formula</a>
%F E.g.f.: e^x*(e^(x*y)-1)/(e^x-1).
%F T(m, n) = Zeta(-n, 1) - Zeta(-n, m + 1), for m >= 0 and n >= 0, where Zeta(z, v) is the Hurwitz zeta function. - _Peter Luschny_, Nov 16 2008
%F T(m, n) = HarmonicNumber(m, -n). - _Jean-François Alcover_, May 11 2012
%F T(m, n) = Bernoulli(m + 1, n + 1) - Bernoulli(m + 1, 1)) / (m + 1). - _Peter Luschny_, Mar 20 2024
%F T(m, n) = Sum_{k=0...m-n} B(k)*(-1)^k*binomial(m-n,k)*n^(m-n-k+1)/(m-n-k+1), where B(k) = Bernoulli number A027641(k) / A027642(k). - _Robert B Fowler_, Aug 20 2024
%e Square array begins:
%e 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... A001477;
%e 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, ... A000217;
%e 0, 1, 5, 14, 30, 55, 91, 140, 204, 285, ... A000330;
%e 0, 1, 9, 36, 100, 225, 441, 784, 1296, 2025, ... A000537;
%e 0, 1, 17, 98, 354, 979, 2275, 4676, 8772, 15333, ... A000538;
%e 0, 1, 33, 276, 1300, 4425, 12201, 29008, 61776, 120825, ... A000539;
%e 0, 1, 65, 794, 4890, 20515, 67171, 184820, 446964, 978405, ... A000540;
%e Antidiagonal triangle begins as:
%e 0;
%e 0, 1;
%e 0, 1, 2;
%e 0, 1, 3, 3;
%e 0, 1, 5, 6, 4;
%e 0, 1, 9, 14, 10, 5;
%e 0, 1, 17, 36, 30, 15, 6;
%p seq(print(seq(Zeta(0,-k,1)-Zeta(0,-k,n+1),n=0..9)),k=0..6);
%p # (Produces the square array from the example.) _Peter Luschny_, Nov 16 2008
%p # alternative
%p A103438 := proc(m,n)
%p (bernoulli(m+1,n+1)-bernoulli(m+1))/(m+1) ;
%p if m = 0 then
%p %-1 ;
%p else
%p % ;
%p end if;
%p end proc: # _R. J. Mathar_, May 10 2013
%p # simpler:
%p A103438 := proc(m,n)
%p (bernoulli(m+1,n+1)-bernoulli(m+1,1))/(m+1) ;
%p end proc: # _Peter Luschny_, Mar 20 2024
%t T[m_, n_]:= HarmonicNumber[m, -n]; Flatten[Table[T[m-n, n], {m, 0, 11}, {n, m, 0, -1}]] (* _Jean-François Alcover_, May 11 2012 *)
%o (PARI) T(m,n)=sum(k=0,n,k^m)
%o (Magma)
%o T:= func< n,k | n eq 0 select k else (&+[j^n: j in [0..k]]) >;
%o [T(n-k,k): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Dec 22 2021
%o (SageMath)
%o def T(n,k): return (bernoulli_polynomial(k+1, n+1) - bernoulli_polynomial(1, n+1)) /(n+1)
%o flatten([[T(n-k,k) for k in (0..n)] for n in (0..12)]) # _G. C. Greubel_, Dec 22 2021
%o (Python)
%o from itertools import count, islice
%o from math import comb
%o from fractions import Fraction
%o from sympy import bernoulli
%o def A103438_T(m,n): return sum(k**m for k in range(1,n+1)) if n<=m else int(sum(comb(m+1,i)*(bernoulli(i) if i!=1 else Fraction(1,2))*n**(m-i+1) for i in range(m+1))/(m+1))
%o def A103438_gen(): # generator of terms
%o for m in count(0):
%o for n in range(m+1):
%o yield A103438_T(m-n,n)
%o A103438_list = list(islice(A103438_gen(),100)) # _Chai Wah Wu_, Oct 23 2024
%Y Rows include A000027, A000217, A000330, A000537, A000538, A000539, A000540, A000541, A000542, A007487, A023002.
%Y Columns include A000051, A001550, A001551, A001552, A001553, A001554, A001555, A001556, A001557.
%Y Diagonals include A076015 and A031971.
%Y Antidiagonal sums are in A103439.
%Y Antidiagonals are the rows of triangle A192001.
%K nonn,tabl,changed
%O 0,6
%A _Ralf Stephan_, Feb 11 2005