|
|
A303748
|
|
a(n) is the number of distinct terms of the form i^j where 0 <= i,j <= n.
|
|
1
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
For n=3 the distinct terms are 0,1,2,3,4,8,9,27 so a(3) = 8.
|
|
MATHEMATICA
|
{1}~Join~Array[Length@ Union@ Map[#1^#2 & @@ # &, Rest@ Tuples[Range[0, #], {2}]] &, 51] (* Michael De Vlieger, Jan 31 2019 *)
|
|
PROG
|
(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)])
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|