Function Repository Resource:

 BernoulliBarnesB

Source Notebook

Compute Bernoulli–Barnes numbers and polynomials

Contributed by: Jayanta Phadikar

ResourceFunction["BernoulliBarnesB"][n,{α1,α2,…}]

gives the Bernoulli-Barnes number of order n associated with the specified period parameters.

ResourceFunction["BernoulliBarnesB"][n,{α1,α2,…},x]

gives the Bernoulli-Barnes polynomial of order n in x associated with the specified period parameters.

Details

The order n must be a nonnegative integer.
The second argument must be a nonempty list of nonzero period parameters.
For r period parameters, BernoulliBarnesB uses the exponential generating function Exp[xt]Product[t/(Exp[αjt]-1),{j,1,r}]==Sum[ResourceFunction["BernoulliBarnesB"][n,{α1,α2,…},x]t^n/n!,{n,0,Infinity}].
The periods may be exact or approximate, real or complex, and may remain symbolic.
ResourceFunction["BernoulliBarnesB"][n,periods] is defined as ResourceFunction["BernoulliBarnesB"][n,periods,0].
The periods {1} reproduce the built-in BernoulliB.

Examples

Basic Examples (4) 

Compute a Bernoulli-Barnes number:

In[1]:=
ResourceFunction["BernoulliBarnesB"][6, {2, 3}]
Out[1]=

Compute a Bernoulli-Barnes polynomial:

In[2]:=
ResourceFunction["BernoulliBarnesB"][4, {2, 3}, x]
Out[2]=

Generate the first several numbers for fixed periods:

In[3]:=
Table[ResourceFunction["BernoulliBarnesB"][n, {2, 3}], {n, 0, 6}]
Out[3]=

Plot a family of Bernoulli-Barnes polynomials:

In[4]:=
Plot[Evaluate[
  Table[ResourceFunction["BernoulliBarnesB"][n, {2, 3}, x], {n, 0, 5}]], {x, 0, 5}, PlotLegends -> Placed[Range[0, 5], Right], PlotRange -> All, ImageSize -> Medium]
Out[4]=

Scope (6) 

Use symbolic period parameters:

In[5]:=
ResourceFunction["BernoulliBarnesB"][2, {alpha, beta}, x]
Out[5]=

The function supports any positive rank:

In[6]:=
ResourceFunction[
 "BernoulliBarnesB"][3, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, x]
Out[6]=

Use algebraic or irrational period parameters:

In[7]:=
ResourceFunction["BernoulliBarnesB"][3, {1, Sqrt[2]}, x]
Out[7]=

Obtain a high-precision numerical value:

In[8]:=
N[ResourceFunction["BernoulliBarnesB"][5, {1/2 + I, 2 - I}, 1/3], 20]
Out[8]=

The polynomial variable can itself be an expression:

In[9]:=
Expand[ResourceFunction["BernoulliBarnesB"][4, {1, 2}, u + v]]
Out[9]=

Compare the defining exponential generating function with the reconstructed series:

