# Thread: Algorithm to compute the k first and last digits of n^n

1. ## Algorithm to compute the k first and last digits of n^n

Hello !

I'm having trouble with this :

I want to write an algorithm that computes the K first and K last digits of n^n.

I know I should use some sort of combination between (a+b)^n and log(n) but I'm really striking out !

2. ## Re: Algorithm to compute the k first and last digits of n^n

Hey SummerTime.