for first part i think it should be k^(n)
for 2d part here k*(k+1)*(k+2)*..........(k+n-1)
: Break this into n tasks, placing each book separately. Start with the sequence 1,2,3,4.......k to represent the shelves. Represent the books by bi, i = 1, 2, ..., n. Place b1 to the right of one of the terms in 1, 2, 3, 4............. Then successively place b2, b3, ..., and b12.)
There are k ways to place b1, (k+1) ways to place b2, ..., (k+n-1) ways to place bn. correct if i am wrong here