Nora is taking a trip to visit her Grandmother in northernmost New York State this week, to bring her some freshly picked berries. On the way there, she has to cross a total of 30 bridges, and under each of these bridges lives a troll. (That’s how they roll in northernmost New York.) Each troll is aware of their bridge number, and either demands or gives berries based upon the rarest or most applicable description of their bridge. They demand or give berries according to the following schedule:
- Trolls under odd numbered bridges demand half of your berries.
- Trolls under even numbered bridges demand 20 berries.
- Trolls under prime numbered bridges give you half again the number of berries you are carrying.
- Trolls under perfect square numbered bridges demand a quarter of your berries.
- Trolls under perfect cube numbered bridges give you the number of berries you are carrying, doubling your number of berries.
If trolls round up in their demands (i.e., if you have 57 berries at the foot of a bridge best described as odd numbered, you will cross it with 28 berries), what is the minimum number of berries Nora must start with so that she ends up with 1,000 berries when she arrives at her Grandmother’s house?