# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a069765 Showing 1-1 of 1 %I A069765 #16 Jun 30 2023 18:33:08 %S A069765 1,2,4,7,13,24,42,77,138,249,454,823,1493,2719,4969,9060,16588,30375, %T A069765 55672,102330,188334,346624,639280,1179742,2178907,4029060,7456271, %U A069765 13806301,25587417,47452133,88057540,163518793,303826088,564825654 %N A069765 Number of distinct values obtained using n ones and the operations of sum, product and quotient. %H A069765 Index entries for similar sequences %e A069765 a(5)=13 because five ones yield the following 13 distinct values and no others: 1+1+1+1+1=5, 1+1+1+(1/1)=4, 1/(1+1+1+1)=1/4, 1+(1/1)+(1/1)=3, 1/(1+1+(1/1))=1/3, 1+(1/(1+1+1))=4/3, 1+(1/1)*(1/1)=2, 1/((1/1)+(1/1))=1/2, (1+1+1)/(1+1)=3/2, 1+1+(1/(1+1))=5/2, (1+1)/(1+1+1)=2/3, 1*1*1*1*1=1 and (1+1)*(1+1+1)=6. %o A069765 (Python) %o A069765 from fractions import Fraction %o A069765 from functools import lru_cache %o A069765 @lru_cache() %o A069765 def f(m): %o A069765 if m == 1: return {Fraction(1, 1)} %o A069765 out = set() %o A069765 for j in range(1, m//2+1): %o A069765 for x in f(j): %o A069765 for y in f(m-j): %o A069765 out.update([x + y, x * y]) %o A069765 if y: out.add(Fraction(x, y)) %o A069765 if x: out.add(Fraction(y, x)) %o A069765 return out %o A069765 def a(n): return len(f(n)) %o A069765 print([a(n) for n in range(1, 16)]) # _Michael S. Branicky_, Jul 28 2022 %Y A069765 Cf. A048249. %K A069765 nonn,more %O A069765 1,2 %A A069765 _John W. Layman_, Apr 05 2002 %E A069765 a(20)-a(30) from _Michael S. Branicky_, Jul 29 2022 %E A069765 a(31)-a(34) from _Michael S. Branicky_, Jun 30 2023 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE