cp's OEIS Frontend

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.

Showing 1-5 of 5 results.

A002805 Denominators of harmonic numbers H(n) = Sum_{i=1..n} 1/i.

Original entry on oeis.org

1, 2, 6, 12, 60, 20, 140, 280, 2520, 2520, 27720, 27720, 360360, 360360, 360360, 720720, 12252240, 4084080, 77597520, 15519504, 5173168, 5173168, 118982864, 356948592, 8923714800, 8923714800, 80313433200, 80313433200, 2329089562800, 2329089562800, 72201776446800
Offset: 1

Views

Author

Keywords

Comments

H(n)/2 is the maximal distance that a stack of n cards can project beyond the edge of a table without toppling.
If n is not in {1, 2, 6} then a(n) has at least one prime factor other than 2 or 5. E.g., a(5) = 60 has a prime factor 3 and a(7) = 140 has a prime factor 7. This implies that every H(n) = A001008(n)/A002805(n), n not from {1, 2, 6}, has an infinite decimal representation. For a proof see the J. Havil reference. - Wolfdieter Lang, Jun 29 2007
a(n) = A213999(n,n-1). - Reinhard Zumkeller, Jul 03 2012
From Wolfdieter Lang, Apr 16 2015: (Start)
a(n)/A001008(n) = 1/H(n) is the solution of the following version of the classical cistern and pipes problem. A cistern is connected to n different pipes of water. For the k-th pipe it takes k time units (say, days) to fill the empty cistern, for k = 1, 2, ..., n. How long does it take for the n pipes together to fill the empty cistern? 1/H(n) gives the answer as a fraction of the time unit.
In general, if the k-th pipe needs d(k) days to fill the empty cistern then all pipes together need 1/Sum_{k=1..n} 1/d(k) = HM(d(1), ..., d(n))/n days, where HM denotes the harmonic mean HM. For the described problem, HM(1, 2, ..., n)/n = A102928(n)/(n*A175441(n)) = 1/H(n).
For a classical cistern and pipes problem see, e.g., the Hunger-Vogel reference (in Greek and German) given in A256101, problem 27, p. 29, where n = 3, and d(1), d(2) and d(3) are 6, 4 and 3 days. On p. 97 of this reference one finds remarks on the history of such problems (called in German 'Brunnenaufgabe'). (End)
From Wolfdieter Lang, Apr 17 2015: (Start)
An example of the above mentioned cistern and pipes problems appears in Chiu Chang Suan Shu (nine books on arithmetic) in book VI, problem 26. The numbers are there 1/2, 1, 5/2, 3 and 5 (days) and the result is 15/75 (day). See the reference (in German) on p. 68.
A historical account on such cistern problems is found in the Johannes Tropfke reference, given in A256101, section 4.2.1.2 Zisternenprobleme (Leistungsprobleme), pp. 578-579.
In Fibonacci's Liber Abaci such problems appear on p. 281 and p. 284 of L. E. Sigler's translation. (End)
All terms > 1 are even while corresponding numerators (A001008) are all odd (proof in Pólya and Szegő). - Bernard Schott, Dec 24 2021

Examples

			H(n) = [ 1, 3/2, 11/6, 25/12, 137/60, 49/20, 363/140, 761/280, 7129/2520, ... ] = A001008/A002805.
		

References

  • Chiu Chang Suan Shu, Neun Bücher arithmetischer Technik, translated and commented by Kurt Vogel, Ostwalds Klassiker der exakten Wissenschaften, Band 4, Friedr. Vieweg & Sohn, Braunschweig, 1968, p. 68.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 258-261.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 259.
  • J. Havil, Gamma, (in German), Springer, 2007, p. 35-6; Gamma: Exploring Euler's Constant, Princeton Univ. Press, 2003.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 1, p. 615.
  • G. Pólya and G. Szegő, Problems and Theorems in Analysis, volume II, Springer, reprint of the 1976 edition, 1998, problem 251, p. 154.
  • L. E. Sigler, Fibonacci's Liber Abaci, Springer, 2003, pp. 281, 284.
  • 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).

Crossrefs

Cf. A001008 (numerators), A075135, A025529, A203810, A203811, A203812.
Partial sums: A027612/A027611 = 1, 5/2, 13/3, 77/12, 87/10, 223/20,...
The following fractions are all related to each other: Sum 1/n: A001008/A002805, Sum 1/prime(n): A024451/A002110 and A106830/A034386, Sum 1/nonprime(n): A282511/A282512, Sum 1/composite(n): A250133/A296358, Sum 1/n^2: A007406/A007407, Sum 1/n^3: A007408/A007409.

