\\ Number of maximal subsets of {1..n} containing no sums or products of distinct elements. \\ Main recursive function has the following arguments: \\ k: Indicates elements from 2..k have been picked. \\ b: bitmap of chosen elements. \\ es: bitmap of sums of distinct elements of b. \\ ep: bitmap of products of distinct elements of b. A326025(n)={ \\ test for maximality my(ismaxl(b, es, ep)= for(k=2, n, if(!bittest(es,k) && !bittest(ep,k) && !bitand(es, b>>k), my(f=0); for(i=2, n\k, if(bittest(ep,i) && bittest(b,k*i), f=1; break)); if(!f, return(0)); )); 1 ); \\ main recursion my(recurse(k, b, es, ep)= k++; if(k > n, ismaxl(b, es, ep), my(t = self()(k, b, es, ep)); if(!bittest(es,k) && !bittest(ep, k), es = bitor(es, bitand((2< 1, recurse(1, 0, 1, 2)); } \\ End