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

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

A064169 Numerator - denominator in n-th harmonic number, 1 + 1/2 + 1/3 + ... + 1/n.

Original entry on oeis.org

0, 1, 5, 13, 77, 29, 223, 481, 4609, 4861, 55991, 58301, 785633, 811373, 835397, 1715839, 29889983, 10190221, 197698279, 40315631, 13684885, 13920029, 325333835, 990874363, 25128807667, 25472027467, 232222818803, 235091155703, 6897956948587, 6975593267347
Offset: 1

Views

Author

Leroy Quet, Sep 19 2001

Keywords

Comments

The numerator and denominator in the definition have no common factors greater than 1. p divides a(p-2) for prime p > 2. - Alexander Adamchuk, Jun 09 2006
It appears that a(n) = numerator((3*(HarmonicNumber(n) - 1)) / (n*(n^2 + 6*n + 11))), except for n = 5, 82, 115, and 383 (tested to 20000). - Gary Detlefs, Jul 20 2011
From Amiram Eldar and Thomas Ordowski, Jul 27 2019: (Start)
Conjecture: for n > 2, n divides a(n-2) if and only if n is a prime. Checked up to 20000.
Max Alekseyev proved (in priv. commun.) that there are no primes p > 3 such that p^2 divides a(p-2). (End)

Examples

			The 3rd harmonic number is 11/6. So a(3) = 11 - 6 = 5.
		

Crossrefs

Programs

  • GAP
    List([1..35], n-> NumeratorRat(Sum([0..n-2], k-> 2/(k+2))) ); # G. C. Greubel, Jul 27 2019
    
  • Magma
    [Numerator(a)-Denominator(a) where a is HarmonicNumber(n): n in [1..35]]; // Marius A. Burtea, Aug 03 2019
    
  • Maple
    s := n -> add(1/i, i=2..n): a := n -> numer(s(n)):
    seq(a(n), n=1..30); # Zerinvary Lajos, Mar 28 2007
  • Mathematica
    A064169[n_]:= (s = Sum[1/k, {k, n}]; Numerator[s] - Denominator[s]); Table[A064169[n], {n, 35}]
    Numerator[Table[Sum[1/k, {k, 2, n}], {n, 35}]] (* Alexander Adamchuk, Jun 09 2006 *)
    Numerator[#] - Denominator[#] &/@ HarmonicNumber[Range[35]] (* Harvey P. Dale, Apr 25 2016 *)
    Numerator[Accumulate[1/Range[2, 35]]] (* Alonso del Arte, Nov 21 2018 *)
    a[n_] := Numerator[PolyGamma[1 + n] + EulerGamma - 1];
    Table[a[n], {n, 1, 29}] (* Peter Luschny, Feb 19 2022 *)
  • PARI
    a(n) = my(h=sum(i=1, n, 1/i)); numerator(h)-denominator(h) \\ Felix Fröhlich, Jan 14 2019
    
  • Python
    from sympy import harmonic
    def A064169(n): return (lambda x: x.p - x.q)(harmonic(n)) # Chai Wah Wu, Sep 27 2021
  • Sage
    [numerator(harmonic_number(n)) - denominator(harmonic_number(n)) for n in (1..35)] # G. C. Greubel, Jul 27 2019
    

Formula

Numerator of (gamma + Psi(n+1) - 1). - Vladeta Jovovic, Aug 12 2002
From Alexander Adamchuk, Jun 09 2006: (Start)
a(n) = numerator of Sum_{k = 2..n} 1/k.
a(n) = A001008(n) - A002805(n).
a(n) = numerator of (the n-th harmonic number minus 1).
a(n) = numerator of A001008(n)/A002805(n) - 1. (End)
a(n) = numerator of A027612(n-1)/(A027611(n)*n^2*(n-1)!), n > 1. - Gary Detlefs, Aug 05 2011
a(n) = numerator(Sum_{k = 1..n-1} 1/(3*k + 3)). - Gary Detlefs, Sep 14 2011
a(n) = numerator(Sum_{k = 0..n-1} 2/(k+2)). - Gary Detlefs, Oct 06 2011
a(n) = numerator(Sum_{k = 1..n} frac(1/k)). - Michel Marcus, Sep 27 2021

Extensions

One more term from Robert G. Wilson v, Sep 28 2001
More terms from Vladeta Jovovic, Aug 12 2002

A064167 Product of numerator and denominator of the n-th harmonic number, 1 + 1/2 + 1/3 +...+ 1/n.

Original entry on oeis.org

1, 6, 66, 300, 8220, 980, 50820, 213080, 17965080, 18600120, 2320468920, 2384502120, 412970037480, 422245703880, 430902992520, 1756076802480, 516336630329520, 58297387228080, 21362271268818480, 866533600973040, 97555876321904, 98772315738096, 52866073370045936, 481103506052529360
Offset: 1

Views

Author

Leroy Quet, Sep 19 2001

Keywords

Comments

Numerator and denominator in definition have no common divisors >1.

Examples

			The 3rd harmonic number is 11/6. So a(3) = 11 * 6 = 66.
		

Crossrefs

Programs

  • Mathematica
    Numerator[#]Denominator[#]&/@HarmonicNumber[Range[30]] (* Harvey P. Dale, May 01 2022 *)
  • PARI
    a(n) = my(h=sum(k=1, n, 1/k)); numerator(h) * denominator(h); \\ Michel Marcus, Sep 07 2019

Extensions

More terms from Michel Marcus, Sep 07 2019

A118727 Primes that are the sum of the numerator and denominator of a harmonic number.

Original entry on oeis.org

2, 5, 17, 37, 197, 503, 9649, 9901, 111431, 1532093, 1556117, 71354639, 392849685203, 67564865715709, 67929521152309, 2551756396706233, 345246028268898566519, 73744425850091533377950933665103, 4418089000986947559043789457061782529431
Offset: 1

Views

Author

Alexander Adamchuk, May 21 2006

Keywords

Comments

A001008(n) + A002805(n) = A064168(n) is the sum of numerator and denominator in n-th harmonic number H(n) = 1 + 1/2 + 1/3 +...+ 1/n. A064168(n) is prime for n = {1,2,3,4,5,7,9,10,11,14,15,20,27,35,36,39,48..} = A123538.

Examples

			H(n) = [ 1/1, 3/2, 11/6, 25/12, 137/60, 49/20, 363/140, 761/280, 7129/2520,... ].
a(1) = 1 + 1 = 2,
a(2) = 3 + 2 = 5,
a(3) = 11 + 6 = 17,
a(4) = 25 + 12 = 37,
a(5) = 137 + 60 = 197,
a(6) = 363 + 140 = 503,
a(7) = 7129 + 2520 = 9649...
		

Crossrefs

Programs

  • Maple
    select(isprime,map(numer+denom, ListTools:-PartialSums([(1/n) $ n=1..10^3]))); # Robert Israel, May 30 2019
  • Mathematica
    Select[Numerator[#]+Denominator[#]&/@HarmonicNumber[Range[100]],PrimeQ] (* Harvey P. Dale, Jan 29 2014 *)
Showing 1-4 of 4 results.