login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 3
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Zhi-Wei Sun conjectures that only n=216 has no such representation. It appears that n = 2, 7, 61 and 211 are the only numbers for which the triangular number 0 is required in the representation (see A065397). When n is a triangular number, then a(n)=0. Sequence A132399 gives the number of representations of n as p+T. As n becomes larger, the largest prime required to verify the conjecture increases slowly. For example, for n<=10^3, the largest prime required is 953; for n<=10^6 it is 373361; for n<=10^9 it is only 36455351. Using primes less than 10^9, all n<243277591560 have been verified.

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, arXiv: Conjectures on sums of primes and triangular numbers

EXAMPLE

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

MATHEMATICA

nn=300; s=0; tri=Rest[Reap[i=0; While[s<nn, Sow[s]; i++; s=s+i]; Sow[s]]][[1, 1]]; k=1; Table[If[n==tri[[k+1]], k++; 0, m=k; While[p=n-tri[[m]]; m>1 && !PrimeQ[p], m-- ]; If[m==1 && !PrimeQ[p], -1, p]], {n, nn}]

CROSSREFS

Sequence in context: A154559 A143324 A097418 * A194354 A156776 A026728

Adjacent sequences:  A154749 A154750 A154751 * A154753 A154754 A154755

KEYWORD

nonn

AUTHOR

T. D. Noe, Jan 17 2009

EXTENSIONS

Offset in b-file corrected by N. J. A. Sloane Aug 31 2009

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified June 19 05:40 EDT 2013. Contains 226390 sequences.