|
|
A338228
|
|
Number of numbers less than or equal to n whose square does not divide n.
|
|
7
|
|
|
0, 1, 2, 2, 4, 5, 6, 6, 7, 9, 10, 10, 12, 13, 14, 13, 16, 16, 18, 18, 20, 21, 22, 22, 23, 25, 25, 26, 28, 29, 30, 29, 32, 33, 34, 32, 36, 37, 38, 38, 40, 41, 42, 42, 43, 45, 46, 45, 47, 48, 50, 50, 52, 52, 54, 54, 56, 57, 58, 58, 60, 61, 61, 60, 64, 65, 66, 66, 68, 69, 70, 68, 72
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n - Sum_{k=1..n} (1 - ceiling(n/k^2) + floor(n/k^2)).
|
|
EXAMPLE
|
a(3) = 2; 1^2|3, but 2^2 and 3^2 do not. So a(3) = 2.
a(4) = 2; 1^2|4 and 2^2|4 but 3^2 and 4^2 do not, So a(4) = 2.
|
|
MATHEMATICA
|
Table[Sum[Ceiling[n/k^2] - Floor[n/k^2], {k, n}], {n, 100}]
|
|
PROG
|
(PARI) a(n) = sum(k=1, 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
return n-divisor_count(integer_nthroot(n//core(n, 2), 2)[0]) # Chai Wah Wu, Feb 01 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|