login
Number of numbers less than or equal to sqrt(n) whose square does not divide n.
8

%I #38 Dec 22 2024 02:31:08

%S 0,0,0,0,1,1,1,0,1,2,2,1,2,2,2,1,3,2,3,2,3,3,3,2,3,4,3,3,4,4,4,2,4,4,

%T 4,2,5,5,5,4,5,5,5,4,4,5,5,3,5,5,6,5,6,5,6,5,6,6,6,5,6,6,5,4,7,7,7,6,

%U 7,7,7,4,7,7,6,6,7,7,7,5,6,8,8,7,8,8,8,7,8,7,8

%N Number of numbers less than or equal to sqrt(n) whose square does not divide n.

%C Number of squares less than n that do not divide n. - _Wesley Ivan Hurt_, Jan 06 2024

%H Felix Fröhlich, <a href="/A338236/b338236.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = floor(sqrt(n)) - Sum_{k=1..sqrt(n)} (1 - ceiling(n/k^2) + floor(n/k^2)).

%F a(n) = floor(sqrt(n)) - tau(sqrt(n/A007913(n))) = A000196(n) - A000005(sqrt(n/A007913(n))). - _Chai Wah Wu_, Jan 31 2021

%F a(n) = Sum_{k=1..n} c(k) * (ceiling(n/k) - floor(n/k)), where c = A010052. - _Wesley Ivan Hurt_, Jan 06 2024

%F a(n) = A000196(n) - A046951(n). - _Ridouane Oudra_, Sep 04 2024

%e a(9) = 1; floor(sqrt(9)) = 3 and the square of 2 does not divide 9,

%e a(10) = 2; floor(sqrt(10)) = 3 and the squares of 2 and 3 do not divide 10.

%t Table[Sum[Ceiling[n/k^2] - Floor[n/k^2], {k, Sqrt[n]}], {n, 100}]

%o (PARI) a(n) = sum(k=1, floor(sqrt(n)), if (n % k^2, 1)); \\ _Michel Marcus_, Jan 31 2021

%o (Python)

%o from sympy import divisor_count, integer_nthroot

%o from sympy.ntheory.factor_ import core

%o def A338236(n):

%o return integer_nthroot(n,2)[0]-divisor_count(integer_nthroot(n//core(n,2),2)[0]) # _Chai Wah Wu_, Jan 31 2021

%Y Cf. A000005, A000196, A007913, A046951.

%Y Cf. A338228, A338231, A338233, A338234, A368820.

%K nonn,easy

%O 1,10

%A _Wesley Ivan Hurt_, Jan 30 2021