Let p be an odd prime and let d∈{2,3,7}. When (p−d)=1 we can
write p=x2+dy2 with x,y∈Z; in this paper we aim at determining
x or y modulo p2. For example, when p=x2+3y2, we show that if
p≡x≡1(mod4) then k=0∑(p−1)/2(3[3∣k]−1)(2k+1)(−16)k(k2k)2≡(p2)2x(modp2)
where [3∣k] takes 1 or 0 according as 3∣k or not, and that if
−p≡y≡1(mod4) then k=0∑(p−1)/2(3k)(−16)kk(k2k)2≡(−1)(p+1)/4y≡k=0∑(p−1)/2(1−3[3∣k])(−16)kk(k2k)2(modp2). We also determine
k=0∑p−1mkk(k2k)3k≤j<2k∑j1mod p for m=1,−8,16,−64,256,−512,4096.