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.

A303748 a(n) is the number of distinct terms of the form i^j where 0 <= i,j <= n.

Original entry on oeis.org

1, 2, 4, 8, 12, 20, 29, 41, 51, 61, 77, 97, 116, 140, 164, 190, 208, 240, 271, 307, 341, 379, 418, 462, 504, 540, 586, 622, 671, 727, 780, 840, 882, 942, 1004, 1068, 1114, 1186, 1255, 1327, 1398, 1478, 1554, 1638, 1718, 1800, 1885, 1977, 2064, 2136, 2226, 2322
Offset: 0

Views

Author

Ralph-Joseph Tatt, Apr 30 2018

Keywords

Examples

			For n=3 the distinct terms are 0,1,2,3,4,8,9,27 so a(3) = 8.
		

Crossrefs

Cf. A126254.

Programs

  • Mathematica
    {1}~Join~Array[Length@ Union@ Map[#1^#2 & @@ # &, Rest@ Tuples[Range[0, #], {2}]] &, 51] (* Michael De Vlieger, Jan 31 2019 *)
  • Python
    def distinct(limit):
        unique = set()
        for i in range(limit+1):
            for j in range(limit+1):
                if i**j not in unique:
                    unique.add(i**j)
        return len(unique)
    print([distinct(i) for i in range(40)])

Formula

a(n) = A126254(n) + 1.