In[10]:=
Expand[Normal[
   Series[Exp[x t] Times @@ (t/(Exp[#1 t] - 1) &) /@ {2, 3}, {t, 0, 5}]] - Total[
   Table[(ResourceFunction["BernoulliBarnesB"][n, {2, 3}, x] t^n)/
    n!, {n, 0, 5}]]]
Out[10]=

Properties and Relations (8) 

For one unit period, the function reduces to the built-in BernoulliB:

In[11]:=
Table[ResourceFunction["BernoulliBarnesB"][n, {1}, x] == BernoulliB[n, x], {n, 0, 10}]
Out[11]=

For one general period alpha, use the scaled Bernoulli polynomial:

In[12]:=
ResourceFunction["BernoulliBarnesB"][5, {alpha}, x] == Expand[alpha^4 BernoulliB[5, x/alpha]]
Out[12]=

Bernoulli-Barnes polynomials form an Appell sequence in x:

In[13]:=
Expand[\!\(
\*SubscriptBox[\(\[PartialD]\), \(x\)]\(\*
InterpretationBox[
TagBox[
FrameBox[
PaneBox[GridBox[{
{
StyleBox[
StyleBox[
AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>",
BoxBaselineShift->-0.25,
BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon",
FontColor->RGBColor[
              0.8745098039215686, 0.2784313725490196, 0.03137254901960784]],
ShowStringCharacters->False,
FontFamily->"Source Sans Pro Black",
FontSize->0.65 Inherited,
FontWeight->"Heavy",
PrivateFontOptions->{"OperatorSubstitution"->False}], 
StyleBox[
RowBox[{
StyleBox["\<\"BernoulliBarnesB\"\>", "ResourceFunctionLabel",
FontFamily->"Source Sans Pro"], " "}],
ShowAutoStyles->False,
ShowStringCharacters->False,
FontSize->0.9 Inherited,
FontColor->GrayLevel[0.09999084492227013]]}
},
GridBoxSpacings->{"Columns" -> {{0.25}}}],
Alignment->Left,
BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False},
BaselinePosition->Baseline,
FrameMargins->{{3, 0}, {0, 0}}],
Background->RGBColor[
        0.968505860940661, 0.976440431253161, 0.984252931253161],
BaselinePosition->Baseline,
DefaultBaseStyle->{LightDarkAutoColorRules -> <|"MarkedColors" -> True|>},
FrameMargins->{{0, 0}, {1, 1}},
FrameStyle->RGBColor[
        0.831298829690661, 0.847045900003161, 0.850952150003161],
RoundingRadius->4],
{"FunctionResourceBox", 
RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784],
        "BernoulliBarnesB"},
TagBoxNote->"FunctionResourceBox"],
ResourceFunction["BernoulliBarnesB"],
BoxID -> "BernoulliBarnesB",
Selectable->False][6, {2, 3}, x]\)\) - 6 ResourceFunction["BernoulliBarnesB"][5, {2, 3}, x]]
Out[13]=

Shifting x by one period removes that period and lowers the order:

In[14]:=
Expand[ResourceFunction["BernoulliBarnesB"][5, {alpha, beta}, x + alpha] - ResourceFunction["BernoulliBarnesB"][5, {alpha, beta}, x] - 5 ResourceFunction["BernoulliBarnesB"][4, {beta}, x]]
Out[14]=

Simultaneously scaling x and all r periods gives a homogeneous scaling law of degree n-r:

In[15]:=
FullSimplify[
 ResourceFunction["BernoulliBarnesB"][5, {c alpha, c beta}, c x] == c^3 ResourceFunction["BernoulliBarnesB"][5, {alpha, beta}, x], Assumptions -> c alpha beta != 0]
Out[15]=

Reflection about half the sum of the periods changes the sign according to the order:

In[16]:=
Expand[ResourceFunction["BernoulliBarnesB"][5, {alpha, beta}, alpha + beta - x] + ResourceFunction["BernoulliBarnesB"][5, {alpha, beta}, x]]
Out[16]=

The result is invariant under permutations of periods:

In[17]:=
Expand[ResourceFunction["BernoulliBarnesB"][7, {2, 3, 5}, x] - ResourceFunction["BernoulliBarnesB"][7, {5, 2, 3}, x]]
Out[17]=

The Appell addition formula holds:

In[18]:=
Expand[ResourceFunction["BernoulliBarnesB"][5, {2, 3}, x + y] - Total[Table[
    Binomial[5, k] ResourceFunction["BernoulliBarnesB"][k, {2, 3}, x] y^(5 - k), {k, 0, 5}]]]
Out[18]=

Possible Issues (2) 

A zero period makes the defining generating function singular, so such input is intentionally left unevaluated:

In[19]:=
ResourceFunction["BernoulliBarnesB"][4, {1, 0}, x]
Out[19]=

Negative or noninteger orders are outside the definition and remain unevaluated:

In[20]:=
ResourceFunction["BernoulliBarnesB"][-1, {1, 2}, x]
Out[20]=
In[21]:=
ResourceFunction["BernoulliBarnesB"][3/2, {1, 2}, x]
Out[21]=

Neat Examples (2) 

Visualize the first eight polynomials for three unit periods:

In[22]:=
Plot[Evaluate[
  Table[ResourceFunction["BernoulliBarnesB"][n, {1, 1, 1}, x], {n, 0, 7}]], {x, 0, 3}, PlotLegends -> Placed[Range[0, 7], Right], PlotRange -> All, ImageSize -> Medium]
Out[22]=

Display the real roots of a sequence of polynomials:

In[23]:=
Table[{n, x /. NSolve[
    ResourceFunction["BernoulliBarnesB"][n, {2, 3}, x] == 0 && 0 <= x <= 5, x, Reals]}, {n, 1, 8}]
Out[23]=

Publisher

Jayanta Kumar Phadikar

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.0 – 29 July 2026

Source Metadata

Related Resources

License Information