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.

Previous Showing 21-26 of 26 results.

A368373 a(n) = denominator of AM(n)-HM(n), where AM(n) and HM(n) are the arithmetic and harmonic means of the first n positive integers.

Original entry on oeis.org

1, 6, 11, 50, 137, 98, 363, 1522, 7129, 14762, 83711, 172042, 1145993, 2343466, 1195757, 4873118, 42142223, 28548602, 275295799, 22334054, 18858053, 38186394, 444316699, 2695645910, 34052522467, 68791484534, 312536252003, 630809177806, 9227046511387, 18609365660294, 290774257297357
Offset: 1

Views

Author

N. J. A. Sloane, Jan 24 2024

Keywords

Examples

			0, 1/6, 4/11, 29/50, 111/137, 103/98, 472/363, 2369/1522, 12965/7129, 30791/14762, 197346/83711, 452993/172042, 3337271/1145993, 7485915/2343466, 4160656/1195757, 18358463/4873118, ...
		

Crossrefs

Programs

  • Maple
    AM:=proc(n) local i; (add(i,i=1..n)/n); end;
    HM:=proc(n) local i; (add(1/i,i=1..n)/n)^(-1); end;
    s1:=[seq(AM(n)-HM(n),n=1..50)];
  • Mathematica
    A368373[n_] := Denominator[(n+1)/2 - n/HarmonicNumber[n]];
    Array[A368373, 35] (* Paolo Xausa, Jan 29 2024 *)
  • PARI
    a368373(n) = denominator((n+1)/2 - n/harmonic(n)) \\ Hugo Pfoertner, Jan 25 2024
  • Python
    from fractions import Fraction
    from itertools import count, islice
    def agen(): # generator of terms
        A = H = 0
        for n in count(1):
            A += n
            H += Fraction(1, n)
            yield ((A*Fraction(1, n) - n/H)).denominator
    print(list(islice(agen(), 31))) # Michael S. Branicky, Jan 24 2024
    
  • Python
    from fractions import Fraction
    from sympy import harmonic
    def A368373(n): return (Fraction(n+1,2)-Fraction(n,harmonic(n))).denominator # Chai Wah Wu, Jan 25 2024
    

A187487 Numerator of n minus n-th harmonic number.

Original entry on oeis.org

0, 1, 7, 23, 163, 71, 617, 1479, 15551, 17819, 221209, 246619, 3538687, 3873307, 4209643, 9094961, 166145857, 59239139, 1199057081, 254554945, 89778475, 94716499, 2292289173, 7218943253, 189040347533
Offset: 1

Views

Author

Alonso del Arte, Mar 10 2011

Keywords

Crossrefs

Denominators are in A002805.
Cf. A001008 (numerators of the harmonic numbers). Adding this sequence to that sequence gives A102928.

Programs

  • Maple
    f:=n -> numer(n - harmonic(n)):map(f, [$1..100]); # Robert Israel, Apr 26 2021
  • Mathematica
    Numerator[Table[n - HarmonicNumber[n], {n, 25}]]
  • PARI
    a(n) = numerator(n - sum(i=1, n, 1/i)); \\ Michel Marcus, Apr 26 2021

Formula

a(n) = n - Sum_{i = 1..n} 1/i.
a(n) = Sum_{i = 2..n} (i - 1)/i.

A132773 a(n) = n*(n + 31).

Original entry on oeis.org

0, 32, 66, 102, 140, 180, 222, 266, 312, 360, 410, 462, 516, 572, 630, 690, 752, 816, 882, 950, 1020, 1092, 1166, 1242, 1320, 1400, 1482, 1566, 1652, 1740, 1830, 1922, 2016, 2112, 2210, 2310, 2412, 2516, 2622, 2730, 2840, 2952, 3066, 3182, 3300, 3420, 3542, 3666
Offset: 0

Views

Author

Omar E. Pol, Aug 28 2007

Keywords

Crossrefs

Programs

Formula

G.f.: 2*x*(-16+15*x)/(-1+x)^3. - R. J. Mathar, Nov 14 2007
a(n) = 2*A132758(n). - R. J. Mathar, Jul 22 2009
a(n) = 2*n + a(n-1) + 30, with n > 0, a(0)=0. - Vincenzo Librandi, Aug 03 2010
From Amiram Eldar, Jan 16 2021: (Start)
Sum_{n>=1} 1/a(n) = H(31)/31 = A001008(31)/A102928(31) = 290774257297357/2238255069850800, where H(k) is the k-th harmonic number.
Sum_{n>=1} (-1)^(n+1)/a(n) = 2*log(2)/31 - 7313175618421/319750724264400. (End)
From Elmo R. Oliveira, Dec 13 2024: (Start)
E.g.f.: exp(x)*x*(32 + x).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. (End)

A216101 Primes which are the integer harmonic mean of the previous prime and the following prime.

Original entry on oeis.org

