\\ Number of maximal sum-free and product-free subsets of {1..n}. \\ Main recursive function has the following arguments: \\ k: Indicates elements from 2..k have been picked. \\ b: bitmap of chosen elements. A326497(n)={ my(lim=vector(n, k, sqrtint(k))); my(accept(b,k) = for(i=1, k\2, if(bittest(b, i) && (bittest(b, k-i) || (!(k%i) && bittest(b, k/i))), return(0))); 1); my(ismaxl(b)= for(k=2, n, if(!bittest(b,k) && accept(b,k) && !bitand(b, b>>k), my(f=0); for(i=2, n\k, if((i==k || i == 2 || bittest(b,i)) && bittest(b,k*i), f=1; break)); if(!f, return(0)); )); 1 ); my(recurse(k, b)= k++; if(k > n, ismaxl(b), self()(k, b) + if(accept(b,k), self()(k, b + (1<