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

A256502 Largest integer not exceeding the harmonic mean of the first n squares.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 10, 10, 11, 11, 12, 13, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 30, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 36, 37, 38, 38, 39, 39, 40, 41, 41
Offset: 1

Views

Author

Stanislav Sykora, Apr 08 2015

Keywords

Comments

Least k such that 1/k <= mean of {1, 1/2^2, 1/3^2,..., 1/n^2}.

Crossrefs

Cf. A226762.

Programs

  • Mathematica
    Table[Floor[HarmonicMean[Range[n]^2]],{n,70}] (* Harvey P. Dale, Mar 08 2020 *)
  • PARI
    \\ Using only precision-independent integer operations:
    a(n)=(n*n!^2)\sum(k=1,n,(n!\k)^2)

Formula

a(n) = floor(n/(Sum_{k=1..n} 1/k^2)).
Approaches asymptotically n/zeta(2), zeta being the Riemann function.
For any e > 0 and large enough n, n/zeta(2) + 36/Pi^4 - 1 < a(n) < n/zeta(2) + 36/Pi^4 + e. (Possibly this holds even with e = 0 for n > 29.) - Charles R Greathouse IV, Apr 08 2015

A226763 Least k such that 1/k <= mean of {1, 1/2, 1/3, ..., 1/n}.

Original entry on oeis.org

1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16
Offset: 1

Views

Author

Clark Kimberling, Jun 19 2013

Keywords

Examples

			1/4 < mean{1,1/2,1/3,...,1/9} < 1/3, so that a(9) = 4.
		

Crossrefs

Cf. A226762.

Programs

  • Mathematica
    f[n_] := Mean[Table[1/k, {k, 1, n}]]
    Table[Floor[1/f[n]], {n, 1, 120}]   (* A226762 *)
    Table[Ceiling[1/f[n]], {n, 1, 120}] (* this sequence *)

Formula

a(n) = ceiling(n/(Sum_{k=1..n} 1/k)).

Extensions

Name corrected by Jason Yuen, Nov 02 2024

A226764 Least k such that 1 + 1/2 + ... + 1/k < 1/(k+1) + ... + 1/n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6
Offset: 4

Views

Author

Clark Kimberling, Jun 19 2013

Keywords

Comments

For k = 1..20, the runlength of k's is given by 7, 11, 14, 18, 21, 25, 29, 32, 36, 39, 42, 47, 50, 53, 57, 61, 64, 67, 72, 74.

Examples

			1/3 + 1/4 + ... + 1/10 < 1 + 1/2 < 1/3 + 1/4 + ... + 1/11, so that a(11) = 2.
		

Crossrefs

Cf. A226762.

Programs

  • Mathematica
    (* first program *)
    h[n_] := HarmonicNumber[n]; f[n_, k_] := f[n, k] = If[2 h[k] <= h[n] && 2 h[k + 1] > h[n], 1, 0]; t[n_] := t[n] = Table[f[n, k], {k, 1, n}]; a[n_] := First[Position[t[n], 1]]; u = Flatten[Table[a[n], {n, 4, 500}]]
    (* second program, with plot *)
    a[1] = 0; a[n_] := a[n] = NestWhile[# + 1 &, a[n - 1] + 1, Sum[1/k, {k, 1, #}] < Sum[1/k, {k, # + 1, n}] &] - 1; A226764 = Map[a, Range[4, 500]]; ListLogLogPlot[A226764]  (* Peter J. C. Moses, Jun 20 2013 *)

Formula

a(n) = Sum_{k>=1} sign(1 - sign(2*H_k - H_n)). - Mats Granvik, Apr 06 2021
Showing 1-3 of 3 results.