OFFSET
0,2
COMMENTS
Equivalently, denominators of Bernoulli twin numbers C(n) (cf. A051716).
The Bernoulli twin numbers C(n) are defined by C(0) = 1, then C(2n) = B(2n) + B(2n-1), C(2n+1) = -B(2n+1) - B(2n), where B() are the Bernoulli numbers A027641/A027642. The definition is due to Paul Curtz.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
M. Kaneko, The Akiyama-Tanigawa algorithm for Bernoulli numbers, J. Integer Sequences, 3 (2000), #00.2.9.
EXAMPLE
Bernoulli numbers: 1, -1/2, 1/6, 0, -1/30, 0, 1/42, 0, -1/30, 0, 5/66, ...
First differences: -3/2, 2/3, -1/6, -1/30, 1/30, 1/42, -1/42, -1/30, ...
Numerators: -3, 2, -1, -1, 1, 1, -1, -1, 1, 5, -5, -691, 691, 7, ...
Denominators: 2, 3, 6, 30, 30, 42, 42, 30, 30, 66, 66, 2730, ...
Sequence of C(n)'s begins: 1, -1/2, -1/3, -1/6, -1/30, 1/30, 1/42, -1/42, -1/30, 1/30, 5/66, -5/66, -691/2730, 691/2730, 7/6, -7/6, ...
MAPLE
C:=proc(n) if n=0 then RETURN(1); fi; if n mod 2 = 0 then RETURN(bernoulli(n)+bernoulli(n-1)); else RETURN(-bernoulli(n)-bernoulli(n-1)); fi; end;
MATHEMATICA
c[0]= 1; c[n_?EvenQ]:= BernoulliB[n] + BernoulliB[n-1]; c[n_?OddQ]:= -BernoulliB[n] - BernoulliB[n-1]; Table[Denominator[c[n]], {n, 0, 53}] (* Jean-François Alcover, Dec 19 2011 *)
Join[{1}, Denominator[Total/@Partition[BernoulliB[Range[0, 60]], 2, 1]]] (* Harvey P. Dale, Mar 09 2013 *)
Join[{1}, Denominator[Differences[BernoulliB[Range[0, 60]]]]] (* Harvey P. Dale, Jun 28 2021 *)
PROG
(PARI) a(n)=if(n<3, n+1, denominator(bernfrac(n)-bernfrac(n-1))) \\ Charles R Greathouse IV, May 18 2015
(Magma)
f:= func< n | Bernoulli(n) + Bernoulli(n-1) >;
function A051717(n)
if n eq 0 then return 1;
elif (n mod 2) eq 0 then return Denominator(f(n));
else return Denominator(-f(n));
end if;
end function;
[A051717(n): n in [0..50]]; // G. C. Greubel, Apr 22 2023
(SageMath)
def f(n): return bernoulli(n)+bernoulli(n-1)
def A051717(n):
if (n==0): return 1
elif (n%2==0): return denominator(f(n))
else: return denominator(-f(n))
[A051717(n) for n in range(51)] # G. C. Greubel, Apr 22 2023
CROSSREFS
KEYWORD
nonn,easy,nice,frac
AUTHOR
EXTENSIONS
More terms from James A. Sellers, Dec 08 1999
Edited by N. J. A. Sloane, May 25 2008
Entry revised by N. J. A. Sloane, Apr 22 2021
STATUS
approved