A188951 Number of perfect powers (A001597) < 2^n.
0, 1, 1, 2, 4, 7, 10, 15, 22, 30, 41, 57, 81, 113, 155, 216, 298, 416, 582, 813, 1135, 1588, 2223, 3115, 4368, 6135, 8622, 12127, 17063, 24022, 33838, 47688, 67226, 94804, 133737, 188709, 266350, 376018, 530940, 749819, 1059096, 1496143, 2113801, 2986769
Offset: 0
Keywords
Examples
For n=3, the perfect powers smaller than 2^3=8 are: 1 and 4. So a(3) = 2.
Links
- Amiram Eldar, Table of n, a(n) for n = 0..6643
Programs
-
Mathematica
Join[{0,1}, Table[-Sum[MoebiusMu[x]*Floor[2^(n/x) - 1], {x, 2, n}], {n, 2, 50}]]
-
PARI
a(n) = sum(k=1, 2^n-1, (k==1) || ispower(k)); \\ Michel Marcus, Apr 11 2016
-
Python
from sympy import mobius, integer_nthroot def A188951(n): return int(sum(mobius(x)*(1-integer_nthroot(1<
Chai Wah Wu, Aug 13 2024
Formula
a(n) = A070228(n) - 1 for n > 1. - Amiram Eldar, May 19 2022