cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A262251 Triangular numbers representable as 2^x + 3^y.

Original entry on oeis.org

3, 10, 28, 91
Offset: 1

Views

Author

Alex Ratushnyak, Sep 16 2015

Keywords

Comments

No other terms such that 0 <= x,y < 2000.
No other terms such that 0 <= x,y < 5250. - Michael S. Branicky, Mar 10 2021

Examples

			a(1) = 3 = 2^1 + 3^0.
a(4) = 91 = 2^6 + 3^3.
		

Crossrefs

Intersection of A000217 and A004050.

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