Programs

  • GAP
    List([1..30],n->DenominatorRat(Sum([1..n],i->1/i))); # Muniru A Asiru, Dec 20 2018
    
  • Haskell
    import Data.Ratio ((%), denominator)
    a002805 = denominator . sum . map (1 %) . enumFromTo 1
    a002805_list = map denominator $ scanl1 (+) $ map (1 %) [1..]
    -- Reinhard Zumkeller, Jul 03 2012
    
  • Magma
    [Denominator(HarmonicNumber(n)): n in [1..40]]; // Vincenzo Librandi, Apr 16 2015
    
  • Maple
    seq(denom(sum((2*k-1)/k, k=1..n), n=1..30); # Gary Detlefs, Jul 18 2011
    f:=n->denom(add(1/k, k=1..n)); # N. J. A. Sloane, Nov 15 2013
  • Mathematica
    Denominator[ Drop[ FoldList[ #1 + 1/#2 &, 0, Range[ 30 ] ], 1 ] ] (* Harvey P. Dale, Feb 09 2000 *)
    Table[Denominator[HarmonicNumber[n]], {n, 1, 40}] (* Stefan Steinerberger, Apr 20 2006 *)
    Denominator[Accumulate[1/Range[25]]] (* Alonso del Arte, Nov 21 2018 *)
  • PARI
    a(n)=denominator(sum(k=2,n,1/k)) \\ Charles R Greathouse IV, Feb 11 2011
    
  • Python
    from fractions import Fraction
    def a(n): return sum(Fraction(1, i) for i in range(1, n+1)).denominator
    print([a(n) for n in range(1, 30)]) # Michael S. Branicky, Dec 24 2021
  • Sage
    def harmonic(a, b): # See the F. Johansson link.
        if b - a == 1 : return 1, a
        m = (a+b)//2
        p, q = harmonic(a,m)
        r, s = harmonic(m,b)
        return p*s+q*r, q*s
    def A002805(n) : H = harmonic(1,n+1); return denominator(H[0]/H[1])
    [A002805(n) for n in (1..29)] # Peter Luschny, Sep 01 2012
    

Formula

a(n) = Denominator(Sum_{k=1..n} (2*k-1)/k). - Gary Detlefs, Jul 18 2011
a(n) = n! / gcd(Stirling1(n+1, 2), n!) = n! / gcd(A000254(n),n!). - Max Alekseyev, Mar 01 2018
a(n) = the (reduced) denominator of the continued fraction 1/(1 - 1^2/(3 - 2^2/(5 - 3^2/(7 - ... - (n-1)^2/(2*n-1))))). - Peter Bala, Feb 18 2024

Extensions

Definition edited by Daniel Forgues, May 19 2010

A203810 Numerators of s(i) = s(i-1) - (1/i)*sign(s(i-1)) with s(1) = 1.

Original entry on oeis.org

1, 1, 1, -1, 7, -1, 13, -9, 199, -53, 1937, -373, 22871, -2869, 4231, -547, 134845, -1291, 2425919, 489967, -10595393, -13913, 232472561, 9379691, -1023947321, 5712079, -2957435363, -89098463, 77729577773, 93259013, -2326198533397, -139786038869, 385098109121
Offset: 1

Views

Author

Hugo Pfoertner and Rainer Rosenthal, Jan 06 2012

Keywords

Comments

Denominators are given in A203811.
Similar to harmonic series, but with signs chosen to minimize the absolute value of the next term.

Examples

			s(1)=1, to minimize abs(s(2)) 1/2 has to be subtracted. s(2)=1-1/2=1/2. Similar for s(3) and s(4): s(3)=s(2)-1/3=1/2-1/3=1/6, s(4)=1/6-1/4=-1/12. Since s(4) is negative s(5)=s(4)+1/5=-1/12+1/5=7/60. The numerators of s(1)...s(5) are 1, 1, 1, -1, 7 and the corresponding denominators are 1, 2, 6, 12, 60.
		

Crossrefs

Cf. A203811 (denominators), A203812 (minima of abs(A203810(i)/A203811(i))).
Cf. A001008, A002805 (harmonic numbers).

A203812 Numbers n where abs(s(n)) produces a new minimum, with s(1) = 1 and s(i) = s(i-1) - sign(s(i-1))*(1/i).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 22, 30, 38, 54, 70, 118, 126, 134, 150, 166, 182, 198, 214, 246, 278, 374, 534, 598, 662, 790, 854, 982, 1110, 1238, 1366, 1494, 1622, 1878, 2006, 2134, 2390, 2902, 3158, 3670, 5462, 5974, 6486, 6998, 10070, 11094, 12118
Offset: 1

Views

Author

Hugo Pfoertner and Rainer Rosenthal, Jan 06 2012

Keywords

Comments

Positions of decreasing minima of abs(A203810(i)/A203811(i)).

Examples

			The first 4 fractions f(i)=A203810(i)/A203811(i) 1/1, 1/2, 1/6, -1/12 have decreasing absolute values. Therefore a(1)=1, a(2)=2, a(3)=3, a(4)=4. 5 is not in the sequence, because f(5)=7/60>1/12, but f(6)=-1/20 gives a(5)=6 because 1/20<1/12.
Fractions producing further decreasing absolute values are f(8)=-9/280, f(10)=-53/2520, f(12)=-373/27720, f(14)=-2869/360360, f(16)=-547/144144, f(18)=-1291/2450448, f(22)=-13913/232792560, f(30)=93259013/232908956280.
		

Crossrefs

Programs

  • PARI
    s=0; d=2;\
    for (k=1,12500,if(s>0,s-=1/k,s+=1/k);if(abs(s)Hugo Pfoertner, Nov 14 2017

A231693 Define a sequence of rationals by f(0)=0, thereafter f(n)=f(n-1)-1/n if that is >= 0, otherwise f(n)=f(n-1)+1/n; a(n) = denominator of f(n).

Original entry on oeis.org

1, 1, 2, 6, 12, 60, 20, 140, 280, 2520, 2520, 27720, 27720, 360360, 360360, 360360, 720720, 12252240, 4084080, 77597520, 77597520, 11085360, 11085360, 254963280, 84987760, 424938800, 424938800, 11473347600, 80313433200, 2329089562800, 2329089562800, 72201776446800, 144403552893600, 144403552893600
Offset: 0

Views

Author

N. J. A. Sloane, Nov 15 2013

Keywords

Comments

See Comments in A231692, which is the sequence of numerators of {f(n)}.
Note that this sequence is not monotonic.
Differs from A002805 starting at a(20)=77597520: A002805(20)=15519504. See also A203811 for a very similar idea. - M. F. Hasler, Nov 15 2013

Examples

			0, 1, 1/2, 1/6, 5/12, 13/60, 1/20, 27/140, 19/280, 451/2520, 199/2520, 4709/27720, ...
		

References

  • David Wilson, Posting to Sequence Fans Mailing List, Nov 14 2013.

Crossrefs

Programs

  • Haskell
    a231693 n = a231693_list !! n
    a231693_list = map denominator $ 0 : wilson 1 0 where
       wilson x y = y' : wilson (x + 1) y'
                    where y' = y + (if y < 1 % x then 1 else -1) % x
    -- Reinhard Zumkeller, Nov 16 2013
    
  • Maple
    f:=proc(n) option remember;
    if n=0 then 0 elif
    f(n-1) >= 1/n then f(n-1)-1/n else f(n-1)+1/n; fi; end;
  • Mathematica
    Denominator[FoldList[# + (-1)^Boole[#*#2 >= 1]/#2 &, Range[0, 35]]] (* Paolo Xausa, Aug 16 2025 *)
  • PARI
    s=0;vector(30,n,denominator(s-=(-1)^(n*s<1)/n)) \\ M. F. Hasler, Nov 15 2013
    
  • Python
    from fractions import Fraction
    A231693 = [(f:=Fraction(0)).denominator] + [(f:=(f + (Fraction(1,i) if Fraction(1,i)>f else -Fraction(1,i)))).denominator for i in range(1, 34)]  # Jwalin Bhatt, Apr 08 2025

A232090 Minimal possible denominator for a sum of the form 1 +/- 1/2 +/- 1/3 +/- ... +/- 1/n.

Original entry on oeis.org

1, 2, 6, 12, 60, 20, 140, 280, 2520, 2520, 27720, 27720, 360360, 360360, 72072, 144144, 2450448, 272272, 5173168, 5173168, 739024, 739024, 16997552, 16997552, 424938800, 424938800, 11473347600, 11473347600, 332727080400, 332727080400
Offset: 1

Views

Author

M. F. Hasler, Nov 18 2013

Keywords

Comments

Differs from A203811 from a(18)=272272 on, and from A002805 and A231693 from a(15)=72072 on.

Crossrefs

Cf. A061195 (minimal possible positive numerator).

Programs

  • Mathematica
    nMax = 19; d = {0}; Table[d = Flatten[{d + 1/n, d - 1/n}]; Min[Denominator[d]], {n, nMax}] (* T. D. Noe, Nov 19 2013 *)
  • PARI
    for(n=0,19,m=(n+1)!;for(k=0,2^n-1,m=min(denominator(sum(j=2,n+1,(-1)^bittest(k,j-2)/j,1)),m));print1(m","))

Extensions

Terms a(21)-a(30) from David W. Wilson, Nov 19 2013
Showing 1-5 of 5 results.