login
A270819
a(n) is the number of arithmetic progressions of length 3 among the quadratic residues modulo prime(n).
0
0, 0, 0, 0, 10, 12, 16, 36, 44, 84, 90, 144, 160, 210, 230, 312, 406, 420, 528, 560, 576, 702, 820, 880, 1056, 1200, 1224, 1378, 1404, 1456, 1890, 2080, 2176, 2346, 2664, 2700, 2964, 3240, 3320, 3612, 3916, 3960, 4370, 4416, 4704, 4752, 5460, 5994, 6328, 6384, 6496
OFFSET
1,5
COMMENTS
Wraparound progressions as well as decreasing progressions are counted.
REFERENCES
R. Crandall and C. Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see Exercise 2.29 p. 111.
FORMULA
a(n) = (prime(n)-1)*floor((prime(n)-2)/8).
EXAMPLE
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).
MATHEMATICA
Table[(# - 1) Floor[(# - 2)/8] &@ Prime@ n, {n, 51}] (* Michael De Vlieger, Mar 23 2016 *)
PROG
(PARI) a(n) = my(p=prime(n)); (p-1)*((p-2)\8);
CROSSREFS
Cf. A063987.
Sequence in context: A109604 A187710 A063096 * A031183 A265043 A158871
KEYWORD
nonn
AUTHOR
Michel Marcus, Mar 23 2016
STATUS
approved