# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a352969 Showing 1-1 of 1 %I A352969 #30 Apr 26 2022 16:08:09 %S A352969 1,2,4,11,52,678,67144,357306081 %N A352969 Start with {1}, then at each step replace it with the set of all pairwise products and sums of its elements (an element can be paired with itself). a(n) gives the number of elements after n-th step. %e A352969 After the 1st step the set becomes {1*1, 1+1} = {1, 2}. It has 2 distinct elements so a(1) = 2. %e A352969 After the 2nd step the set becomes {1*1, 1+1, 1*2, 1+2, 2*2, 2+2} = {1, 2, 2, 3, 4, 4} = {1, 2, 3, 4}. It has 4 distinct elements so a(2) = 4. %t A352969 Length /@ NestList[DeleteDuplicates[Flatten[Table[With[{a = #[[k]], b = #[[;; k]]}, {a b, a + b}], {k, Length[#]}]]] &, {1}, 6] %o A352969 (PARI) lista(nn) = {my(v = [1]); print1(#v, ", "); for (n=1, nn, v = setunion(setbinop((x,y)->(x+y), v), setbinop((x,y)->(x*y), v)); print1(#v, ", "););} \\ _Michel Marcus_, Apr 13 2022 %o A352969 (Python) %o A352969 from math import prod %o A352969 from itertools import combinations_with_replacement %o A352969 from functools import lru_cache %o A352969 @lru_cache(maxsize=None) %o A352969 def A352969_set(n): %o A352969 if n == 0: %o A352969 return {1} %o A352969 return set(sum(x) for x in combinations_with_replacement(A352969_set(n-1),2)) | set(prod(x) for x in combinations_with_replacement(A352969_set(n-1),2)) %o A352969 def A353969(n): %o A352969 return len(A352969_set(n)) # _Chai Wah Wu_, Apr 15 2022 %Y A352969 Cf. A263995, A273525, A353535, A353536. %K A352969 nonn,more,hard %O A352969 0,2 %A A352969 _Vladimir Reshetnikov_, Apr 12 2022 %E A352969 a(7) from _Thomas Scheuerle_, Apr 13 2022 %E A352969 a(7) corrected by _Chai Wah Wu_, Apr 15 2022 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE