A375706 First differences of non-perfect-powers.
1, 2, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2
Offset: 1
Keywords
Examples
The 5th non-perfect-power is 7, and the 6th is 10, so a(5) = 3.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..100000
Programs
-
Mathematica
radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1; Differences[Select[Range[100],radQ]]
-
PARI
up_to = 112; A375706list(up_to) = { my(v=vector(up_to), pk=2, k=2, i=0); while(i<#v, k++; if(!ispower(k), i++; v[i] = k-pk; pk = k)); (v); }; v375706 = A375706list(up_to); A375706(n) = v375706[n]; \\ Antti Karttunen, Jan 19 2025
-
Python
from itertools import count from sympy import mobius, integer_nthroot, perfect_power def A375706(n): def f(x): return int(n+1-sum(mobius(k)*(integer_nthroot(x, k)[0]-1) for k in range(2, x.bit_length()))) m, k = n, f(n) while m != k: m, k = k, f(k) return next(i for i in count(m+1) if not perfect_power(i))-m # Chai Wah Wu, Sep 09 2024
Extensions
More terms from Antti Karttunen, Jan 19 2025
Comments