# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a178173 Showing 1-1 of 1 %I A178173 #18 May 20 2021 08:19:49 %S A178173 1,2,8,128,11087,2232875,775098224,428188962261,355916994389700, %T A178173 425272149099677521,703909738878615927739,1565842283246869237505246, %U A178173 4565002967677134523844716754,17076464900445281560851997140670,80494979734877344662882495100752511 %N A178173 Number of collections of nonempty subsets of an n-element set where each element appears in at most 4 subsets. %H A178173 Andrew Howroyd, Table of n, a(n) for n = 0..50 %o A178173 (Python) %o A178173 from sets import Set %o A178173 from numpy import array %o A178173 def toBinary(n,k): %o A178173 ans=[] %o A178173 for i in range(k): %o A178173 ans.insert(0,n%2) %o A178173 n=n>>1 %o A178173 return array(ans) %o A178173 def powerSet(k): return [toBinary(n,k) for n in range(1,2**k)] %o A178173 def courcelle(maxUses,remainingSets,exact=False): %o A178173 if exact and not all(maxUses<=sum(remainingSets)): ans=0 %o A178173 elif len(remainingSets)==0: ans=1 %o A178173 else: %o A178173 set0=remainingSets[0] %o A178173 if all(set0<=maxUses): ans=courcelle(maxUses-set0,remainingSets[1:],exact=exact) %o A178173 else: ans=0 %o A178173 ans+=courcelle(maxUses,remainingSets[1:],exact=exact) %o A178173 return ans %o A178173 for i in range(10): %o A178173 print(i, courcelle(array([4]*i),powerSet(i),exact=False)) %o A178173 (PARI) \\ See A330964 for efficient code to compute this sequence. - _Andrew Howroyd_, Jan 04 2020 %Y A178173 Row n=4 of A330964. %Y A178173 Replacing limit of 2 with a limit of 1 gives the Bell numbers A000110, limit of 2 gives A178165, limit of 3 gives A178171. %K A178173 nonn %O A178173 0,2 %A A178173 _Daniel E. Loeb_, Dec 17 2010 %E A178173 a(6)-a(8) from _Bert Dobbelaere_, Sep 10 2019 %E A178173 Terms a(9) and beyond from _Andrew Howroyd_, Jan 04 2020 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE