OFFSET
1,10
COMMENTS
Number of squares less than n that do not divide n. - Wesley Ivan Hurt, Jan 06 2024
LINKS
Felix Fröhlich, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = floor(sqrt(n)) - Sum_{k=1..sqrt(n)} (1 - ceiling(n/k^2) + floor(n/k^2)).
a(n) = floor(sqrt(n)) - tau(sqrt(n/A007913(n)) = A000196(n) - A000005(sqrt(n/A007913(n))). - Chai Wah Wu, Jan 31 2021
a(n) = Sum_{k=1..n} c(k) * (ceiling(n/k) - floor(n/k)), where c = A010052. - Wesley Ivan Hurt, Jan 06 2024
EXAMPLE
a(9) = 1; floor(sqrt(9)) = 3 and the square of 2 does not divide 9,
a(10) = 2; floor(sqrt(10)) = 3 and the squares of 2 and 3 do not divide 10.
MATHEMATICA
Table[Sum[Ceiling[n/k^2] - Floor[n/k^2], {k, Sqrt[n]}], {n, 100}]
PROG
(PARI) a(n) = sum(k=1, floor(sqrt(n)), if (n % k^2, 1)); \\ Michel Marcus, Jan 31 2021
(Python)
from sympy import divisor_count, integer_nthroot
from sympy.ntheory.factor_ import core
def A338236(n):
return integer_nthroot(n, 2)[0]-divisor_count(integer_nthroot(n//core(n, 2), 2)[0]) # Chai Wah Wu, Jan 31 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jan 30 2021
STATUS
approved