OFFSET
1,7
COMMENTS
The von Staudt-Clausen theorem states that this number is always an integer.
REFERENCES
G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Th. 118.
Max Koecher, Klassische elementare Analysis, Birkhäuser, Basel, Boston, 1987, pp. 168-170.
H. Rademacher, Topics in Analytic Number Theory, Springer, 1973, Section 5.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..317 (first 100 terms from T. D. Noe)
Joerg Arndt, Table of n, a(n) for n = 1..1000 (contains terms with more than 1000 decimal digits)
Daniel Hoyt, Python 3 program for A000146.
Donald E. Knuth and Thomas J. Buckholtz, Computation of tangent, Euler and Bernoulli numbers, Math. Comp. 21 1967 663-688. [Annotated scanned copy]
Donald E. Knuth and Thomas J. Buckholtz, Computation of tangent, Euler and Bernoulli numbers, Math. Comp. 21 1967 663-688.
R. Mestrovic, On a Congruence Modulo n^3 Involving Two Consecutive Sums of Powers, Journal of Integer Sequences, Vol. 17 (2014), 14.8.4.
Eric Weisstein's World of Mathematics, von Staudt-Clausen Theorem
MAPLE
A000146 := proc(n) local a , i, p; a := bernoulli(2*n) ; for i from 1 do p := ithprime(i) ; if (2*n) mod (p-1) = 0 then a := a+1/p ; elif p-1 > 2*n then break; end if; end do: a ; end proc: # R. J. Mathar, Jul 08 2011
MATHEMATICA
Table[ BernoulliB[2 n] + Total[ 1/Select[ Prime /@ Range[n+1], Divisible[2n, #-1] &]], {n, 1, 22}] (* Jean-François Alcover, Oct 12 2011 *)
PROG
(PARI) a(n)=if(n<1, 0, sumdiv(2*n, d, isprime(d+1)/(d+1))+bernfrac(2*n))
(Python)
from fractions import Fraction
from sympy import bernoulli, divisors, isprime
def A000146(n): return int(bernoulli(m:=n<<1)+sum(Fraction(1, d+1) for d in divisors(m, generator=True) if isprime(d+1))) # Chai Wah Wu, Apr 14 2023
CROSSREFS
KEYWORD
sign,nice,easy
AUTHOR
EXTENSIONS
Signs courtesy of Antreas P. Hatzipolakis (xpolakis(AT)hol.gr)
More terms from Michael Somos
STATUS
approved