#1^n + 2^n + 3^n + 4^n = k*10^p#
#=> 2^n + 2^(2*n) = k*10^p - 3^n - 1#
#=> 2^n * (1 + 2^n) = k*2^p*5^p - 3^n - 1#
#"Now, assuming that "n >= p", we can say that"#
#"LHS divisible by "2^n => " RHS divisible by "2^n#
#=> " RHS divisible by "2^p#
#"As "k*2^p*5^p" is already divisible by "2^p", we have the"#
#"condition that"#
#3^n + 1 " is divisible by "2^p#
#"Now take "p=3#
#3^n + 1 " is NOT divisible by "2^3 = 8#
#"We can prove this as follows"#
#3^n mod 8 != 5 and#
#3^n mod 8 != 7" (induction hypothesis)"#
#=> 3^(n+1) mod 8 = (3 * (3^n mod 8)) mod 8#
#"So we assume that "(3^n mod 8)" can only be 0,1,2,3,4,6."#
#"Then"#
#(3 * 0) mod 8 = 0#
#(3 * 1) mod 8 = 3#
#(3 * 2) mod 8 = 6#
#(3 * 3) mod 8 = 1#
#(3 * 4) mod 8 = 4#
#(3 * 6) mod 8 = 2#
#"So the same goes for "3^(n+1) mod 8.#
#"We conclude that"#
#3^n mod 8 != 7 => 3^n + 1 " is NOT divisible by 8."#
#"So p cannot be bigger than 2."#