login
a(1) = 1; for n>1, a(n) = smallest number that is not a sum or product of any subset of the numbers a(1) to a(n-1).
6

%I #20 Jun 20 2019 17:49:53

%S 1,2,4,9,17,25,59,67,176,226,578,628,1340,1876,4472,5728,13952,17704,

%T 43112,54568,133088,168496,410720,519856,1267568,1604560,3911840,

%U 4951552,12072512,15281632,37257248,47160352,114980864,145544128,354845696,449166400,1095100352,1386188608

%N a(1) = 1; for n>1, a(n) = smallest number that is not a sum or product of any subset of the numbers a(1) to a(n-1).

%F Conjectures from _Colin Barker_, Jun 19 2019: (Start)

%F G.f.: x*(1 - x)*(1 + 3*x + 5*x^2 + 10*x^3 + 15*x^4 + 14*x^5 + 25*x^6 + 10*x^7 + 8*x^8 + 18*x^9 + 42*x^10 - 402*x^12 - 552*x^13 - 720*x^14 - 804*x^15) / (1 - 2*x^2 - 4*x^4 + 2*x^6).

%F a(n) = 2*a(n-2) + 4*a(n-4) - 2*a(n-6) for n>17.

%F (End)

%e a(4) = 9 because the possible sums and products of one or more terms from a(1), a(2), a(3) are 1, 2, 4, 1+2, 1+4, 2+4, 1+2+4, 1, 2, 4, 1*2, 1*4, 2*4, 1*2*4 = 1, 2, 4, 3, 5, 6, 7, 1, 2, 4, 2, 4, 8, 8. The smallest missing number is 9.

%t (* This program is not efficient for a large number of terms *) a[1] = 1; a[n_] := a[n] = For[s = Subsets[Array[a, n-1]]; sums = Plus @@@ s; prods = Times @@@ s; k = a[n-1]+1, True, k++, If[FreeQ[sums, k], If[FreeQ[prods, k], Print["a(", n, ") = ", k ]; Return[k]]]]; Array[a, 20] (* _Jean-François Alcover_, May 26 2015 *)

%K nonn,nice

%O 1,2

%A Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Nov 02 2001

%E More terms from _Jon E. Schoenfield_, Jun 17 2007

%E a(35)-a(38) from _Donovan Johnson_, Jan 11 2011