(HP15C)(HP67)(HP41C) Bernoulli Polynomials
|
08-29-2023, 03:49 PM
Post: #4
|
|||
|
|||
RE: (HP15C)(HP67)(HP41C) Bernoulli Polynomials
Hi, Namir
We could trade speed for space getting Stirling number of the 2nd kind. Code: SS(n,k) := sum((-1)^(k-j) * comb(k,j)*j^n, j = 0 .. k); XCas> [S(5,k) for k in range(1,6)] /* x^5 falling factorial coefficients */ [1, 15, 25, 10, 1] Bernoulli numbers from Stirling numbers 2nd kind Code: B0(m) := { XCas> map(B0, range(10)) [1, -1/2, 1/6, 0, -1/30, 0, 1/42, 0, -1/30, 0] Code: sum_xm(x,m) := {local k, t := 1/(m+1); XCas> sum_xm(101, 1); /* = sum(k, k=0 .. 100) */ 5050 XCas> sqrt(sum_xm(101, 3)); /* sum of cubes = square of sum */ 5050 XCaS> B2(5, 3.5), B2(3, 5.5); /* OP example */ 220.9375, 123.75 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)