{1, 2, 3, 4, 5, 6}等价于{3, 6, 4, 1, 2, 5} {1, 2, 3, 4, 5, 6}不同于{1, 2, 3, 4, 5, 9}

```with t as(select level-1 l from dual connect by level<=10),
t1(a,p,lv) as(select l,power(2,l),1 from t
union all
select l,p+power(2,l),lv+1 from t1,t where a<l and lv<6),
a as(select p pa from t1 where lv=6),
b as(select pa pb from a),
s as(select power(2,substr('0104061625364618',level*2-1,1))s1,
power(2,substr('0104061625364618',level*2,1))s2 from dual connect by level<=8),
j as(select pa,pb from a,b where pa<pb and not exists(select 1 from s where bitand(pa,s1)*bitand(pb,s2) =0
and bitand(pa,s2)*bitand(pb,s1)=0))
select count(*) from (
select pa,pb from j
union
select least(pa-64+512,pb),greatest(pa-64+512,pb) from j where bitand(pa,512)=0 and bitand(pa,64)<>0
union
select least(pa,pb-64+512),greatest(pa,pb-64+512) from j where bitand(pb,512)=0 and bitand(pb,64)<>0
union
select pa-64+512,pb-64+512 from j where bitand(pb,512)=0 and bitand(pb,64)<>0 and bitand(pa,512)=0 and bitand(pa,64)<>0
);

```

```with t as(select level-1 l from dual connect by level<=10),
t1(a,p,lv) as(select l,power(2,l),1 from t
union all
select l,p+power(2,l),lv+1 from t1,t where a<l and lv<6),
a as(select p ,decode (bitand(p,64+512),64,p+512,512,p+64,p)pa from t1 where lv=6), --p actual ,pa expand
b as(select p,pa pb from a),
s as(select power(2,substr('0104061625364618',level*2-1,1))s1,
power(2,substr('0104061625364618',level*2,1))s2 from dual connect by level<=8),
j as(select pa,pb from a,b where pa<pb and not exists(select 1 from s where bitand(pa,s1)*bitand(pb,s2) =0
and bitand(pa,s2)*bitand(pb,s1)=0))
select count(*) from (
select pa,pb from j
);
```