13, 19, 43, 47, 83, 89, 103, 109, 131, 167, 193, 229, 233, 313, 349, 353, 359, 383, 389, 409, 443, 449, 463, 503, 643, 647, 677, 683, 691, 709, 797, 823, 859, 883, 919, 941, 971, 983, 1013, 1093, 1097, 1109, 1171, 1193, 1217, 1279, 1283, 1303, 1373, 1429, 1433
Offset: 1

Views

Author

César Eliud Lozada, Sep 01 2012

Keywords

Comments

The harmonic mean of N numbers p1,p2,..,pN is the number H whose reciprocal is the arithmetic mean of the reciprocals of p1,p2,..,pN; that is to say, 1/H = ((1/p1)+(1/p2)+..+(1/pN))/N.
So, for two quantities p1 and p2, their harmonic mean may be written as H=(2*p1*p2)/(p1+p2).
The harmonic mean (sometimes called the subcontrary mean) is one of several kinds of average. Typically, it is appropriate for situations when the average of rates is desired.

Examples

			The primes before and after the prime p=13 are p1=11 and p2=17. So, the harmonic mean of p1 and p2 is 2*11*17/(11+17)=13.35714285... whose integer part is p=13. Then p=13 belongs to the sequence.
The primes before and after the prime p=17 are p1=13 and p2=19. The harmonic mean of p1 and p2 is 2*13*19/(13+19)=15.4375, having 15 as its integer part. Therefore, as 15<>p, p=17 is not in the sequence.
		

Crossrefs

Programs

  • Maple
    A := {}: for n from 2 to 1000 do p1 := ithprime(n-1): p := ithprime(n): p2 := ithprime(n+1): if p = floor(2*p1*p2/(p1+p2)) then A := `union`(A, {p}) end if end do; A := A;
  • Mathematica
    t = {}; Do[p = Prime[n]; If[Floor[HarmonicMean[{Prime[n - 1], Prime[n + 1]}]] == p, AppendTo[t, p]], {n, 2, 200}]; t (* T. D. Noe, Sep 04 2012 *)

A356137 Positive integers m such that the fractional part of the geometric mean of the sequence s(m) does not exceed the fractional part of the arithmetic mean of s(m), where s(m) is the sequence 1 + 1/1, 2 + 1/2, ..., m + 1/m.

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 10, 13, 14, 16, 18, 22, 24, 26, 30, 32, 34, 38, 40, 42, 46, 48, 54, 56, 61, 62, 64, 69, 70, 72, 78, 80, 86, 88, 92, 94, 96, 100, 102, 108, 110, 115, 116, 118, 124, 126, 132, 134, 138, 140, 146, 148, 154, 156, 161, 162, 164, 170, 172, 178, 180
Offset: 1

Views

Author

Mike Jones, Jul 27 2022

Keywords

Comments

The idea is to take note of when the fractional parts of the geometric mean and arithmetic mean "follow suit" with respect to the celebrated geometric mean <= arithmetic mean inequality.

Examples

			2 is a term because the geometric mean of 1 + 1/1 and 2 + 1/2 is the geometric mean of 2 and 2.5, which is a bit less than 2.24, whereas the arithmetic mean of 2 and 2.5 is 2.25, and 0.24 <= 0.25.
4 is not a term because the geometric mean is 2.90..., whereas the arithmetic mean is 3.02..., and 0.90 > 0.02.
		

Crossrefs

Cf. A356142/A102928 (the arithmetic mean of s(n)).

Programs

  • Mathematica
    max=180; a={}; s[m_]:=m+1/m; For[m=1,m<=max,m++,If[FractionalPart[Mean[Table[s[k],{k,m}]]] >= FractionalPart[GeometricMean[Table[s[k],{k,m}]]],AppendTo[a,m]]]; a (* Stefano Spezia, Jul 27 2022 *)
  • PARI
    isok(m) = my(v=vector(m, k, k+1/k)); frac(sqrtn(vecprod(v), m)) <= frac(vecsum(v)/m); \\ Michel Marcus, Jul 28 2022

Extensions

More terms from Stefano Spezia, Jul 27 2022

A356142 a(n) is the reduced numerator of the arithmetic mean of the first n terms of the sequence [n + 1/n, n > 0].

Original entry on oeis.org

2, 9, 47, 145, 1037, 469, 4283, 10841, 120529, 145981, 1913231, 2248181, 33938753, 39009533, 44438957, 100454479, 1916734943, 712651981, 15018824599, 662986195, 1213859861, 1327904701, 33283587163, 108432400555, 2934259832467, 3166619637067, 30671014001603, 32922658468103
Offset: 1

Views

Author

Stefano Spezia, Jul 27 2022

Keywords

Crossrefs

Cf. A102928 (denominator), A356137.

Programs

  • Mathematica
    Table[Numerator[Mean[Table[k+1/k,{k,n}]]],{n,28}]
  • PARI
    a(n) = numerator(sum(k=1, n, k+1/k)/n); \\ Michel Marcus, Jul 28 2022
Previous Showing 21-26 of 26 results.