login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A075226 Largest prime in the numerator of the 2^n sums generated from the set 1, 1/2, 1/3,..., 1/n. 6

%I #25 Feb 16 2022 01:55:20

%S 3,11,19,137,137,1019,2143,7129,7129,78167,81401,1085933,1111673,

%T 1165727,2364487,41325407,41325407,796326437,809074601,812400209,

%U 822981689,19174119571,19652175721,99554817251,100483070801

%N Largest prime in the numerator of the 2^n sums generated from the set 1, 1/2, 1/3,..., 1/n.

%C For the smallest odd prime not generated, see A075227. For information about how often the numerator of these sums is prime, see A075188 and A075189. The Mathematica program also prints the subset that yields the largest prime. For n <=20, the largest prime occurs in a sum of n-2, n-1, or n reciprocals.

%H Chai Wah Wu, <a href="/A075226/b075226.txt">Table of n, a(n) for n = 2..441</a> (terms 2..100 from Martin Fuller)

%H Martin Fuller, <a href="/A075226/a075226.gp.txt">PARI program</a>

%e a(3) =11 because 11 is largest prime numerator in the three sums that yield primes: 1+1/2 = 3/2, 1/2+1/3 = 5/6 and 1+1/2+1/3 = 11/6.

%t Needs["DiscreteMath`Combinatorica`"]; maxN=20; For[t={}; lst={}; mx=0; i=0; n=2, n<=maxN, n++, While[i<2^n-1, i++; s=NthSubset[i, Range[n]]; k=Numerator[Plus@@(1/s)]; If[PrimeQ[k], If[k>mx, t=s]; mx=Max[mx, k]]]; Print[n, " ", t]; AppendTo[lst, mx]]; lst

%t Table[Max[Select[Numerator[Total/@Subsets[1/Range[n],{2,2^n}]],PrimeQ]],{n,2,30}] (* The program will take a long time to run. *) (* _Harvey P. Dale_, Jan 08 2019 *)

%o (Haskell)

%o import Data.Ratio (numerator)

%o a075226 n = a075226_list !! (n-1)

%o a075226_list = f 2 [recip 1] where

%o f x hs = (maximum $ filter ((== 1) . a010051') (map numerator hs')) :

%o f (x + 1) hs' where hs' = hs ++ map (+ recip x) hs

%o -- _Reinhard Zumkeller_, May 28 2013

%o (PARI) See Fuller link.

%o (Python)

%o from math import gcd, lcm

%o from itertools import combinations

%o from sympy import isprime

%o def A075226(n):

%o m = lcm(*range(1,n+1))

%o c, mlist = 0, tuple(m//i for i in range(1,n+1))

%o for l in range(n,-1,-1):

%o if sum(mlist[:l]) < c:

%o break

%o for p in combinations(mlist,l):

%o s = sum(p)

%o s //= gcd(s,m)

%o if s > c and isprime(s):

%o c = s

%o return c # _Chai Wah Wu_, Feb 14 2022

%Y Cf. A001008, A075135, A075188, A075189, A075227, A010051, A217712.

%K nice,nonn

%O 2,1

%A _T. D. Noe_, Sep 08 2002

%E More terms from _Martin Fuller_, Jan 19 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 23 23:47 EDT 2024. Contains 374575 sequences. (Running on oeis4.)