A242976 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.
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, 9, 8, 9, 9, 11, 13, 12, 12, 13, 13, 13, 12, 14, 12, 11, 13, 10, 13, 11, 15, 12, 12, 13, 11, 12, 11, 9, 8, 7, 9, 11, 12, 15, 12, 16, 17, 15, 19, 15, 19, 12, 17, 15, 15, 17, 15
Offset: 1
Keywords
Examples
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.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..6000
Programs
-
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}]
Comments