A242876 Number of n X n nonograms (hanjie) which can be solved uniquely.
1, 2, 14, 384, 52362, 25309575, 49745060669
Offset: 0
Examples
There are two 1 X 1 grids, filled and unfilled, and both can be distinguished, so a(1) = 2. Of the 16 2 X 2 grids, only 10/01 and 01/10 cannot be distinguished (both have one block of length 1 for each row and column) and so a(2) = 14.
References
- N Ueda and T Nagao, NP-completeness results for NONOGRAM via parsimonious reductions, unpublished technical report (1996).
Links
- Bertram Felgenhauer, Counting Nonograms
- Wikipedia, Nonogram
Crossrefs
Programs
-
PARI
nono(v)=my(u=List(),t); for(i=1,#v,if(v[i],t++,if(t,listput(u,t);t=0))); if(t,listput(u,t)); Vec(u); nonomat(M)=vector(matsize(M)[1],i,nono(M[i,])); nono2(M)=[nonomat(M),nonomat(M~)]; num2mat(d,n)=matrix(d,d,i,j,bittest(n,(i-1)*d+j-1)); a(n)=my(v=vector(2^n^2,i,nono2(num2mat(n,i)))); v=vecsort(v,lex); sum(i=2,#v-1,v[i]!=v[i-1] && v[i]!=v[i+1])+(v[1]!=v[2])+(v[#v]!=v[#v-1]);
Formula
a(n) >= F(n)^2 * a(n-1), since there are F(n) ways to fill the last row (resp., column) such that the first and last squares are filled and no consecutive squares are unfilled. These configurations can be solved without looking at the other rows or columns and so allow expanding an (n-1) X (n-1) configuration to an n X n configuration. Thus a(n) >> phi^(n*(n+1))/5^n. (F(n) is the n-th Fibonacci number, A000045.) - Charles R Greathouse IV, Sep 02 2014 [Corrected by Bertram Felgenhauer, Jun 09 2025]
Extensions
a(5) from Mark E. Shoulson, Aug 13 2014
a(6) from Karl W. Heuer, Jan 29 2015
a(0) = 1 prepended and a(6) corrected by Bertram Felgenhauer, Jun 08 2025
Comments