The OEIS is supported by the many generous donors to the OEIS Foundation.

a(n) is the number of arithmetic progressions of length 3 among the quadratic residues modulo prime(n).

0

`%I #7 Mar 25 2016 06:49:57
`

`%S 0,0,0,0,10,12,16,36,44,84,90,144,160,210,230,312,406,420,528,560,576,
`

`%T 702,820,880,1056,1200,1224,1378,1404,1456,1890,2080,2176,2346,2664,
`

`%U 2700,2964,3240,3320,3612,3916,3960,4370,4416,4704,4752,5460,5994,6328,6384,6496
`

`%N a(n) is the number of arithmetic progressions of length 3 among the quadratic residues modulo prime(n).
`

`%C Wraparound progressions as well as decreasing progressions are counted.
`

`%D R. Crandall and C. Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see Exercise 2.29 p. 111.
`

`%F a(n) = (prime(n)-1)*floor((prime(n)-2)/8).
`

`%e For p=prime(5)=11, whose quadratic residues are (1,3,4,5,9), some examples of 3-term arithmetic progressions are (3,4,5), (4,9,3) and (5,4,3).
`

`%t Table[(# - 1) Floor[(# - 2)/8] &@ Prime@ n, {n, 51}] (* _Michael De Vlieger_, Mar 23 2016 *)
`

`%o (PARI) a(n) = my(p=prime(n)); (p-1)*((p-2)\8);
`

`%Y Cf. A063987.
`

`%K nonn
`

`%O 1,5
`

`%A _Michel Marcus_, Mar 23 2016
`