1.Sexy primes are prime numbers that differ from each other by six. For example, the first 5 sexy prime pairs are (5, 11), (7, 13), (11, 17), (13, 19), (17, 23). Find the number of sexy prime pairs (p, p + 6) such that p ≤ 201415.
2.For each positive number n, define S(n) to be the sum of all its digits. For example, S(2014) = 2 + 0 + 1 + 4 = 7. Find S(2014^{2014}).
There are no mathematical tricks involved. This is pure brute-force but entirely straightforward Maple coding. The coding is easy in each case and executes in seconds or less.
Problem 1: Your solution technique is way off. In Maple,
The returned answer is 4317.
Problem 2: Don't let numbers with thousands of digits scare you. Maple handles them in an instant. This one is a one-liner:
The returned answer is 29761.