OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..502
FORMULA
Conjectures from Colin Barker, Sep 16 2015: (Start)
a(n) = 2^(n-5)*(2^n+4) for n>5.
a(n) = 6*a(n-1)-8*a(n-2) for n>7.
G.f.: x*(240*x^6+28*x^5-70*x^4+24*x^3-2*x^2-12*x+3) / ((2*x-1)*(4*x-1)).
(End)
PROG
(Python)
def isTriangular(a):
sr = 1 << (int.bit_length(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 a in range(1, 200):
for b in range(a):
c = (1<<a) + (1<<b)
if isTriangular(c): print(str(c), end=', ')
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Sep 15 2015
STATUS
approved