A154752 Least prime p (or 0) such that n = p + T, where T is a triangular number (A000217), or -1 if there is no such representation.
0, 2, 0, 3, 2, 0, 7, 2, 3, 0, 5, 2, 3, 11, 0, 13, 2, 3, 13, 5, 0, 7, 2, 3, 19, 5, 17, 0, 19, 2, 3, 11, 5, 13, 7, 0, 31, 2, 3, 19, 5, 41, 7, 23, 0, 31, 2, 3, 13, 5, 23, 7, 17, 53, 0, 11, 2, 3, 23, 5, 61, 7, 53, 19, 29, 0, 31, 2, 3, 67, 5, 17, 7, 19, 47, 31, 11, 0, 13, 2, 3, 37, 5, 29, 7, 31, 59, 43
Offset: 1
Keywords
Examples
n=p+T: 1=0+1; 2=2+0; 3=0+3; 4=3+1; 5=2+3; 6=0+6; 7=7+0; 8=2+6; 9=3+6; 10=0+10.
References
- Zhi-Wei Sun, On sums of primes and triangular numbers, Journal of Combinatorics and Number Theory, 1(2009), no.1, 65-76.
Links
- T. D. Noe, Table of n, a(n) for n=1..10001
- Zhi-Wei Sun, On sums of primes and triangular numbers, arXiv:0803.3737 [math.NT], 2008-2009.
Programs
-
Mathematica
nn=300; s=0; tri=Rest[Reap[i=0; While[s
1 && !PrimeQ[p], m-- ]; If[m==1 && !PrimeQ[p], -1, p]], {n,nn}]
Extensions
Offset in b-file corrected by N. J. A. Sloane, Aug 31 2009
Comments