problem 78 project euler

Coin partitions
Problem 78
Let p(n) represent the number of different ways in which n coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so p(5)=7.

OOOOO
OOOO O
OOO OO
OOO O O
OO OO O
OO O O O
O O O O O
Find the least value of n for which p(n) is divisible by one million.
any boddy can solve this?
Last edited on
You could use Google to get many "boddies".
Don't know if this is the fastest way; one approach is to generate partition numbers one by one (using the recurrence formula) till a number divisible by one million is generated.
See: https://en.wikipedia.org/wiki/Partition_(number_theory)#Recurrence_formula
Topic archived. No new replies allowed.