|
|
A060298
|
|
Number of powers x^y (x,y > 1) with n digits.
|
|
2
|
|
|
3, 12, 34, 94, 263, 768, 2333, 7167, 22291, 69751, 219081, 689736, 2174856, 6864354, 21679391, 68497906, 216485583, 684323923, 2163459803, 6840258025, 21628220224, 68388917596, 216252901472, 683826283482, 2162393925204, 6837972506895, 21623315009817
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Limit_{n->oo} a(2n)/10^n = 1 - 1/sqrt(10).
Limit_{n->oo} a(2n-1)/10^n = 1/sqrt(10) - 1/10. (End)
|
|
LINKS
|
|
|
FORMULA
|
a(n) = Sum_{y=2..floor(n*log_2(10))} (ceiling(10^(n/y)) - ceiling(10^((n-1)/y))) for n >= 2. - Robert Israel, Apr 29 2020
|
|
EXAMPLE
|
a(1) = 3 because there are 3 powers with 1 digit: 2^2, 2^3 and 3^2.
|
|
MAPLE
|
f:= proc(n) local y;
add(ceil(10^(n/y))-ceil(10^((n-1)/y)), y=2..floor(n*log[2](10)))
end proc:
f(1):= 3:
|
|
PROG
|
(Python) # see link
(Python)
from sympy import integer_nthroot, integer_log
if n == 1: return 3
c, y, a, b, t = 0, 2, 10**n-1, 10**(n-1)-1, (10**n).bit_length()
while y<t:
c += (m:=integer_nthroot(a, y)[0])-(k:=integer_nthroot(b, y)[0])
y = (integer_log(b, k)[0] if m==k else y)+1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|