login
A243351
Difference between 2n and the n-th squarefree number: a(n) = 2n - A005117(n).
4
1, 2, 3, 3, 4, 5, 4, 5, 5, 6, 7, 7, 7, 7, 8, 9, 8, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 14, 15, 13, 13, 13, 13, 14, 15, 15, 16, 15, 16, 17, 17, 18, 19, 19, 20, 19, 20, 21, 20, 21, 21, 22, 23, 23, 23, 23, 24, 25, 25, 23, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30
OFFSET
1,2
LINKS
FORMULA
a(n) = 2n - A005117(n).
a(n) = n - A243348(n).
a(n) ~ c * n, where c = 2 - Pi^2/6 (A152416). - Amiram Eldar, Mar 04 2024
MATHEMATICA
Module[{sf=Select[Range[150], SquareFreeQ]}, Table[2n-sf[[n]], {n, Length[ sf]}]] (* Harvey P. Dale, Jun 26 2021 *)
PROG
(Python)
from math import isqrt
from sympy import mobius
def A243351(n):
def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
m, k = n, f(n)
while m != k:
m, k = k, f(k)
return (n<<1)-m # Chai Wah Wu, Aug 12 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 04 2014
STATUS
approved