OFFSET
1,1
COMMENTS
These triangular numbers are equal to p * (2p +- 1).
All terms belong to A006987. For n>2 all terms are odd and belong to A095147. - Alexander Adamchuk, Oct 31 2006
A156592 is a subsequence. - Reinhard Zumkeller, Feb 10 2009
Triangular numbers with exactly 4 divisors. - Jon E. Schoenfield, Sep 05 2018
LINKS
Jon E. Schoenfield, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)
FORMULA
EXAMPLE
Triangular numbers begin 0, 1, 3, 6, 10, ...; 6=2*3, and 2 and 3 are two distinct primes; 10=2*5, and 2 and 5 are two distinct primes, etc. - Vladimir Joseph Stephan Orlovsky, Feb 27 2009
a(11) = 1891 and 1891 = 31 * 61.
MAPLE
q:= n-> is(numtheory[bigomega](n)=2):
select(q, [i*(i+1)/2$i=0..1000])[]; # Alois P. Heinz, Mar 27 2024
MATHEMATICA
Select[ Table[ n(n + 1)/2, {n, 1000}], Apply[Plus, Transpose[ FactorInteger[ # ]] [[2]]] == 2 &]
(* Alternative: *)
Select[Accumulate[Range[1000]], PrimeOmega[#]==2&] (* Harvey P. Dale, Apr 03 2016 *)
PROG
(PARI) list(lim)=my(v=List()); forprime(p=2, (sqrtint(lim\1*8+1)+1)\4, if(isprime(2*p-1), listput(v, 2*p^2-p)); if(isprime(2*p+1), listput(v, 2*p^2+p))); Vec(v) \\ Charles R Greathouse IV, Jun 13 2013
(Python)
from itertools import islice
from sympy import isprime, nextprime
def A068443_gen(): # generator of terms
p = 3
while True:
if isprime(p>>1):
yield (p-1)*p>>1
if isprime(p+1>>1):
yield p*(p+1)>>1
p = nextprime(p)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Stephan Wagler (stephanwagler(AT)aol.com), Mar 09 2002
EXTENSIONS
Edited by Robert G. Wilson v, Jul 08 2002
Definition corrected by Zak Seidov, Mar 09 2008
STATUS
approved
