If q is prime, there are 3 options:
  q=2; q≡1(mod 4); q≡3(mod 4).
(i) q=2 ==> 4q+1=9 isn't prime.
(ii) q≡1(mod 4) ==> p=4q+1=4(4k+1)+1=16k+4+1=8(2k)+5≡5(mod 8)
    q≡3(mod 4) ==> p=4q+1=4(4k+3)+1=16k+12+1=16k+8+5≡5(mod 8)
Therefore (2/p)=-1
Let's assume 2 isn't a primitive root modulo p; Then there exists such a k>1 that 2(p-1)/k≡1(mod p) and 4q/k is whole, which means k|4q.
Because q is prime it means either k is even or k=q.
If k=q, 24q/q=24≡1(mod p) ==> 16≡1(mod p)=> 15≡0(mod p) => 15=n*p => p=3,5 but both of them don't fit into the description of p (i.e. 4q+1 where q is prime).
Then k is even, which means k=2m.
2(p-1)/2=(2(p-1)/2m)m≡=1m≡1(mod p)   (1)
But (2/p)=-1 and by Euler's criterion 2(p-1)/2=-1. In contradioction with (1), thus 2 is a primitive root modulo p!
w(n)=S1
        d|n
Sw(n)=SS1=S#{n≤x:p|n}=S{x/p+o(1)}=xS(1/p)+o(P(x)=xloglogx+o(x)
n≤x  n≤x p|n  p≤x            p≤x                  p≤x