I can easily compute the monthly payment for a loan given the amount, the number of periods, and the periodic rate. From that, I can easily build an amortization table iteratively by subtracting the periodic interest from the principal and re-calculating it for the next period. What I'm looking for is a method that will allow me to compute the {principal,interest} values for a specific period in the loan without having to compute all of the values before it.
Said another way, I want a formula that spits out the answer to: "In month 78 of a 360-month loan of $100,000 at 5%, what is the breakdown of principal vs. interest". Again, without having to do this iteratively.