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-10 of 12 results. Next

A001008 a(n) = numerator of harmonic number H(n) = Sum_{i=1..n} 1/i.

Original entry on oeis.org

1, 3, 11, 25, 137, 49, 363, 761, 7129, 7381, 83711, 86021, 1145993, 1171733, 1195757, 2436559, 42142223, 14274301, 275295799, 55835135, 18858053, 19093197, 444316699, 1347822955, 34052522467, 34395742267, 312536252003, 315404588903, 9227046511387
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.
By Wolstenholme's theorem, p^2 divides a(p-1) for all primes p > 3.
From Alexander Adamchuk, Dec 11 2006: (Start)
p divides a(p^2-1) for all primes p > 3.
p divides a((p-1)/2) for primes p in A001220.
p divides a((p+1)/2) or a((p-3)/2) for primes p in A125854.
a(n) is prime for n in A056903. Corresponding primes are given by A067657. (End)
a(n+1) is the numerator of the polynomial A[1, n](1) where the polynomial A[genus 1, level n](m) is defined to be Sum_{d = 1..n - 1} m^(n - d)/d. (See the Mathematica procedure generating A[1, n](m) below.) - Artur Jasinski, Oct 16 2008
Better solutions to the card stacking problem have been found by M. Paterson and U. Zwick (see link). - Hugo Pfoertner, Jan 01 2012
a(n) = A213999(n, n-1). - Reinhard Zumkeller, Jul 03 2012
a(n) coincides with A175441(n) if and only if n is not from the sequence A256102. The quotient a(n) / A175441(n) for n in A256102 is given as corresponding entry of A256103. - Wolfdieter Lang, Apr 23 2015
For a very short proof that the Harmonic series diverges, see the Goldmakher link. - N. J. A. Sloane, Nov 09 2015
All terms are odd while corresponding denominators (A002805) are all even for n > 1 (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, ... ].
Coincidences with A175441: the first 19 entries coincide because 20 is the first entry of A256102. Indeed, a(20)/A175441(20) = 55835135 / 11167027 = 5 = A256103(1). - _Wolfdieter Lang_, Apr 23 2015
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 258-261.
  • H. W. Gould, Combinatorial Identities, Morgantown Printing and Binding Co., 1972, # 1.45, page 6, #3.122, page 36.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 259.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, page 347.
  • 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.
  • 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. A145609-A145640. - Artur Jasinski, Oct 16 2008
Cf. A003506. - Paul Curtz, Nov 30 2013
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.
Cf. A195505.

