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-6 of 6 results.

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

A014566 Sierpiński numbers of the first kind: n^n + 1.

Original entry on oeis.org

2, 2, 5, 28, 257, 3126, 46657, 823544, 16777217, 387420490, 10000000001, 285311670612, 8916100448257, 302875106592254, 11112006825558017, 437893890380859376, 18446744073709551617, 827240261886336764178, 39346408075296537575425, 1978419655660313589123980
Offset: 0

Views

Author

Keywords

Comments

Sierpiński primes of the form n^n + 1 are {2,5,257,...} = A121270. The prime p divides a((p-1)/2) for p = {5,7,13,23,29,31,37,47,53,61,71,...} = A003628 Primes congruent to {5, 7} mod 8. p^2 divides a((p-1)/2) for prime p = {29,37,3373,...}. - Alexander Adamchuk, Sep 11 2006
n divides a(n-1) for even n, or 2n divides a(2n-1). a(2n-1)/(2n) = A124899(n) = {1, 7, 521, 102943, 38742049, 23775972551, 21633936185161, 27368368148803711, 45957792327018709121, ...}. 2^n divides a(2^n-1). A014566[2^n - 1] / 2^n = A081216[2^n - 1] = A122000[n] = {1, 7, 102943, 27368368148803711, 533411691585101123706582594658103586126397951, ...}. p+1 divides a(p) for prime p. a(p)/(p+1) = A056852[n] = {7, 521, 102943, 23775972551, 21633936185161, ...}. p^2 divides a((p-1)/2) for prime p = {29, 37, 3373} = A121999(n). - Alexander Adamchuk, Nov 12 2006

References

  • Graham Everest, Alf van der Poorten, Igor Shparlinski and Thomas Ward, Recurrence Sequences, Amer. Math. Soc., 2003; see esp. p. 255.
  • Maohua Le, Primes in the sequences n^n+1 and n^n-1, Smarandache Notions Journal, Vol. 10, No. 1-2-3, 1999, pp. 156-157.
  • Paulo Ribenboim, The Book of Prime Number Records, 2nd ed. New York: Springer-Verlag, p. 74, 1989.

Crossrefs

Programs

Formula

For n>0, resultant of x^n+1 and nx-1. - Ralf Stephan, Nov 20 2004
E.g.f.: exp(x) + 1/(1+LambertW(-x)). - Vaclav Kotesovec, Dec 20 2014
Sum_{n>=1} 1/a(n) = A134883. - Amiram Eldar, Nov 15 2020

Extensions

More terms from Erich Friedman

A125854 Primes p with the property that p divides the Wolstenholme number A001008((p+1)/2).

Original entry on oeis.org

3, 29, 37, 3373, 2001907169
Offset: 1

Views

Author

Alexander Adamchuk, Dec 11 2006

Keywords

Comments

Note that if prime p>3 divides A001008((p+1)/2) then it also divides A001008((p-3)/2).
Note that for a prime p, H([p/2]) == 2*(2^(-p(p-1)) - 1)/p^2 (mod p). Therefore a prime p divides the Wolstenholme number A001008((p+1)/2) if and only if 2^(-p(p-1)) == 1 - p^2 (mod p^3) or, equivalently, 2^(p-1) == 1 + p (mod p^2).
Disjunctive union of the sequences A154998 and A121999 that contain primes congruent respectively to 1,3 and 5,7 modulo 8. (Alekseyev)
a(6) > 5.5*10^12. - Giovanni Resta, Apr 13 2017
Primes p that are base-((p-1)/2) Wieferich primes, that is, primes p such that ((p-1)/2)^(p-1) == 1 (mod p^2). - Jianing Song, Jan 27 2019

Examples

			a(1) = 3 because prime 3 divides A001008(2) = 3 and there is no p < 3 that divides A001008((p+1)/2).
a(2) = 29 because 29 divides A001008(15) = 1195757 and there is no prime p (3 < p < 29) that divides A001008((p+1)/2).
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[1, 5000]],
    Divisible[Numerator[HarmonicNumber[(# + 1)/2]], #] &] (* Robert Price, May 10 2019 *)

Extensions

Entry revised and a(5) = 2001907169 provided by Max Alekseyev, Jan 18 2009
Edited by Max Alekseyev, Oct 13 2009

A128465 Numbers k such that k divides the numerator of alternating Harmonic number H'((k+1)/2) = A058313((k+1)/2).

Original entry on oeis.org

1, 5, 7, 71, 379, 2659
Offset: 1

Views

Author

Alexander Adamchuk, Mar 10 2007

Keywords

Comments

For k > 1 all 5 listed terms are primes.
The only known numbers k such that k divides the numerator of alternating Harmonic number H'((k-1)/2) = A058313((k-1)/2) are the Wieferich primes (A001220): 1093 and 3511.
An odd prime p = prime(n) belongs to this sequence iff Fermat quotient A007663(n) == A130912(n) == 2*(-1)^((p+1)/2) (mod p). - Max Alekseyev, Nov 30 2022

Crossrefs

Programs

  • Mathematica
    f=0; Do[ f = f + (-1)^(n+1)*1/n; g = Numerator[f]; If[ IntegerQ[ g/(2n-1) ], Print[2n-1]], {n,1,3000} ]

Extensions

Edited by Max Alekseyev, Nov 30 2022

A154998 Primes p such that p^2 divides A048861((p-1)/2).

Original entry on oeis.org

3, 2001907169
Offset: 1

Views

Author

Max Alekseyev, Jan 18 2009

Keywords

Comments

No other terms below 10^11.

Crossrefs

Programs

  • PARI
    { forprime(p=3,10^11, if(Mod((p-1)/2,p^2)^((p-1)/2)==1, print(p);)) }

Formula

Elements of A125854 congruent to 1 or 3 modulo 8, i.e., primes p such that p == 1 or 3 (mod 8) and 2^(p-1) == 1+p (mod p^2).

Extensions

Edited by Max Alekseyev, Oct 13 2009

A284649 Primes p such that 2^(p-1) mod p^2 < p+2.

Original entry on oeis.org

2, 3, 29, 37, 1093, 3373, 3511, 2001907169
Offset: 1

Views

Author

Gionata Neri, Mar 31 2017

Keywords

Comments

a(9) > 10^12. - Giovanni Resta, Mar 31 2017

Crossrefs

Union of A001220 and A125854.

Programs

  • PARI
    forprime(p=2, 1e10, a=lift(Mod(2, p^2)^(p-1)); if(a
    				
Showing 1-6 of 6 results.