cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-7 of 7 results.

A103438 Square array T(m,n) read by antidiagonals: Sum_{k=1..n} k^m.

Original entry on oeis.org

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, 98, 100, 55, 21, 7, 0, 1, 65, 276, 354, 225, 91, 28, 8, 0, 1, 129, 794, 1300, 979, 441, 140, 36, 9, 0, 1, 257, 2316, 4890, 4425, 2275, 784, 204, 45, 10
Offset: 0

Views

Author

Ralf Stephan, Feb 11 2005

Keywords

Comments

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
T(m,n)/n is the m-th moment of the discrete uniform distribution on {1,2,...,n}. - Geoffrey Critzer, Dec 31 2018
T(1,n) divides T(m,n) for odd m. - Franz Vrabec, Dec 23 2020

Examples

			Square array begins:
  0, 1,  2,   3,    4,     5,     6,      7,      8,      9, ... A001477;
  0, 1,  3,   6,   10,    15,    21,     28,     36,     45, ... A000217;
  0, 1,  5,  14,   30,    55,    91,    140,    204,    285, ... A000330;
  0, 1,  9,  36,  100,   225,   441,    784,   1296,   2025, ... A000537;
  0, 1, 17,  98,  354,   979,  2275,   4676,   8772,  15333, ... A000538;
  0, 1, 33, 276, 1300,  4425, 12201,  29008,  61776, 120825, ... A000539;
  0, 1, 65, 794, 4890, 20515, 67171, 184820, 446964, 978405, ... A000540;
Antidiagonal triangle begins as:
  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;
		

References

  • 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.

Crossrefs

Diagonals include A076015 and A031971.
Antidiagonal sums are in A103439.
Antidiagonals are the rows of triangle A192001.

