This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A000146 M1717 N0680 #71 Feb 16 2025 08:32:20 %S A000146 1,1,1,1,1,1,2,-6,56,-528,6193,-86579,1425518,-27298230,601580875, %T A000146 -15116315766,429614643062,-13711655205087,488332318973594, %U A000146 -19296579341940067,841693047573682616,-40338071854059455412,2115074863808199160561,-120866265222965259346026 %N A000146 From von Staudt-Clausen representation of Bernoulli numbers: a(n) = Bernoulli(2n) + Sum_{(p-1)|2n} 1/p. %C A000146 The von Staudt-Clausen theorem states that this number is always an integer. %D A000146 G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Th. 118. %D A000146 Max Koecher, Klassische elementare Analysis, Birkhäuser, Basel, Boston, 1987, pp. 168-170. %D A000146 H. Rademacher, Topics in Analytic Number Theory, Springer, 1973, Section 5. %D A000146 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence). %D A000146 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A000146 Seiichi Manyama, <a href="/A000146/b000146.txt">Table of n, a(n) for n = 1..317</a> (first 100 terms from T. D. Noe) %H A000146 Joerg Arndt, <a href="/A000146/a000146.txt">Table of n, a(n) for n = 1..1000</a> (contains terms with more than 1000 decimal digits) %H A000146 Daniel Hoyt, <a href="/A000146/a000146_1.txt">Python 3 program for A000146.</a> %H A000146 Donald E. Knuth and Thomas J. Buckholtz, <a href="/A000182/a000182.pdf">Computation of tangent, Euler and Bernoulli numbers</a>, Math. Comp. 21 1967 663-688. [Annotated scanned copy] %H A000146 Donald E. Knuth and Thomas J. Buckholtz, <a href="http://dx.doi.org/10.1090/S0025-5718-1967-0221735-9">Computation of tangent, Euler and Bernoulli numbers</a>, Math. Comp. 21 1967 663-688. %H A000146 R. Mestrovic, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL17/Mestrovic/mes4.html">On a Congruence Modulo n^3 Involving Two Consecutive Sums of Powers</a>, Journal of Integer Sequences, Vol. 17 (2014), 14.8.4. %H A000146 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/vonStaudt-ClausenTheorem.html">von Staudt-Clausen Theorem</a> %H A000146 <a href="/index/Be#Bernoulli">Index entries for sequences related to Bernoulli numbers.</a> %p A000146 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 %t A000146 Table[ BernoulliB[2 n] + Total[ 1/Select[ Prime /@ Range[n+1], Divisible[2n, #-1] &]], {n, 1, 22}] (* _Jean-François Alcover_, Oct 12 2011 *) %o A000146 (PARI) a(n)=if(n<1,0,sumdiv(2*n,d, isprime(d+1)/(d+1))+bernfrac(2*n)) %o A000146 (Python) %o A000146 from fractions import Fraction %o A000146 from sympy import bernoulli, divisors, isprime %o A000146 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 %Y A000146 Cf. also A002882, A003245, A127187, A127188. %K A000146 sign,nice,easy %O A000146 1,7 %A A000146 _N. J. A. Sloane_ %E A000146 Signs courtesy of Antreas P. Hatzipolakis (xpolakis(AT)hol.gr) %E A000146 More terms from _Michael Somos_