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

A075188 Number of times that the numerator of a sum generated from the set 1, 1/2, 1/3,..., 1/n is prime.

Original entry on oeis.org

0, 1, 3, 9, 19, 43, 79, 162, 307, 607, 1075, 2186, 3872, 7573, 15101, 29139, 52295, 104953, 189915, 379275, 754081, 1462115, 2675851, 5351541, 10254019, 19987942, 38901233, 77620568, 144021667, 288428481, 537642772, 1056802340, 2113152353, 4138261885
Offset: 1

Views

Author

T. D. Noe, Sep 08 2002

Keywords

Comments

Note that for each n there are only 2^(n-1) new sums to consider. Surprisingly, nearly half of the sums have a prime numerator. For the number of distinct primes, see A075189. For the largest generated prime, see A075226. For the smallest odd prime not generated, see A075227.
A217712(n) = number of primes occurring exactly once as numerators. - Reinhard Zumkeller, Jun 02 2013

Examples

			a(3) = 3 because 3 sums yield prime numerators: 1+1/2 = 3/2, 1/2+1/3 = 5/6 and 1+1/2+1/3 = 11/6.
		

Crossrefs

Programs

  • Haskell
    import Data.Ratio (numerator)
    a075188 n = a075188_list !! (n-1)
    a075188_list = f 1 [] where
       f x hs = (length $ filter ((== 1) . a010051') (map numerator hs')) :
                f (x + 1) hs' where hs' = hs ++ map (+ recip x) (0 : hs)
    -- Reinhard Zumkeller, May 28 2013
  • Mathematica
    Needs["DiscreteMath`Combinatorica`"]; maxN=20; For[cnt=0; lst={}; i=0; n=1, n<=maxN, n++, While[i<2^n-1, i++; s=NthSubset[i, Range[n]]; k=Numerator[Plus@@(1/s)]; If[PrimeQ[k], cnt++ ]]; AppendTo[lst, cnt]]; lst

Extensions

a(21)-a(25) by Reinhard Zumkeller, May 28 2013
a(26)-a(31) from Chai Wah Wu, Feb 14 2022
a(32)-a(34) from Sean A. Irvine, Feb 10 2025

A075189 Number of distinct primes in the numerator of the 2^n sums generated from the set 1, 1/2, 1/3, ..., 1/n.

Original entry on oeis.org

0, 1, 3, 6, 14, 20, 38, 74, 134, 232, 486, 526, 1078, 2036, 2505, 4762, 9929, 14598, 29831, 31521, 52223, 101123, 207892, 215796, 426772, 836665, 1640357, 1689653, 3401483, 3471770, 6868800, 13470379, 23182192, 45792615, 47136366
Offset: 1

Views

Author

T. D. Noe, Sep 08 2002

Keywords

Comments

Every prime is generated eventually. For the largest generated prime, see A075226. For the smallest odd prime not generated, see A075227.
A217712(n) = number of primes occurring exactly once as numerators among the 2^n sums. - Reinhard Zumkeller, Jun 02 2013

Examples

			a(3) = 3 because 3 sums yield distinct prime numerators: 1+1/2 = 3/2, 1/2+1/3 = 5/6 and 1+1/2+1/3 = 11/6.
		

Crossrefs