Programs

  • Magma
    T:= func< n,k | n eq 0 select k else (&+[j^n: j in [0..k]]) >;
    [T(n-k,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Dec 22 2021
    
  • Maple
    seq(print(seq(Zeta(0,-k,1)-Zeta(0,-k,n+1),n=0..9)),k=0..6);
    # (Produces the square array from the example.) Peter Luschny, Nov 16 2008
    # alternative
    A103438 := proc(m,n)
        (bernoulli(m+1,n+1)-bernoulli(m+1))/(m+1) ;
        if m = 0 then
            %-1 ;
        else
            % ;
        end if;
    end proc: # R. J. Mathar, May 10 2013
    # simpler:
    A103438 := proc(m,n)
        (bernoulli(m+1,n+1)-bernoulli(m+1,1))/(m+1) ;
    end proc: # Peter Luschny, Mar 20 2024
  • Mathematica
    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 *)
  • PARI
    T(m,n)=sum(k=0,n,k^m)
    
  • Python
    from itertools import count, islice
    from math import comb
    from fractions import Fraction
    from sympy import bernoulli
    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))
    def A103438_gen(): # generator of terms
        for m in count(0):
            for n in range(m+1):
                yield A103438_T(m-n,n)
    A103438_list = list(islice(A103438_gen(),100)) # Chai Wah Wu, Oct 23 2024
  • SageMath
    def T(n,k): return (bernoulli_polynomial(k+1, n+1) - bernoulli_polynomial(1, n+1)) /(n+1)
    flatten([[T(n-k,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Dec 22 2021
    

Formula

E.g.f.: e^x*(e^(x*y)-1)/(e^x-1).
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
T(m, n) = HarmonicNumber(m, -n). - Jean-François Alcover, May 11 2012
T(m, n) = (Bernoulli(m + 1, n + 1) - Bernoulli(m + 1, 1)) / (m + 1). - Peter Luschny, Mar 20 2024
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
T(m, n) = Sum_{i=1..n} J_m(i)*floor(n/i), where J_m is the m-th Jordan totient function. - Ridouane Oudra, Jul 19 2025

A196837 Coefficient table of numerator polynomials of o.g.f.s for partial sums of powers of positive integers.

Original entry on oeis.org

1, 2, -3, 3, -12, 11, 4, -30, 70, -50, 5, -60, 255, -450, 274, 6, -105, 700, -2205, 3248, -1764, 7, -168, 1610, -7840, 20307, -26264, 13068, 8, -252, 3276, -22680, 89796, -201852, 236248, -109584, 9, -360, 6090, -56700, 316365, -1077300, 2171040, -2345400, 1026576, 10, -495, 10560, -127050, 946638, -4510275, 13667720, -25228500, 25507152, -10628640
Offset: 1

Views

Author

Wolfdieter Lang, Oct 10 2011

Keywords

Comments

The k-th power of the positive integers has partial sums Sum_{j=1..n} j^k given as column number n >= 1, in the array A103438 (not in the triangle; see the example array given there; note that 0^0 has been set to 0 there).
The o.g.f. of column number n >= 1 of the array A103438 is obtained via Laplace transformation from the e.g.f. which is given there as
exp(x)*(exp(n*x)-1)/(exp(x)-1) = Sum_{j=1..n} exp(j*x)
(it is trivial that the sum is the e.g.f.).
The o.g.f. is, therefore, Sum_{j=1..n} 1/(1-j*x), which is rewritten as P(n,x)/Product_{j=1..n} (1-j*x). This defines the row polynomials P(n,x) of the present triangle. See the link for details.
This e.g.f. - o.g.f. connection proves some conjectures by Simon Plouffe. See the o.g.f. Maple programs under, e.g., A001551(n=4) and A001552 (n=5).
This triangle organizes the sum of powers of the first n positive integers in terms of the column no. n of the Stirling2 numbers A048993 (see the formula and example given below, as well as the link).
From Wolfdieter Lang, Oct 12 2011: (Start)
With the formulas given below one finds for n >= 1, k >= 0, Sum_{j=1..n} j^k =
Sum_{m=0..min(k,n-1)} ((n-m)*S1(n+1, n-m+1)*S2(k+n-m, n)),
with the Stirling numbers S1 from A048994 and S2 from A048993 (this formula I did not (yet) find in the literature). See the link for the proof.
For two other formulas expressing these sums of k-th powers of the first n positive integers in terms of the row no. k of Stirling2 numbers and binomials in n see the D. E. Knuth reference given under A093556, p. 285.
See also the given link below, eqs. (11) and (12). (End)

Examples

			n\m  0    1    2     3     4      5...
1    1
2    2   -3
3    3  -12   11
4    4  -30   70   -50
5    5  -60  255  -450   274
6    6 -105  700 -2205  3248  -1764
...
n=4 (A001551=2*A196836): the row polynomial factorizes into 2*(2-5*x)*(1-5*x+5*x^2).
n=5: 1^k + 2^k + 3^k + 4^k + 5^k, k>=0, (A001552) has as e.g.f. Sum_{j=1..5} exp(j*x). The o.g.f. is
  Sum_{j=1..5} 1/(1-j*x), and this is
  (5 - 60*x + 255*x^2 - 450*x^3 + 274*x^4)/Product_{j=1..5} (1-j*x).
n=6 (A001553): the row polynomial factorizes into
     (2 - 7*x)*(3 - 42*x + 203*x^2 - 392*x^3 + 252*x^4).
Sums of powers of the first n positive integers in terms of S2:
n=4: A001551(k) = 4*S2(k+4,4) - 30*S2(k+3,4) + 70*S2(k+2,4) - 50*S2(k+1,4), k >= 0. E.g., k=3: 4*350 - 30*65 + 70*10 - 50*1 = 100 = A001551(3).
From _Wolfdieter Lang_, Oct 12 2011: (Start)
Row polynomial for n=3: P(3,x) = (1-2*x)*(1-3*x) + (1-1*x)*(1-3*x) + (1-1*x)*(1-2*x) = 3 - 12*x + 11*x^2.
a(3,2) = +(sigma_2(2,3) + sigma_2(1,3) + sigma_2(1,2)) =
  2*3 + 1*3 + 1*2 = 11 = +1*sigma_2(1,2,3) = +1*|S1(4,4-2)|.
S1,S2 formula for sums of powers with n=4, k=3:
A001551(3) = Sum_{j=1..n} j^3 = 1*4*350 - 3*10*65 + 2*35*10 - 1*50*1 = 100. (End)
		

Crossrefs

Cf. A103438, A093556/A093557 (for sums of powers).

Programs

  • Mathematica
    a[n_, m_] := (n-m)*StirlingS1[n+1, n+1-m]; Flatten[ Table[ a[n, m], {n, 1, 10}, {m, 0, n-1}] ] (* Jean-François Alcover, Dec 02 2011, after Wolfdieter Lang *)
  • Python
    from itertools import count, islice
    from sympy.functions.combinatorial.numbers import stirling
    def A196837_T(n,m): return (n-m)*stirling(n+1,n+1-m,kind=1,signed=True)
    def A196837_gen(): # generator of terms
        return (A196837_T(n,m) for n in count(1) for m in range(n))
    A196837_list = list(islice(A196837_gen(),40)) # Chai Wah Wu, Oct 24 2024

Formula

a(n,m) = [x^m] P(n,x), m=0..n-1, with the row polynomials defined by
(Sum_{j=1..n} 1/(1-j*x))*Product_{j=1..n} (1-j*x) (see the comment given above).
Sum_{j=1..n} j^k = Sum_{m=0..n-1} a(n,m)*S2(k+n-m,n), n >= 1, k >= 0, with the Stirling2 triangle A048993.
From Wolfdieter Lang, Oct 12 2011: (Start)
The row polynomial P(n,x) is therefore
Sum_{j=1..n} (Product_{k=1..n omitting k=j} (1-k*x)), n >= 1. This leads to:
a(n,m) = (n-m)*S1(n+1, n+1-m), n-1 >= m >= 0, with the (signed) Stirling1 numbers A048994. For the proof see the link.
(End)
A similar polynomial occurs in the expansion of 1/(n+x)^2 as a series with factorials in the denominator: 1/(n+x)^2 = -Sum_{k>=1} n!/(n+k+1)! * P(k,1/x) x^(k-1). - Matt Majic, Nov 01 2019

A341410 a(n) = (Sum_{k=1..4} k^n) mod n.

Original entry on oeis.org

0, 0, 1, 2, 0, 0, 3, 2, 1, 0, 10, 6, 10, 2, 10, 2, 10, 12, 10, 14, 16, 8, 10, 18, 0, 4, 1, 18, 10, 0, 10, 2, 1, 30, 5, 30, 10, 30, 22, 34, 10, 18, 10, 2, 10, 30, 10, 18, 31, 0, 49, 42, 10, 30, 35, 2, 43, 30, 10, 54, 10, 30, 37, 2, 0, 6, 10, 14, 31, 60, 10, 66, 10, 30
Offset: 1

Views

Author

Seiichi Manyama, Feb 11 2021

Keywords

Crossrefs

(Sum_{k=1..m} k^n) mod n: A096196 (m=2), A341409 (m=3), this sequence (m=4), A341411 (m=5), A341412 (m=6), A341413 (m=7).

Programs

  • Maple
    a:= n-> add(i&^n, i=1..4) mod n:
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 11 2021
  • Mathematica
    a[n_] := Mod[Sum[k^n, {k, 1, 4}], n]; Array[a, 100] (* Amiram Eldar, Feb 11 2021 *)
  • PARI
    a(n) = sum(k=1, 4, k^n)%n;

Formula

a(n) = A001551(n) mod n.
a(A056643(n)) = 0.

A366299 Expansion of e.g.f. 1 / (-3 + Sum_{k=1..4} exp(-k*x)).

Original entry on oeis.org

1, 10, 170, 4300, 145046, 6115900, 309453710, 18267444100, 1232400398966, 93535914320620, 7887919177776350, 731710341934820500, 74046493229735962886, 8117679564133907097340, 958393800813241073719790, 121232569802975799394430500, 16357741845227058108680934806, 2345072789674603792983906178060
Offset: 0

Views

Author

Ilya Gutkovskiy, Oct 06 2023

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 17; CoefficientList[Series[1/(-3 + Sum[Exp[-k x], {k, 1, 4}]), {x, 0, nmax}], x] Range[0, nmax]!
    a[0] = 1; a[n_] := a[n] = Sum[(-1)^(k + 1) Binomial[n, k] (1 + 2^k + 3^k + 4^k) a[n - k], {k, 1, n}]; Table[a[n], {n, 0, 17}]

Formula

a(0) = 1; a(n) = Sum_{k=1..n} (-1)^(k+1) * binomial(n,k) * (1 + 2^k + 3^k + 4^k) * a(n-k).

A135168 a(n) = 7^n + 5^n + 3^n + 2^n.

Original entry on oeis.org

4, 17, 87, 503, 3123, 20207, 134067, 903983, 6162243, 42326927, 292300947, 2026334063, 14085963363, 98111316047, 684331387827, 4778093469743, 33385561572483, 233393582711567, 1632228682858707, 11417969834487023, 79887637217085603, 559022711703937487
Offset: 0

Views

Author

Omar E. Pol, Nov 21 2007

Keywords

Comments

Constants (7,5,3,2) are the prime numbers in decreasing order.

Examples

			a(4) = 3123 = 7^4 + 5^4 + 3^4 + 2^4 = 2401 + 625 + 81 + 16.
		

Crossrefs

Programs

Formula

From G. C. Greubel, Sep 30 2016: (Start)
a(n) = 17*a(n-1) - 101*a(n-2) + 247*a(n-3) - 210*a(n-4).
G.f.: (4 - 51*x + 202*x^2 - 247*x^3)/((1 -2*x)*(1 -3*x)*(1 -5*x)*(1 -7*x)).
E.g.f.: exp(7*x) + exp(5*x) + exp(3*x) + exp(2*x). (End)

Extensions

Edited by N. J. A. Sloane, Dec 14 2007

A196836 a(n) = (1^n + 2^n +3^n + 4^n)/2.

Original entry on oeis.org

2, 5, 15, 50, 177, 650, 2445, 9350, 36177, 141170, 554325, 2186750, 8656377, 34355690, 136617405, 544061750, 2169039777, 8654570210, 34553579685, 138020346350, 551499730377, 2204254480730, 8811785649165, 35231447872550, 140878711512177, 563373614503250
Offset: 0

Views

Author

Wolfdieter Lang, Oct 10 2011

Keywords

Comments

2*a(n) = A001551(n), n>=0.

Crossrefs

Cf. A001551/2.

Programs

  • Mathematica
    Table[Total[Range[4]^n]/2, {n, 0, 40}] (* T. D. Noe, Oct 10 2011 *)

Formula

a(n) = (1^n + 2^n + 3^n + 4^n)/2, n>=0.
E.g.f.: (1-exp(4*x))/(2*(exp(-x)-1)) = Sum_{j=1..4} exp(j*x)/2.
O.g.f.: (2-5*x)*(1-5*x+5*x^2)/(Product_{j=1..4} (1-j*x)) (via Laplace transformation of the o.g.f.).

A056643 Numbers n such that n | 4^n + 3^n + 2^n + 1^n.

Original entry on oeis.org

1, 2, 5, 6, 10, 25, 30, 50, 65, 125, 150, 190, 250, 625, 750, 978, 1250, 1558, 1625, 2405, 2425, 2575, 3125, 3750, 3890, 5050, 6250, 13250, 15150, 15625, 18750, 25250, 31250, 40625, 71669, 72010, 75750, 78125, 93750, 95950, 96217, 99250, 115625
Offset: 1

Views

Author

Robert G. Wilson v, Aug 25 2000

Keywords

Crossrefs

Cf. A001551.

Programs

  • Mathematica
    Do[ If[ Mod[ PowerMod[ 4, n, n ] + PowerMod[ 3, n, n ] + PowerMod[ 2, n, n ] + 1, n ] == 0, Print[ n ] ], {n, 1, 10^6} ]

Formula

All numbers of the forms 5^k, 2*5^k & 6*5^k are in the sequence. - Farideh Firoozbakht, Nov 21 2006
Showing 1-7 of 7 results.