A303748 a(n) is the number of distinct terms of the form i^j where 0 <= i,j <= n.
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
Keywords
Examples
For n=3 the distinct terms are 0,1,2,3,4,8,9,27 so a(3) = 8.
Links
- Michael De Vlieger, Table of n, a(n) for n = 0..500
- Ovidiu Bagdasar and Ralph Tatt, On some new arithmetic functions involving prime divisors and perfect powers, Electronic Notes in Discrete Mathematics (2018) Vol. 70, 9-15.
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.