Programs

  • Haskell
    import Data.Ratio ((%), numerator)
    import Data.Set (Set, empty, fromList, toList, union, size)
    a075189 n = a075189_list !! (n-1)
    a075189_list = f 1 empty empty where
       f x s s1 = size s1' : f (x + 1) (s `union` fromList hs) s1' where
         s1' = s1 `union` fromList
               (filter ((== 1) . a010051') $ map numerator hs)
         hs = map (+ 1 % x) $ 0 : toList s
    -- Reinhard Zumkeller, May 28 2013
  • Mathematica
    Needs["DiscreteMath`Combinatorica`"]; maxN=20; For[lst={}; prms={}; i=0; n=1, n<=maxN, n++, While[i<2^n-1, i++; s=NthSubset[i, Range[n]]; k=Numerator[Plus@@(1/s)]; If[PrimeQ[k], prms=Union[prms, {k}]]]; AppendTo[lst, Length[prms]]]; lst

Extensions

a(21)-a(29) from Reinhard Zumkeller, May 28 2013
a(30)-a(35) from Sean A. Irvine, Feb 10 2025

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

Original entry on oeis.org

3, 11, 19, 137, 137, 1019, 2143, 7129, 7129, 78167, 81401, 1085933, 1111673, 1165727, 2364487, 41325407, 41325407, 796326437, 809074601, 812400209, 822981689, 19174119571, 19652175721, 99554817251, 100483070801
Offset: 2

Views

Author

T. D. Noe, Sep 08 2002

Keywords

Comments

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.

Examples

			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.
		

Crossrefs

Programs

  • Haskell
    import Data.Ratio (numerator)
    a075226 n = a075226_list !! (n-1)
    a075226_list = f 2 [recip 1] where
       f x hs = (maximum $ filter ((== 1) . a010051') (map numerator hs')) :
                f (x + 1) hs' where hs' = hs ++ map (+ recip x) hs
    -- Reinhard Zumkeller, May 28 2013
    
  • Mathematica
    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
    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 *)
  • PARI
    See Fuller link.
    
  • Python
    from math import gcd, lcm
    from itertools import combinations
    from sympy import isprime
    def A075226(n):
        m = lcm(*range(1,n+1))
        c, mlist = 0, tuple(m//i for i in range(1,n+1))
        for l in range(n,-1,-1):
            if sum(mlist[:l]) < c:
                break
            for p in combinations(mlist,l):
                s = sum(p)
                s //= gcd(s,m)
                if s > c and isprime(s):
                    c = s
        return c # Chai Wah Wu, Feb 14 2022

Extensions

More terms from Martin Fuller, Jan 19 2008

A217712 Number of primes occurring exactly once as numerators in sums generated from the set 1, 1/2, 1/3,..., 1/n.

Original entry on oeis.org

0, 1, 3, 3, 11, 13, 27, 54, 106, 168, 378, 142, 733, 1597, 1283, 3418, 8204, 10112, 24644, 7829, 32866, 78136, 178741, 37002, 256392, 650596, 1402914, 286854, 2053463
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 02 2013

Keywords

Comments

For information about how often the numerator of the generated sums is prime, see A075188 and A075189; for the largest generated prime, see A075226; for the smallest odd prime not generated, see A075227.

Examples

			For n=3 there are the following fractions as sums of 1, 1/2 and 1/3:
{1/3, 1/2, 5/6, 1, 4/3, 3/2, 11/6}, three numerators are prime and they occur exactly once, therefore a(3) = A075188(3) = A075189(3) = #{3, 5, 11} = 3;
n=4: adding 1/4 to the previous fractions gives together: 1/4, 1/3, 1/2, 1/3+1/4=7/12, 1/2+1/4=3/4, 5/6, 1, 5/6+1/4=13/12, 1+1/4=5/4, 4/3, 3/2, 4/3+1/4=19/12, 3/2+1/4=7/4, 11/6 and 11/6+1/4=25/12:
A075188(4) = #{7/12, 3/4, 5/6, 13/12, 5/4, 3/2, 19/12, 7/4, 11/6} = 9,
A075189(4) = #{3, 5, 7, 11, 13, 19} = 6,
a(4) = #{11, 13, 19} = 3.
		

Crossrefs

Cf. A010051.

Programs

  • Haskell
    import Data.Ratio ((%), numerator)
    import Data.Set (Set, empty, fromList, toList, union, size)
    import Data.Set (member, delete, insert)
    a217712 n = a217712_list !! (n-1)
    a217712_list = f 1 empty empty where
       f x s s1 = size s1' : f (x + 1) (s `union` fromList hs) s1' where
         s1' = g s1 $ filter ((== 1) . a010051') $ map numerator hs
         g v []                    = v
         g v (w:ws) | w `member` v = g (delete w v) ws
                    | otherwise    = g (insert w v) ws
         hs = map (+ 1 % x) $ 0 : toList s

A256223 Smallest Fibonacci number not occurring in the numerator of the 2^n sums generated from the set 1, 1/2, 1/3,..., 1/n.

Original entry on oeis.org

1, 2, 2, 2, 2, 2, 21, 21, 21, 21, 34, 34, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 987, 987, 987, 987, 987, 987, 987, 987, 987, 987, 46368, 46368, 46368, 46368, 46368, 46368, 46368, 46368, 46368, 832040, 832040, 832040, 832040, 832040, 832040, 832040
Offset: 0

Views

Author

Michel Lagneau, Mar 19 2015

Keywords

Comments

The largest prime generated is given in A256222.

Examples

			a(3) = 2 because we obtain 5 following subsets {1}, {1/2}, {1/3}, {1, 1/2} and {1/2, 1/3} having 5 sums with Fibonacci numerators: 1, 1, 1, 1+1/2 = 3/2 and 1/2+1/3 = 5/6. Then, 2 is the smallest Fibonacci number not occurring in the numerator of the previous sums.
		

Crossrefs

Programs

  • Mathematica
    <<"DiscreteMath`Combinatorica`"; maxN=23; For[prms={}; i=0; n=1, n<=maxN, n++, While[i<2^n-1, i++; s=NthSubset[i, Range[n]]; k=Numerator[Plus@@(1/s)]; If[IntegerQ[Sqrt[5*k^2+4]]||IntegerQ[Sqrt[5*k^2-4]], AppendTo[prms, k]]]; prms=Union[prms]; j=2; While[MemberQ[prms, Fibonacci[j]], j++ ]; Print[Fibonacci[j]]]

Extensions

a(0) prepended and a(24)-a(47) added by Hiroaki Yamanouchi, Mar 30 2015
Showing 1-5 of 5 results.