login
A226499
Triangular numbers representable as m * triangular(m).
3
0, 1, 6, 4851
OFFSET
1,3
EXAMPLE
6 = 2 * triangular(2).
4851 = 21 * triangular(21).
MATHEMATICA
TriangularQ[n_] := IntegerQ[Sqrt[1 + 8*n]]; s = Select[Range[0, 10000], TriangularQ[#^2 (# + 1)/2] &]; s^2 (s + 1)/2 (* T. D. Noe, Jun 12 2013 *)
PROG
(Python)
def isTriangular(a):
sr = 1 << (int.bit_length(int(a)) >> 1)
a += a
while a < sr*(sr+1): sr>>=1
b = sr>>1
while b:
s = sr+b
if a >= s*(s+1): sr = s
b>>=1
return (a==sr*(sr+1))
for n in range(10000):
product = n*n*(n+1)//2
if isTriangular(product): print(product, end=', ')
CROSSREFS
Cf. A000217.
Sequence in context: A373237 A268504 A099723 * A343096 A066061 A028366
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Jun 09 2013
STATUS
approved