Starlight Lantern Chain
The Starlight Chain Ceremony on Lyris Bluff begins each evening when keepers line the cliffside with silver lanterns polished by sea spray. The first lantern hangs alone on the lowest hook, guiding sailors toward the inlet. Before more light is added, the herald steps forward to announce how many tiers of the chain will glow this night. Each new tier receives a fresh lantern so the procession knows where the next ascent begins, and the wind-polished mirrors strung along the rope reflect every lantern from the previous tier twice over, casting twin rivers of light down the stone.
Villagers say the radiance feels like conversation between generations. After the guiding lantern is set, the reflections from the earlier tier return immediately, folding into the ceremony without delay. No one alters the cadence; doing so would confuse the crews waiting offshore. The practice is steady and predictable: a new lantern is placed, then the glow from the prior tier streams back in two mirrored waves, embracing the cliff in soft brightness.
Your task is to determine how many lanterns appear once the last tier is secured. The input, tiers, is a non-negative integer describing how many levels extend above the starting hook. When tiers is zero, sailors see only the lone lantern. For each higher tier, add one guiding lantern and allow the entire previous display to reappear twice through the mirrored rope. Return an integer representing the total lanterns visible when the ceremony concludes.
Example 1:
Input: tiers = 0
Output: 1
Explanation: Only the initial lantern shines.
Example 2:
Input: tiers = 2
Output: 7
Explanation: The second tier adds a lantern and doubles the earlier glow.
Example 3:
Input: tiers = 3
Output: 15
Explanation: Three tiers preserve the pattern, revealing fifteen lanterns in total.
Related Problems
No related problems found
Comments (0)
Join the Discussion
Share your thoughts, ask questions, or help others with this problem.
