Summation of a Modular Formula (noch nicht übersetzt)

Problem 717

For an odd prime p, define f(p)=2(2p)pmod2p
For example, when p=3, 28/3=855(mod8) and so f(3)=5.

Further define g(p)=f(p)modp. You are given g(31)=17.

Now define G(N) to be the summation of g(p) for all odd primes less than N.
You are given G(100)=474 and G(104)=2819236.

Find G(107)