A366189 a(n) is the positive integer k such that the k-th derivative of the n-th Bernoulli polynomial B(n, x) contains only integer coefficients but no lower derivative of B(n, x) has this property.
1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 2, 3, 3, 4, 3, 2, 3, 4, 5, 2, 3, 4, 1, 2, 1, 2, 3, 4, 5, 3, 1, 2, 3, 4, 5, 6, 3, 4, 5, 4, 5, 6, 7, 5, 3, 4, 3, 4, 5, 2, 3, 2, 3, 4, 1, 2, 3, 4, 5, 6, 3, 4, 4, 5, 2, 3, 3, 4, 5, 6, 7, 6, 3, 4, 3, 4, 5, 6, 5, 6, 7
Offset: 1
Keywords
Examples
B = Bernoulli(8, x). B = -(1/30) + (2/3)*x^2 - (7/3)*x^4 + (14/3)*x^6 - 4*x^7 + x^8; B' = (4/3)*x - (28/3)*x^3 + 28*x^5 - 28*x^6 + 8*x^7; B'' = (4/3) - 28*x^2 + 140*x^4 - 168*x^5 + 56*x^6; B''' = -56*x + 560*x^3 - 840*x^4 + 336*x^5. Thus the integral index of B is a(8) = 3.
Links
- Peter Luschny, Table of n, a(n) for n = 1..4000
Crossrefs
Programs
-
Maple
aList := proc(len) local n, k, d, A; A := Array([seq(0, n = 0..len-1)]); for n from 1 to len do k := 0: d:= 0; while d <> 1 do k := k + 1; d := denom(diff(bernoulli(n, x), `$`(x, k))); od; A[n] := k; od; convert(A, list) end: aList(86);
-
Mathematica
a[n_] := Module[{b, k, x}, b = BernoulliB[n, x]; For[k = 1, True, k++, b = D[b, x]; If[AllTrue[CoefficientList[b, x], IntegerQ], Return[k]]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Oct 23 2023 *)
-
Python
from itertools import count from sympy import Poly, bernoulli, diff from sympy.abc import x def A366189(n): p = Poly(bernoulli(n,x)) for i in count(1): p = diff(p) if all(c.is_integer for c in p.coeffs()): return i # Chai Wah Wu, Oct 03 2023
-
SageMath
def A366189List(len): A = [0 for _ in range(len)] P.
= ZZ[] for n in range(len): ber = bernoulli_polynomial(x, n + 1) k = 0 while True: k = k + 1 ber = diff(ber, x) if ber.denominator() == 1: A[n] = k; break return A print(A366189List(86)) # Peter Luschny, Oct 04 2023
Comments