login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of truth tables generated by 3CNF expressions of n variables.
4

%I #21 Jul 15 2022 08:07:21

%S 2,4,16,256,43146,120510132,4977694100656

%N Number of truth tables generated by 3CNF expressions of n variables.

%C For n=5, computing the number of 3CNF truth tables took 2^32 bytes and 2^38 iterations. Computing the same number for n=6 may require 2^64 bits and 2^71 iterations.

%C I calculated a(6) using a different method; a(7) looks a lot harder. - _Don Knuth_, Dec 10 2012

%D Knuth, Donald E., Satisfiability, Fascicle 6, volume 4 of The Art of Computer Programming. Addison-Wesley, 2015, pages 148 and 220, Problem 191.

%H C. B. Barber, <a href="http://www.qhull.org/download/ttcnf-2005.1.zip">ttcnf 2005.1</a> (April 2005).

%H C. B. Barber, <a href="http://www.qhull.org/ttcnf">www.qhull.org/ttcnf</a>.

%o The following program generates all truth tables of k-CNF expressions of n variables:

%o start with the truth table (2^2^n) - 1 //e.g., 0xFFFF for n=4

%o for each new truth table //e.g., 0xFFFF

%o for each (n choose k) variables //e.g., a, c, d

%o for each (2^k) clause of these variables //e.g., (a or not c or not d)

%o generate a truth table from the clause and previous truth table //e.g., NewTT = PrevTT and (...)

%o Bit operations allow an efficient implementation of the last step. If you represent each variable by its truth table, A, B, ..., in 1-CNF, then the last step is 'NewTT = PrevTT and (A or B or C ...)'. For example, with four variables a, b, c and d, the 1-CNF truth table for 'a' is 0xFF00, 'not c' is 0x3333 and 'not d' is 0x5555. The corresponding step is 'NewTT = PrevTT and 0xFFBB'.

%Y Cf. A034472, A109457 (corresponding sequences for 1CNF and 2CNF), A112650, A000157, A000371, A000613, A000618, A003181.

%K nonn,hard

%O 0,1

%A C. Bradford Barber (bradb(AT)shore.net), Dec 13 2005

%E a(6) from _Don Knuth_, Dec 10 2012