algorithm works but need check missing some partitions for n >=7
last change