solution for p2: 4613732
solution to p3: 6857
solution to p4: 906609
solution to p5: 232792560