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.

A125503 Smallest number k such that the numerator of the generalized harmonic number H(k,n) = Sum_{i=1..k} 1/i^n is a prime.

This page as a plain text file.
%I A125503 #28 Feb 16 2025 08:33:04
%S A125503 2,2,3,2,23,73,15,2,3,5,13,57,3,171,5,2,21,7,55,8902,26,1298,115,139,
%T A125503 3,2019,3,4,3,15,56,177
%N A125503 Smallest number k such that the numerator of the generalized harmonic number H(k,n) = Sum_{i=1..k} 1/i^n is a prime.
%C A125503 a(n) = 2 for n = {1,2,4,8,16,...}. Corresponding Fermat primes A019434.
%C A125503 a(n) = 3 for n = {3,9,13,25,27,29,95,107,153,159,...}.
%C A125503 a(n) = 5 for n = {10,15,60,90,197,209,...}.
%C A125503 a(n) = 7 for n = {18,47,112,155,273,...}.
%C A125503 a(n) = 15 for n = {7,30,43,...}.
%C A125503 a(21) = 26. a(28) = 4. a(31) = 56. a(144) = 9.
%C A125503 From _Alexander Adamchuk_, Apr 18 2010: (Start)
%C A125503 a(22)-a(25) = {1298,115,139,3}.
%C A125503 a(27)-a(32) = {3,4,3,15,56,177}.
%C A125503 a(n) = 3 for all n>2 listed in A125706. (End)
%C A125503 a(26) = 2019. - _Alexander Adamchuk_, Apr 26 2010
%C A125503 a(20) > 3000. - _Michael S. Branicky_, Jun 25 2022
%H A125503 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/HarmonicNumber.html">Harmonic Number</a>
%t A125503 Do[n = 1; f = 0; While[Not[PrimeQ[Numerator[f]]], f = f + 1/n^x; n++ ]; Print[{x, n - 1}], {x, 1, 25}] (* _Alexander Adamchuk_, Apr 18 2010 *)
%o A125503 (PARI) a(n) = my(k=1); while (!ispseudoprime(numerator(sum(i=1, k, 1/i^n))), k++); k; \\ _Michel Marcus_, Jun 04 2022
%o A125503 (Python)
%o A125503 from sympy import isprime
%o A125503 from fractions import Fraction
%o A125503 def a(n):
%o A125503     Hkn, k = Fraction(1, 1), 1
%o A125503     while not isprime(Hkn.numerator):
%o A125503         k += 1
%o A125503         Hkn += Fraction(1, k**n)
%o A125503     return k
%o A125503 print([a(n) for n in range(1, 20)]) # _Michael S. Branicky_, Jun 11 2022
%Y A125503 Cf. A001008, A007406, A007408, A007410, A099828, A019434, A125706.
%K A125503 nonn,hard,more
%O A125503 1,1
%A A125503 _Alexander Adamchuk_, Dec 28 2006, Jan 31 2007
%E A125503 a(22)-a(25) from _Alexander Adamchuk_, Apr 18 2010
%E A125503 a(26)-a(32) from _Alexander Adamchuk_, Apr 26 2010
%E A125503 Incorrect a(20) removed by _Michael S. Branicky_, Jun 25 2022
%E A125503 a(20) = 8902 from _Michael S. Branicky_, Jun 12 2023