Gosh! It's never a good sign when I've been at a brick wall with this problem and there's no problem thread.

I wanna say I'm almost there, got closed forms for everything, not brute forcing anything, but I must be missing something really simple given how many people have solved this.

EDIT: Got it. I had most of the right ideas but I had to dig to find the error in my code.

## Problem 624

**Forum rules**

As your posts will be visible to the general public you

are requested to be thoughtful in not posting anything

that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one

See also the topics:

Don't post any spoilers

Comments, questions and clarifications about PE problems.

### Re: Problem 624

A little late, but good for you! Hopefully, I should also be able to solve this problem.

EDIT: I can match the example for P(2), but my modular arithmetic skills are not enough to get me across the line on this one!

EDIT: I can match the example for P(2), but my modular arithmetic skills are not enough to get me across the line on this one!

my friend key --> 990813_OZPwQtCjkD6KlvxirOoTSZxccMFsuw1L