login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A111163 Triangular numbers that are sums of two consecutive primes. 8
36, 78, 120, 210, 276, 300, 630, 946, 990, 1770, 1830, 2556, 2850, 3240, 3570, 4278, 4950, 5460, 8256, 9870, 10878, 11026, 12090, 12720, 20100, 20910, 23436, 26796, 31626, 34980, 41616, 43660, 46056, 55278, 56616, 57630, 59340, 66066, 73920 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Intersection of A000217 and A001043. - Michel Marcus, May 18 2015
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000 (n = 1..472 from K. D. Bajpai, n = 473..1000 from T. D. Noe)
EXAMPLE
36 = 8(8+1)/2 = 17 + 19. Therefore 36 belongs to the sequence.
MAPLE
P:=proc()local i, a, b, c; c:=1; for i from 1 to 1200000 do;
a:=ithprime(i)+ithprime(i+1); b:=(-1+(sqrt(8*a+1)))/2;
if b=floor(b) then lprint(c, a); c:=c+1; fi; od; end:P();
# K. D. Bajpai, Jun 30 2013
MATHEMATICA
Select[Table[Prime[n] + Prime[n + 1], {n, 4500}], IntegerQ[Sqrt[1 + 8# ]] &] (* Ray Chandler, Oct 22 2005 *)
t = {}; n = 0; While[Length[t] < 100, n++; s = Prime[n] + Prime[n + 1]; If[TriangularQ[s], AppendTo[t, s]]]; t (* T. D. Noe, Jun 30 2013 *)
PROG
(PARI) {p=2; ct=0; while(ct<66, q=nextprime(p+1); s=p+q; if( issquare(8*s+1), print1(s, ", "); ct++); p=q)} \\ Klaus Brockhaus, Oct 22 2005
(Python)
from sympy import nextprime as np
from sympy import prevprime as pp
n=1
t=n*(n+1)//2
while t>0:
....if t%2==0 and t>3:
........i=int(t//2)
........p=pp(i); q=np(p)
........if p+q==t :
............print(int(t))
....n=n+1
....t=n*(n+1)//2 # Abhiram R Devesh, May 17 2015
(Python)
from __future__ import division
from sympy import prevprime, nextprime, isprime
A111163_list = [n*(n+1)//2 for n in range(3, 10**4) if not isprime(n*(n+1)//4) and prevprime(n*(n+1)//4)+nextprime(n*(n+1)//4) == n*(n+1)//2] # Chai Wah Wu, Feb 11 2018
CROSSREFS
Cf. A000217 (triangular numbers), A001043 (sums of consecutive primes).
Sequence in context: A255101 A255094 A261284 * A286430 A279901 A335276
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Oct 20 2005
EXTENSIONS
Extended by Ray Chandler and Klaus Brockhaus, Oct 22 2005
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 11 17:33 EDT 2024. Contains 372410 sequences. (Running on oeis4.)