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 390 results. Next

A309639 Index of the least harmonic number H_i whose denominator (A002805) is divisible by n.

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 4, 13, 7, 5, 16, 17, 9, 19, 5, 9, 11, 23, 9, 25, 13, 27, 7, 29, 5, 31, 32, 11, 17, 7, 9, 37, 19, 13, 8, 41, 9, 43, 11, 9, 23, 47, 16, 49, 25, 17, 13, 53, 27, 11, 8, 19, 29, 59, 5, 61, 31, 9, 64, 13, 11, 67, 17, 24, 7, 71, 9, 73, 37, 25
Offset: 1

Views

Author

Robert G. Wilson v, Aug 11 2019

Keywords

Comments

a(n) is not a divisor of n for n = 21, 24, 42, 69, 84, 105, 115, 120, 138, 168, 171, ..., (A330736).
The sequence for the numerators only has terms for 1, 3, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 33, ..., .

Crossrefs

Programs

  • Maple
    H:= 1: B[1]:= 1:
    for n from 2 to 200 do H:= H + 1/n; B[n]:= denom(H) od:
    f:= proc(n) local F, t0, t;
      t0:= max(seq(t[1]^t[2],t=ifactors(n)[2]));
      for t from t0 do if B[t] mod n = 0 then return t fi od
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Aug 11 2019
  • Mathematica
    s = 0; k = 1; t[_] := 0; While[k < 101, s = s + 1/k; lst = Select[ Range@ 100, Mod[Denominator@ s, #] == 0 &]; If[t[#] == 0, t[#] = k] & /@ lst; k++]; t@# & /@ Range@75
  • PARI
    f(n) = denominator(sum(k=2, n, 1/k)); \\ A002805
    a(n) = my(k=1); while(f(k) % n, k++); k; \\ Michel Marcus, Aug 11 2019
    
  • PARI
    A309639list(up_to) = { my(s=0,v002805=vector(up_to),v309639=vector(up_to)); v002805[1] = 1; for(k=2,up_to,s += 1/k; v002805[k] = denominator(s)); for(n=1,up_to,for(j=1,up_to,if(!(v002805[j]%n),v309639[n] = j; break))); (v309639); }; \\ Antti Karttunen, Dec 29 2019

Formula

a(n) = n iff n is a power of a prime (A000961).
a(n) < n iff n is a member of A024619.
a(n) >= A034699(n). - Robert Israel, Aug 11 2019
gcd(a(n), n) = A330691(n). - Antti Karttunen, Dec 29 2019

A052488 a(n) = floor(n*H(n)) where H(n) is the n-th harmonic number, Sum_{k=1..n} 1/k (A001008/A002805).

Original entry on oeis.org

1, 3, 5, 8, 11, 14, 18, 21, 25, 29, 33, 37, 41, 45, 49, 54, 58, 62, 67, 71, 76, 81, 85, 90, 95, 100, 105, 109, 114, 119, 124, 129, 134, 140, 145, 150, 155, 160, 165, 171, 176, 181, 187, 192, 197, 203, 208, 214, 219, 224, 230, 235, 241, 247, 252, 258, 263, 269
Offset: 1

Views

Author

Tomas Mario Kalmar (TomKalmar(AT)aol.com), Mar 15 2000

Keywords

Comments

Floor(n*H(n)) gives a (very) rough approximation to the n-th prime.
a(n) is the integer part of the solution to the Coupon Collector's Problem. For example, if there are n=4 different prizes to collect from cereal boxes and they are equally likely to be found, then the integer part of the average number of boxes to buy before the collection is complete is a(4)=8. - Ron Lalonde (ronronronlalonde(AT)hotmail.com), Feb 04 2004

References

  • John D. Barrow, One Hundred Essential Things You Didn't Know You Didn't Know, Ch. 3, 'On the Cards', W. W. Norton & Co., NY & London, 2008, pp. 30-32.

Crossrefs

Programs

  • Magma
    [Floor(n*HarmonicNumber(n)): n in [1..60]]; // G. C. Greubel, May 14 2019
    
  • Maple
    for n from 1 to 100 do printf(`%d,`,floor(n*sum(1/k, k=1..n))) od:
    # Alternatively:
    A052488:= n -> floor(n*(Psi(n+1)+gamma));
    seq(A052488(n),n=1..100); # Robert Israel, May 19 2014
  • Mathematica
    f[n_] := Floor[n*HarmonicNumber[n]]; Array[f, 60] (* Robert G. Wilson v, Nov 23 2015 *)
  • PARI
    a(n) = floor(n*sum(k=1, n, 1/k)) \\ Altug Alkan, Nov 23 2015
    
  • Python
    from math import floor
    n=100 #number of terms
    ans=0
    finalans = []
    for i in range(1, n+1):
        ans+=(1/i)
        finalans.append(floor(ans*i))
    print(finalans)
    # Adam Hugill, Feb 14 2022
    
  • Python
    from fractions import Fraction
    from itertools import count, islice
    def agen():
        Hn = 0
        for n in count(1):
            Hn += Fraction(1, n)
            yield (n*Hn.numerator)//Hn.denominator
    print(list(islice(agen(), 60))) # Michael S. Branicky, Aug 10 2022
    
  • Python
    from sympy import harmonic
    def A052488(n): return int(n*harmonic(n)) # Chai Wah Wu, Oct 24 2023
  • Sage
    [floor(n*harmonic_number(n)) for n in (1..60)] # G. C. Greubel, May 14 2019
    

Extensions

More terms from James Sellers, Mar 17 2000

A002547 Numerator of the n-th harmonic number H(n) divided by (n+1); a(n) = A001008(n) / ((n+1)*A002805(n)).

Original entry on oeis.org

1, 1, 11, 5, 137, 7, 363, 761, 7129, 671, 83711, 6617, 1145993, 1171733, 1195757, 143327, 42142223, 751279, 275295799, 55835135, 18858053, 830139, 444316699, 269564591, 34052522467, 34395742267, 312536252003, 10876020307, 9227046511387, 300151059037
Offset: 1

Views

Author

Keywords

Comments

Numerators of coefficients for numerical differentiation.

Examples

			H(n) = Sum_{k=1..n} 1/k, begins 1, 3/2, 11/6, 25/12, ... so H(n)/(n+1) begins 1/2, 1/2, 11/24, 5/12, ....
a(4) = numerator(H(4)/(4+1)) = 5.
		

References

  • W. G. Bickley and J. C. P. Miller, Numerical differentiation near the limits of a difference table, Phil. Mag., 33 (1942), 1-12 (plus tables).
  • A. N. Lowan, H. E. Salzer and A. Hillman, A table of coefficients for numerical differentiation, Bull. Amer. Math. Soc., 48 (1942), 920-924.
  • 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

Programs

  • GAP
    List([1..35], n-> NumeratorRat(Sum([1..n], k-> 1/k)/(n+1))); # G. C. Greubel, Jul 03 2019
  • Magma
    [Numerator(HarmonicNumber(n)/(n+1)): n in [1..35]]; // G. C. Greubel, Jul 03 2019
    
  • Maple
    H := proc(a, b) option remember; local m, p, q, r, s;
    if b - a <= 1 then return 1, a fi; m := iquo(a + b, 2);
    p, q := H(a, m); r, s := H(m, b); p*s + q*r, q*s; end:
    A002547 := proc(n) H(1, n+1); numer(%[1]/(%[2]*(n+1))) end:
    seq(A002547(n), n=1..30); # Peter Luschny, Jul 11 2019
  • Mathematica
    a[n_]:= Numerator[HarmonicNumber[n]/(n+1)]; Table[a[n], {n, 35}] (* modified by G. C. Greubel, Jul 03 2019 *)
  • PARI
    h(n) = sum(k=1, n, 1/k);
    vector(35, n, numerator(h(n)/(n+1))) \\ G. C. Greubel, Jul 03 2019
    
  • PARI
    A002547(n)=numerator(A001008(n)/(n+1)) \\ M. F. Hasler, Jul 03 2019
    
  • Sage
    [numerator(harmonic_number(n)/(n+1)) for n in (1..35)] # G. C. Greubel, Jul 03 2019
    

Formula

G.f.: (-log(1-x))^2 (for fractions A002547(n)/A002548(n)). - Barbara Margolius (b.margolius(AT)math.csuohio.edu), Jan 19 2002
A002547(n)/A002548(n) = 2*Stirling_1(n+2, 2)(-1)^n/(n+2)! - Barbara Margolius (b.margolius(AT)math.csuohio.edu), Jan 19 2002
Numerator of u(n) = Sum_{k=1..n-1} 1/(k*(n-k)) (u(n) is asymptotic to 2*log(n)/n). - Benoit Cloitre, Apr 12 2003; corrected by Istvan Mezo, Oct 29 2012
a(n) = numerator of 2*Integral_{0..1} x^(n+1)*log(x/(1-x)) dx. - Groux Roland, May 18 2011
a(n) = numerator of A001008(n)/(n+1), since A001008(n)/A002805(n) are already in lowest terms. - M. F. Hasler, Jul 03 2019

Extensions

More terms from Barbara Margolius (b.margolius(AT)math.csuohio.edu), Jan 19 2002
Simpler definition from Alexander Adamchuk, Oct 31 2004
Offset corrected by Gary Detlefs, Sep 08 2011
Definition corrected by M. F. Hasler, Jul 03 2019

A330691 a(n) = gcd(n, A309639(n)), where A309639(n) is the index of the least harmonic number H_i whose denominator (A002805) is divisible by n.

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 4, 13, 7, 5, 16, 17, 9, 19, 5, 3, 11, 23, 3, 25, 13, 27, 7, 29, 5, 31, 32, 11, 17, 7, 9, 37, 19, 13, 8, 41, 3, 43, 11, 9, 23, 47, 16, 49, 25, 17, 13, 53, 27, 11, 8, 19, 29, 59, 5, 61, 31, 9, 64, 13, 11, 67, 17, 3, 7, 71, 9, 73, 37, 25, 19, 11, 13, 79, 16, 81, 41, 83, 3, 17, 43, 29, 11, 89, 9
Offset: 1

Views

Author

Antti Karttunen, Dec 29 2019

Keywords

Crossrefs

Cf. A000961 (fixed points).

Programs

  • Mathematica
    A309639[n_] := For[k = 1, True, k++, If[Divisible[Denominator[ HarmonicNumber[k]], n], Return[k]]];
    a[n_] := GCD[n, A309639[n]];
    Array[a, 105]
  • PARI
    A330691(n) = gcd(n, A309639(n));

Formula

a(n) = gcd(n, A309639(n)).
a(n) = n/A330692(n).

A330692 a(n) = n / gcd(n, A309639(n)), where A309639(n) is the index of the least harmonic number H_i whose denominator (A002805) is divisible by n.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 3, 1, 1, 2, 1, 4, 7, 2, 1, 8, 1, 2, 1, 4, 1, 6, 1, 1, 3, 2, 5, 4, 1, 2, 3, 5, 1, 14, 1, 4, 5, 2, 1, 3, 1, 2, 3, 4, 1, 2, 5, 7, 3, 2, 1, 12, 1, 2, 7, 1, 5, 6, 1, 4, 23, 10, 1, 8, 1, 2, 3, 4, 7, 6, 1, 5, 1, 2, 1, 28, 5, 2, 3, 8, 1, 10, 7, 4, 3, 2, 5, 3, 1, 2, 9, 4, 1, 6, 1, 8, 35
Offset: 1

Views

Author

Antti Karttunen, Dec 29 2019

Keywords

Crossrefs

Cf. A000961 (indices of 1's).

Programs

Formula

a(n) = n/A330691(n) = n / gcd(n, A309639(n)).

A079353 Numbers n such that the best rational approximation to H(n) with denominator <=n is an integer, where H(n) denotes the n-th harmonic number (A001008/A002805).

Original entry on oeis.org

1, 3, 4, 10, 11, 30, 31, 82, 83, 226, 227, 615, 616, 1673, 1674, 4549, 4550, 12366, 12367, 33616, 33617
Offset: 1

Views

Author

Benoit Cloitre, Feb 14 2003

Keywords

Comments

From Robert Israel, May 19 2014: The definition is unclear. For example, how does 10 fit in? H(10) = 7381/2520, and the best approximation with denominator <= 10 is 29/10, which is not an integer. Similarly, I don't see how 31, 82, 227, 616, or 1674 fit the definition, as according to my computations the best approximations in these cases are 125/31, 409/82, 1363/227, 4313/616, 13393/1674.
Response from David Applegate, May 20 2014: I suspect, without deep investigation, that what was meant by "best rational approximation to" is "continued fraction convergent". The continued fraction convergents to H(10)=7381/2520 are 2, 3, 41/14, 495/169, ... The continued fraction convergents to H(31) are 4, 145/36, 149/37, 443/110, ... The continued fraction convergents to H(82) are 4, 5, 499/100, 2001/401, ... I haven't verified that the rest of the terms match this definition.
Response from Ray Chandler, May 20 2014: I confirm that definition matches the listed terms and continues with 4549, 4550 and no others less than 10000.
Added by Ray Chandler, May 29 2014: Except for the beginning terms A079353 appears to be the union of A115515 and A002387 (compare A242654).

Examples

			H(11)=83711/27720 and the best approximation to H(11) among the fractions of form k/11, k>=0, is 33/11=3, an integer. Hence 11 is in the sequence.
		

Crossrefs

See A242654 for the most likely continuation.

Programs

  • Mathematica
    okQ[n_] := Select[Convergents[N[HarmonicNumber[n], 30], 10], Denominator[#] <= n &][[-1]] // IntegerQ;
    Reap[For[n = 1, n <= 40000, n++, If[okQ[n], Print[n]; Sow[n]]]][[2, 1]] // Quiet (* Jean-François Alcover, Apr 10 2019 *)

Extensions

a(16)-a(17) from Ray Chandler, May 20 2014
Edited by N. J. A. Sloane, May 29 2014
a(18)-a(21) from Jean-François Alcover, Apr 10 2019

A330735 a(n) = n mod A309639(n), where A309639(n) is the index of the least harmonic number H_i whose denominator (A002805) is divisible by n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 3
Offset: 1

Views

Author

Antti Karttunen, Jan 10 2020

Keywords

Crossrefs

Cf. A309639, A330691, A330692, A330734, A330736 (indices of nonzero terms).

Programs

Formula

a(n) = n mod A309639(n).

A349850 Decimal expansion of Sum_{k>=1} H(k)*F(k)/2^k, where H(k) = A001008(k)/A002805(k) is the k-th harmonic number and F(k) = A000045(k) is the k-th Fibonacci number.

Original entry on oeis.org

3, 9, 6, 8, 7, 4, 8, 0, 0, 6, 9, 0, 3, 9, 1, 4, 8, 5, 2, 1, 7, 1, 0, 6, 3, 6, 4, 0, 6, 1, 9, 9, 8, 5, 6, 8, 8, 6, 9, 8, 4, 2, 4, 3, 6, 3, 9, 6, 2, 2, 4, 8, 4, 3, 6, 7, 8, 3, 3, 9, 6, 6, 4, 2, 9, 4, 2, 1, 5, 4, 5, 3, 6, 7, 0, 6, 1, 8, 1, 1, 9, 9, 3, 8, 0, 6, 6, 8, 2, 4, 2, 1, 7, 6, 1, 5, 7, 1, 0, 7, 5, 2, 1, 9, 8
Offset: 1

Views

Author

Amiram Eldar, Dec 02 2021

Keywords

Examples

			3.96874800690391485217106364061998568869842436396224...
		

Crossrefs

Programs

  • Mathematica
    RealDigits[2*Log[2] + 12*Log[GoldenRatio]/Sqrt[5], 10, 100][[1]]

Formula

Equals log(4*phi^(12/sqrt(5))) = 2*log(2) + 12*log(phi)/sqrt(5), where phi is the golden ratio (A001622).

A035048 Numerators of alternating sum transform (PSumSIGN) of Harmonic numbers H(n) = A001008/A002805.

Original entry on oeis.org

1, 1, 4, 3, 23, 11, 176, 25, 563, 137, 6508, 49, 88069, 363, 91072, 761, 1593269, 7129, 31037876, 7381, 31730711, 83711, 744355888, 86021, 3788707301, 1145993, 11552032628, 1171733, 340028535787, 1195757
Offset: 1

Views

Author

Keywords

Comments

p^2 divides a(2p-2) for prime p>3. a(2p-2)/p^2 = A061002(n) = A001008(p-1)/p^2 for prime p>2. - Alexander Adamchuk, Jul 07 2006

Crossrefs

Programs

  • Maple
    S:= series(log(1-x)/(x^2-1), x, 101):
    seq(numer(coeff(S,x,j)), j=1..100); # Robert Israel, Jun 02 2015
  • Mathematica
    Numerator[Table[Sum[(-1)^(k+1)*Sum[(-1)^(i+1)*1/i,{i,1,k}],{k,1,n}],{n,1,50}]] (* Alexander Adamchuk, Jul 07 2006 *)
  • PARI
    a(n)=numerator(polcoeff(log(1-x)/(x^2-1)+O(x^(n+1)),n))

Formula

G.f. for A035048(n)/A035047(n) : log(1-x)/(x^2-1). - Benoit Cloitre, Jun 15 2003
a(n) = Numerator[Sum[(-1)^(k+1)*Sum[(-1)^(i+1)*1/i,{i,1,k}],{k,1,n}]]. - Alexander Adamchuk, Jul 07 2006
a(n) = numerator((-1)^(n+1)*1/2*(log(2)+(-1)^(n+1)*(gamma+1/2*(psi(1+n/2)-psi(3/2+n/2))+psi(2+n)))), with gamma the Euler-Mascheroni constant. - - Gerry Martens, Apr 28 2011

A103930 Numerators of squares of harmonic numbers A001008/A002805.

Original entry on oeis.org

1, 9, 121, 625, 18769, 2401, 131769, 579121, 50822641, 54479161, 7007531521, 7399612441, 1313299956049, 1372958223289, 1429834803049, 5936819760481, 1775966959381729, 203755669038601, 75787776947048401, 3117562300468225
Offset: 1

Views

Author

Wolfdieter Lang, Mar 24 2005

Keywords

Comments

The corresponding denominators are given in A103931.

Programs

Formula

G.f.: -((d^3/dx^3)((log(1-x))^3))/3 + dilog(1-x)/(1-x) = ((log(1-x)^2) + dilog(1-x))/(1-x) with dilog(1-x)=polylog(2, x).
First differences give A103932(n)/A103933(n).
a(n) = numerator(H(n)^2), with the harmonic numbers H(n) = A001008(n)/A002805(n), n >= 1.
Showing 1-10 of 390 results. Next