OFFSET
1,6
COMMENTS
Conjecture: (i) a(n) > 0 for all n > 2.
(ii) Any integer n > 3 can be written as a + b + c + d with a, b, c, d in the set {k>0: prime(k) mod k is a square}.
Clearly, part (i) implies that there are infinitely many positive integer k with prime(k) mod k a triangular number, and part (ii) implies that there are infinitely many positive integer k with prime(k) mod k a square.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..6000
EXAMPLE
a(5) = 1 since 5 = 1 + 2 + 2, prime(1) == 0*1/2 (mod 1) and prime(2) = 3 == 1*2/2 (mod 2). Note that prime(3) = 5 == 2 (mod 3) with 2 not a triangular number.
MATHEMATICA
TQ[n_]:=IntegerQ[Sqrt[8n+1]]
t[k_]:=TQ[Mod[Prime[k], k]]
a[n_]:=Sum[Boole[t[i]&&t[j]&&t[n-i-j]], {i, 1, n/3}, {j, i, (n-i)/2}]
Table[a[n], {n, 1, 80}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, May 28 2014
STATUS
approved