A262251 Triangular numbers representable as 2^x + 3^y.
3, 10, 28, 91
Offset: 1
Examples
a(1) = 3 = 2^1 + 3^0. a(4) = 91 = 2^6 + 3^3.
Crossrefs
Programs
-
PARI
isok(t) = {for (k=0, logint(t, 2), my(tt = t - 2^k); if (tt, p = valuation(tt, 3); if (tt == 3^p, return(1))););} lista(nn) = for (n=1, nn, if (isok(t=n*(n+1)/2), print1(t, ", "))); \\ Michel Marcus, Sep 20 2015
-
PARI
select(x->ispolygonal(x, 3), setbinop(f, [0..20], [0..20])) \\ Michel Marcus, Mar 10 2021
-
Python
from sympy import integer_nthroot def auptoexponent(maxexp): sums = set(2**x + 3**y for x in range(maxexp) for y in range(maxexp)) iroots = set(integer_nthroot(2*s, 2)[0] for s in sums) return sorted(set(r*(r+1)//2 for r in iroots if r*(r+1)//2 in sums)) print(auptoexponent(500)) # Michael S. Branicky, Mar 10 2021
Comments