|
|
with t0(a) as(values(0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11))
,n(n) as(values(1),(2),(3))
,t(a,f)as(select a,a/4 +1 f from t0)
,s(lv,b,c) as(select 1,1<<a,f from t where a%2=1
union all
select lv+1,b+(1<<a),c||f from s,t
where lv<12 and b &(1<<a) =0
and a%2=(lv+1)%2
and not ( lv>=3 and
(c||f)%10000 % 1111=0
)
)
select 2*count(*) from s where lv=12
and not exists(select 1 from n where (substr(c,n-4)||substr(c,1,n)) % 1111=0)
;
890880 |
|