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.

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