The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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)).
a(n) = n - tau(sqrt(n/A007913(n)) = n - A000005(sqrt(n/A007913(n)). - Chai Wah Wu, Feb 01 2021
a(n) = Sum_{k=1..n} sign(n mod k^2). - Wesley Ivan Hurt, May 09 2021
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
def A338228(n):
return n-divisor_count(integer_nthroot(n//core(n, 2), 2)[0]) # Chai Wah Wu, Feb 01 2021
CROSSREFS
Sequence in context: A130498 A263433 A147806 * A351782 A064574 A059015
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jan 30 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 17 03:33 EDT 2024. Contains 372577 sequences. (Running on oeis4.)