OFFSET
1,3
COMMENTS
EXAMPLE
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.
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jun 02 2013
STATUS
approved