OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..259 (all terms up to and including the 10000th triangular number)
EXAMPLE
190 is in the sequence because it is triangular (190=19*20/2) and 190=10*19, with 10 triangular number and 19 prime number.
MAPLE
N:= 10^5: # to get all terms <= N
Primes:= select(isprime, [2, seq(2*k+1, k=1..N/3)]):
select(t -> issqr(1+8*t), {seq(seq(a*(a+1)/2*p, a = 2 .. floor(sqrt(2*N/p))), p = Primes)});
# if using Maple 11 or earlier, uncomment the next line
# sort(convert(%, list)); # Robert Israel, Jan 07 2015
MATHEMATICA
Join[{0}, Module[{nn=300, trs}, trs=Accumulate[Range[nn]]; Select[ trs, AnyTrue[ #/trs, PrimeQ]&]]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 16 2018 *)
PROG
(PARI) {i=1; j=2; print1(0, ", "); while(i<=10^5, k=1; p=2; c=0; while(k<i&&c==0, if(i/k==i\k&&isprime(i/k)&&i/k>1, c=k); if(c>0, print1(i, ", ")); k+=p; p+=1); i+=j; j+=1)}
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Antonio Roldán, Jan 07 2015
STATUS
approved