Programs

  • GAP
    List([1..30],n->NumeratorRat(Sum([1..n],i->1/i))); # Muniru A Asiru, Dec 20 2018
  • Haskell
    import Data.Ratio ((%), numerator)
    a001008 = numerator . sum . map (1 %) . enumFromTo 1
    a001008_list = map numerator $ scanl1 (+) $ map (1 %) [1..]
    -- Reinhard Zumkeller, Jul 03 2012
    
  • Magma
    [Numerator(HarmonicNumber(n)): n in [1..30]]; // Bruno Berselli, Feb 17 2016
    
  • Maple
    A001008 := proc(n)
        add(1/k,k=1..n) ;
        numer(%) ;
    end proc:
    seq( A001008(n),n=1..40) ; # Zerinvary Lajos, Mar 28 2007; R. J. Mathar, Dec 02 2016
  • Mathematica
    Table[Numerator[HarmonicNumber[n]], {n, 30}]
    (* Procedure generating A[1,n](m) (see Comments section) *) m =1; aa = {}; Do[k = 0; Do[k = k + m^(r - d)/d, {d, 1, r - 1}]; AppendTo[aa, k], {r, 1, 20}]; aa (* Artur Jasinski, Oct 16 2008 *)
    Numerator[Accumulate[1/Range[25]]] (* Alonso del Arte, Nov 21 2018 *)
    Numerator[Table[((n - 1)/2)*HypergeometricPFQ[{1, 1, 2 - n}, {2, 3}, 1] + 1, {n, 1, 29}]] (* Artur Jasinski, Jan 08 2021 *)
  • PARI
    A001008(n) = numerator(sum(i=1,n,1/i)) \\ Michael B. Porter, Dec 08 2009
    
  • PARI
    H1008=List(1); A001008(n)={for(k=#H1008,n-1,listput(H1008,H1008[k]+1/(k+1))); numerator(H1008[n])} \\ about 100x faster for n=1..1500. - M. F. Hasler, Jul 03 2019
    
  • Python
    from sympy import Integer
    [sum(1/Integer(i) for i in range(1, n + 1)).numerator() for n in range(1, 31)]  # Indranil Ghosh, Mar 23 2017
    
  • 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 A001008(n): H = harmonic(1,n+1); return numerator(H[0]/H[1])
    [A001008(n) for n in (1..29)] # Peter Luschny, Sep 01 2012
    

Formula

H(n) ~ log n + gamma + O(1/n). [See Hardy and Wright, Th. 422.]
log n + gamma - 1/n < H(n) < log n + gamma + 1/n [follows easily from Hardy and Wright, Th. 422]. - David Applegate and N. J. A. Sloane, Oct 14 2008
G.f. for H(n): log(1-x)/(x-1). - Benoit Cloitre, Jun 15 2003
H(n) = sqrt(Sum_{i = 1..n} Sum_{j = 1..n} 1/(i*j)). - Alexander Adamchuk, Oct 24 2004
a(n) is the numerator of Gamma/n + Psi(1 + n)/n = Gamma + Psi(n), where Psi is the digamma function. - Artur Jasinski, Nov 02 2008
H(n) = 3/2 + 2*Sum_{k = 0..n-3} binomial(k+2, 2)/((n-2-k)*(n-1)*n), n > 1. - Gary Detlefs, Aug 02 2011
H(n) = (-1)^(n-1)*(n+1)*n*Sum_{k = 0..n-1} k!*Stirling2(n-1, k) * Stirling1(n+k+1,n+1)/(n+k+1)!. - Vladimir Kruchinin, Feb 05 2013
H(n) = n*Sum_{k = 0..n-1} (-1)^k*binomial(n-1,k)/(k+1)^2. (Wenchang Chu) - Gary Detlefs, Apr 13 2013
H(n) = (1/2)*Sum_{k = 1..n} (-1)^(k-1)*binomial(n,k)*binomial(n+k, k)/k. (H. W. Gould) - Gary Detlefs, Apr 13 2013
E.g.f. for H(n) = a(n)/A002805(n): (gamma + log(x) - Ei(-x)) * exp(x), where gamma is the Euler-Mascheroni constant, and Ei(x) is the exponential integral. - Vladimir Reshetnikov, Apr 24 2013
H(n) = residue((psi(-s)+gamma)^2/2, {s, n}) where psi is the digamma function and gamma is the Euler-Mascheroni constant. - Jean-François Alcover, Feb 19 2014
H(n) = Sum_{m >= 1} n/(m^2 + n*m) = gamma + digamma(1+n), numerators and denominators. (see Mathworld link on Digamma). - Richard R. Forberg, Jan 18 2015
H(n) = (1/2) Sum_{j >= 1} Sum_{k = 1..n} ((1 - 2*k + 2*n)/((-1 + k + j*n)*(k + j*n))) + log(n) + 1/(2*n). - Dimitri Papadopoulos, Jan 13 2016
H(n) = (n!)^2*Sum_{k = 1..n} 1/(k*(n-k)!*(n+k)!). - Vladimir Kruchinin, Mar 31 2016
a(n) = Stirling1(n+1, 2) / gcd(Stirling1(n+1, 2), n!) = A000254(n) / gcd(A000254(n), n!). - Max Alekseyev, Mar 01 2018
From Peter Bala, Jan 31 2019: (Start)
H(n) = 1 + (1 + 1/2)*(n-1)/(n+1) + (1/2 + 1/3)*(n-1)*(n-2)/((n+1)*(n+2)) + (1/3 + 1/4)*(n-1)*(n-2)*(n-3)/((n+1)*(n+2)*(n+3)) + ... .
H(n)/n = 1 + (1/2^2 - 1)*(n-1)/(n+1) + (1/3^2 - 1/2^2)*(n-1)*(n-2)/((n+1)*(n+2)) + (1/4^2 - 1/3^2)*(n-1)*(n-2)*(n-3)/((n+1)*(n+2)*(n+3)) + ... .
For odd n >= 3, (1/2)*H((n-1)/2) = (n-1)/(n+1) + (1/2)*(n-1)*(n-3)/((n+1)*(n+3)) + 1/3*(n-1)*(n-3)*(n-5)/((n+1)*(n+3)*(n+5)) + ... . Cf. A195505. See the Bala link in A036970. (End)
H(n) = ((n-1)/2) * hypergeom([1,1,2-n], [2,3], 1) + 1. - Artur Jasinski, Jan 08 2021
Conjecture: for nonzero m, H(n) = (1/m)*Sum_{k = 1..n} ((-1)^(k+1)/k) * binomial(m*k,k)*binomial(n+(m-1)*k,n-k). The case m = 1 is well-known; the case m = 2 is given above by Detlefs (dated Apr 13 2013). - Peter Bala, Mar 04 2022
a(n) = the (reduced) numerator 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
H(n) = Sum_{k=1..n} (-1)^(k-1)*binomial(n,k)/k (H. W. Gould). - Gary Detlefs, May 28 2024

Extensions

Edited by Max Alekseyev, Oct 21 2011
Changed title, deleting the incorrect name "Wolstenholme numbers" which conflicted with the definition of the latter in both Weisstein's World of Mathematics and in Wikipedia, as well as with OEIS A007406. - Stanislav Sykora, Mar 25 2016

A067657 Prime values of A001008, the numerators of the harmonic numbers.

Original entry on oeis.org

3, 11, 137, 761, 7129, 18858053, 34395742267, 85691034670497533, 252476961434436524654789, 928551009361054917576341971, 42409610330030873613929048033, 4868007055309996043055960217131137
Offset: 1

Views

Author

Benoit Cloitre, Feb 03 2002

Keywords

Comments

This sequence comprises the only primes for which 1/Sum_{k=1..c}(1/(a(n)*k)) is an integer for some c >= 2, yielding A002805(A056903(n)) for c = A056903(n). E.g. for n = 2: a(2) = 11, A056903(2) = 3, and 1 / (1/11 + 1/22 + 1/33) = 6 = A002805(A056903(2)). - Charles L. Hohn, Apr 02 2025

Crossrefs

Programs

  • Mathematica
    Table[ HarmonicNumber[n], {n, 0, 80}] // Numerator // Select[#, PrimeQ]& (* Jean-François Alcover, May 27 2013 *)

Formula

A001008 INTERSECT A000040.
a(n) = A001008(A056903(n)). - Amiram Eldar, Jun 02 2022

A124837 Numerators of third-order harmonic numbers (defined by Conway and Guy, 1996).

Original entry on oeis.org

1, 7, 47, 57, 459, 341, 3349, 3601, 42131, 44441, 605453, 631193, 655217, 1355479, 23763863, 24444543, 476698557, 162779395, 166474515, 34000335, 265842403, 812400067, 20666950267, 21010170067, 192066102203, 194934439103
Offset: 1

Views

Author

Jonathan Vos Post, Nov 10 2006

Keywords

Comments

Denominators are A124838. All fractions reduced. Thanks to Jonathan Sondow for verifying these calculations. He suggests that the equivalent definition in terms of first order harmonic numbers may be computationally simpler. We are happy with the description of A027612 Numerator of 1/n + 2/(n-1) + 3/(n-2) + ... + (n-1)/2 + n, but baffled by the description of A027611.
From Alexander Adamchuk, Nov 11 2006: (Start)
a(n) is the numerator of H(n, (3)) = Sum_{m=1..n} Sum_{k=1..m} HarmonicNumber(k).
Denominators are listed in A124838.
p divides a(p-5) for prime p > 5.
Primes are listed in A129880.
Numbers k such that a(k) is prime are listed in A129881. (End)

Examples

			a(1) = 1 = numerator of 1/1.
a(2) = 7 = numerator of 1/1 + 5/2 = 7/2.
a(3) = 47 = numerator of 7/2 + 13/3 = 47/6.
a(4) = 57 = numerator of 47/6 + 77/12 = 57/4.
a(5) = 549 = numerator of 57/4 + 87/10 = 549/20.
a(6) = 341 = numerator of 549/20 + 223/20 = 341/10
a(7) = 3349 = numerator of 341/10 + 481/35 = 3349/70.
a(8) = 88327 = numerator of 3349/70 + 4609/280 = 88327/1260.
a(9) = 3844 = numerator of 88327/1260 + 4861/252 = 3844/45.
a(10) = 54251 = numerator of 3844/45 + 55991/2520 = 54251/504, or, untelescoping:
a(10) = 54251 = numerator of 1/1 + 5/2 + 13/3 + 77/12 + 87/10 + 223/20 + 481/35 + 4609/252 + 4861/252 + 55991/2520 = 54251/504.
		

References

  • J. H. Conway and R. K. Guy, The Book of Numbers, New York: Springer-Verlag, pp. 143 and 258-259, 1996.

Crossrefs

Programs

  • Haskell
    a124837 n = a213998 (n + 2) (n - 1) -- Reinhard Zumkeller, Jul 03 2012
  • Mathematica
    Table[Numerator[(n+2)!/2!/n!*Sum[1/k,{k,3,n+2}]],{n,1,30}] (* Alexander Adamchuk, Nov 11 2006 *)

Formula

A124837(n)/A124838(n) = Sum{i=1..n} A027612(n)/A027611(n+1).
From Alexander Adamchuk, Nov 11 2006: (Start)
a(n) = numerator(Sum_{m=1..n} Sum_{l=1..m} Sum_{k=1..l} 1/k).
a(n) = numerator(((n+2)!/(2!*n!)) * Sum_{k=3..n+2} 1/k).
a(n) = numerator(((n+2)*(n+1)/2) * Sum_{k=3..n+2} 1/k). (End)
a(n) = numerator(Sum_{k=0..n-1} (-1)^k*binomial(-3,k)/(n-k)). - Gary Detlefs, Jul 18 2011
a(n) = A213998(n+2,n-1). - Reinhard Zumkeller, Jul 03 2012

Extensions

Corrected and extended by Alexander Adamchuk, Nov 11 2006

A124878 Primes in A027612.

Original entry on oeis.org

5, 13, 223, 4861, 197698279, 25472027467, 6975593267347, 218572480850557, 1592457339642613, 2955634782407818711841368777079578319, 2950127241932882597818337002939124083061, 232242878286351670588710938679161483012314573381293769
Offset: 1

Views

Author

Alexander Adamchuk, Nov 11 2006

Keywords

Examples

			A027612(n) begins {1, 5, 13, 77, 87, 223, 481, 4609, 4861, ...}.
Thus a(1) = 5, a(2) = 13, a(3) = 223, a(4) = 4861.
		

Crossrefs

A027612(n) are the numerators of second order harmonic numbers H(n, (2)).
Corresponding numbers n such that A027612(n) is prime are listed in A124879.

Programs

  • Mathematica
    s=1;Do[s=s+1/(n+1);f=Numerator[(n+1)*(s-1)]; If[PrimeQ[f],Print[{n,f}]],{n,1,1942}]
  • PARI
    lista(nn) = {for (n=1, nn, if (isprime(p=numerator(sum(k=1, n, k/(n-k+1)))), print1(p, ", ")););} \\ Michel Marcus, Jul 14 2018

Formula

a(n) = A027612(A124879(n)).

Extensions

a(12) from, and crossrefs edited by Michel Marcus, Jul 14 2018

A124879 Numbers k such that A027612(k) is prime.

Original entry on oeis.org

2, 3, 6, 9, 18, 25, 29, 30, 39, 84, 91, 125, 130, 184, 195, 199, 203, 241, 245, 273, 281, 378, 552, 571, 653, 776, 901, 1099, 1215, 1224, 1235, 1315, 1412, 1657, 1942, 2076, 2085, 2743, 2745, 2855, 2859, 3517, 3717, 4183, 4188, 4362, 4547, 4728, 4783
Offset: 1

Views

Author

Alexander Adamchuk, Nov 11 2006

Keywords

Examples

			A027612 begins {1, 5, 13, 77, 87, 223, 481, 4609, 4861, ...}.
Thus a(1) = 2, a(2) = 3, a(3) = 6, a(4) = 9.
		

Crossrefs

A027612(n) are the numerators of second order harmonic numbers H(n, (2)).
Corresponding primes in A027612 are listed in A124878.

Programs

  • Mathematica
    s=1;Do[s=s+1/(n+1);f=Numerator[(n+1)*(s-1)]; If[PrimeQ[f],Print[{n,f}]],{n,1,1942}]
  • PARI
    isok(n) = isprime(numerator(sum(k=1, n, k/(n-k+1)))); \\ Michel Marcus, Jul 14 2018

Extensions

More terms from Stefan Steinerberger, May 29 2007
Crossrefs edited by Michel Marcus, Jul 14 2018

A124880 Primes in A124837.

Original entry on oeis.org

7, 47, 42131, 23763863, 192066102203, 5733412167187, 34745876421709, 185813891783454008069, 171312804637561107990389, 29207630124216024960052176833, 6300447575454970515437116064749
Offset: 1

Views

Author

Alexander Adamchuk, Nov 11 2006

Keywords

Examples

			A124837(n) begins {1, 7, 47, 57, 459, 341, 3349, 3601, 42131, 44441, ...}.
Thus a(1) = 7, a(2) = 47, a(3) = 42131.
		

Crossrefs

A124837 are the numerators of third-order harmonic numbers H(n, (3)).
Corresponding numbers n such that A124837(n) is prime are listed in A124881.

Programs

  • Mathematica
    s=3/2;Do[s=s+1/n;f=Numerator[n*(n-1)/2*(s-3/2)]; If[PrimeQ[f],Print[{n-2,f}]],{n,3,125}]

Extensions

Crossrefs edited by Michel Marcus, Jul 14 2018

A124881 Numbers k such that A124837(k) is prime.

Original entry on oeis.org

2, 3, 9, 15, 25, 27, 33, 45, 55, 67, 70, 93, 94, 97, 112, 113, 125, 137, 189, 193, 212, 232, 262, 273, 281, 381, 453, 528, 670, 677, 742, 743, 827, 996, 1257, 1349, 1402, 1645, 1683, 2110, 2217, 2408, 2480, 2623, 3208, 3517, 3637, 3665, 4571, 4730
Offset: 1

Views

Author

Alexander Adamchuk, Nov 11 2006

Keywords

Examples

			A124837(n) begins {1, 7, 47, 57, 459, 341, 3349, 3601, 42131, 44441, ...}.
Thus a(1) = 2, a(2) = 3, a(3) = 9.
		

Crossrefs

A124837 are the numerators of third-order harmonic numbers H(n, (3)).
Corresponding primes in A124837 are listed in A124880.

Programs

  • Mathematica
    s=3/2;Do[s=s+1/n;f=Numerator[n*(n-1)/2*(s-3/2)]; If[PrimeQ[f],Print[{n-2,f}]],{n,3,1000}]

Extensions

More terms from Stefan Steinerberger, May 09 2007
Crossrefs edited by Michel Marcus, Jul 14 2018

A111354 Numbers n such that the numerator of Sum_{i=1..n} (1/i^2), in reduced form, is prime.

Original entry on oeis.org

2, 7, 13, 19, 121, 188, 252, 368, 605, 745, 1085, 1127, 1406, 1743, 1774, 2042, 2087, 2936, 3196, 3207, 3457, 4045, 7584, 10307, 12603, 12632, 14438, 14526, 14641, 15662, 15950, 16261, 18084, 18937, 19676, 40984, 45531, 46009, 48292, 48590
Offset: 1

Views

Author

Ryan Propper, Nov 05 2005

Keywords

Comments

Numbers n such that A007406(n) is prime.
Some of the larger entries may only correspond to probable primes.
A007406(n) are the Wolstenholme numbers: numerator of Sum 1/k^2, k = 1..n. Primes in A007406(n) are listed in A123751(n) = A007406(a(n)) = {5,266681,40799043101,86364397717734821,...}.
For prime p>3, Wolstenholme's theorem says that p divides A007406(p-1). Hence n+1 cannot be prime for any n>2 in this sequence. - 12 more terms from T. D. Noe, Nov 11 2005
No other n<50000. All n<=1406 yield provable primes. - T. D. Noe, Mar 08 2006

Examples

			A007406(n) begins {1, 5, 49, 205, 5269, 5369, 266681, 1077749, 9778141,...}.
Thus a(1) = 2 because A007406(2) = 5 is prime but A007406(1) = 1 is not prime.
a(2) = 7 because A007406(7) = 266681 is prime but all A007406(k) are composite for 2 < k < 7.
		

Crossrefs

Cf. A007406 (numerator of Sum_{i=1..n} (1/i^2)).

Programs

  • Mathematica
    s = 0; Do[s += 1/n^2; If[PrimeQ[Numerator[s]], Print[n]], {n, 1, 10^4}]
    Module[{nn=10400,t},t=Accumulate[1/Range[nn]^2];Select[Thread[{Range[nn],Numerator[t]}],PrimeQ[#[[2]]]&]][[;;,1]] (* The program generates the first 24 terms of the sequence. *) (* Harvey P. Dale, May 18 2025 *)

Extensions

12 more terms from T. D. Noe, Nov 11 2005
More terms from T. D. Noe, Mar 08 2006
Additional comments from Alexander Adamchuk, Oct 11 2006
Edited by N. J. A. Sloane, Nov 11 2006

A123751 Primes in A007406.

Original entry on oeis.org

5, 266681, 40799043101, 86364397717734821, 36190908596780862323291147613117849902036356128879432564211412588793094572280300268379995976006474252029, 334279880945246012373031736295774418479420559664800307123320901500922509788908032831003901108510816091067151027837158805812525361841612048446489305085140033
Offset: 1

Views

Author

Alexander Adamchuk, Oct 11 2006

Keywords

Comments

A007406 lists the Wolstenholme numbers.
Numbers k such that A007406(k) is prime are listed in A111354.

Examples

			A007406 begins {1, 5, 49, 205, 5269, 5369, 266681, 1077749, 9778141, ...}.
Thus a(1) = 5 because A007406(2) = 5 is prime but A007406(1) = 1 is not prime.
a(2) = 266681 because A007406(7) = 266681 is prime but all A007406(k) are composite for 2 < k < 7.
		

Crossrefs

Programs

  • Mathematica
    Do[f=Numerator[Sum[1/i^2,{i,1,n}]]; If[PrimeQ[f],Print[{n,f}]],{n,1,250}]

Formula

a(n) = A007406(A111354(n)).

A123538 Numbers n such that A064168(n) is prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 9, 10, 11, 14, 15, 20, 27, 35, 36, 39, 48, 77, 96, 99, 102, 112, 131, 167, 176, 201, 212, 339, 356, 411, 490, 546, 656, 684, 839, 878, 904, 920, 981, 999, 1106, 1260, 1431, 1588, 2119, 2271, 2322, 2513, 2588, 2630, 3013, 3228, 3717, 3822, 3904, 4248, 6270, 6491, 7013, 7228, 7341, 7982, 8483, 9191, 9419, 10139, 10498, 12967, 13597, 13627, 13835, 15594
Offset: 1

Views

Author

Alexander Adamchuk, Nov 11 2006

Keywords

Comments

A001008(n) + A002805(n) = A064168(n) is the sum of numerator and denominator in n-th harmonic number, 1 + 1/2 + 1/3 +...+ 1/n = A001008(n)/A002805(n). Corresponding primes in A064168(n) are listed in A118727(n) = A064168[a(n)] = {2, 5, 17, 37, 197, 503, 9649, 9901, 111431, ...} Primes that are the sum of the numerator and denominator of a harmonic number.

Examples

			Harmonic numbers begin H(n) = [ 1/1, 3/2, 11/6, 25/12, 137/60, 49/20, 363/140, 761/280, 7129/2520,... ].
A064168(n) begins {2, 5, 17, 37, 197, 69, 503, 1041, 9649, 9901, ...}.
Thus a(1) = 1, a(2) = 2, a(3) = 3, a(4) = 4, a(5) = 5 because A064168(n) is prime for n = {1, 2, 3, 4, 5}. The next term a(6) = 7 because A064168(7) = 503 is prime but A064168(6) = 69 is composite.
		

Crossrefs

Programs

  • Maple
    N:= 10^4: # to get terms <= N
    H:= ListTools:-PartialSums([seq(1/i,i=1..N)]):
    select(t -> isprime(numer(H[t])+denom(H[t])), [$1..N]); # Robert Israel, May 30 2019
  • Mathematica
    s=0;Do[s=s+1/n;ss=Numerator[s]+Denominator[s];If[PrimeQ[ss],Print[{n,ss}]],{n,1,1106}]
    hnpQ[n_]:=With[{hn=HarmonicNumber[n]},PrimeQ[Denominator[hn]+Numerator[hn]]]; Select[Range[4000],hnpQ] (* The program generates the first 55 terms of the sequence. *) (* Harvey P. Dale, Nov 27 2024 *)

Extensions

More terms from Stefan Steinerberger, May 13 2007
More terms from Robert Israel, May 30 2019
Showing 1-10 of 12 results. Next