%I #6 May 28 2014 11:59:19
%S 0,0,1,1,1,2,2,3,4,5,5,6,6,8,8,9,8,9,7,9,9,9,8,9,8,9,9,10,9,9,8,8,9,9,
%T 9,8,9,9,11,13,12,12,13,13,13,12,14,12,11,13,10,13,11,15,12,12,13,11,
%U 12,11,9,8,7,9,11,12,15,12,16,17,15,19,15,19,12,17,15,15,17,15
%N Number of ways to write n = i + j + k with 0 < i <= j <= k such that prime(i) mod i, prime(j) mod j and prime(k) mod k are all triangular numbers, where prime(m) mod m denotes the least nonnegative residue of prime(m) modulo m.
%C Conjecture: (i) a(n) > 0 for all n > 2.
%C (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}.
%C 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.
%H Zhi-Wei Sun, <a href="/A242976/b242976.txt">Table of n, a(n) for n = 1..6000</a>
%e 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.
%t TQ[n_]:=IntegerQ[Sqrt[8n+1]]
%t t[k_]:=TQ[Mod[Prime[k],k]]
%t a[n_]:=Sum[Boole[t[i]&&t[j]&&t[n-i-j]],{i,1,n/3},{j,i,(n-i)/2}]
%t Table[a[n],{n,1,80}]
%Y Cf. A000040, A000217, A000290, A000720, A242950.
%K nonn
%O 1,6
%A _Zhi-Wei Sun_, May 28 2014