cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A351520 Number of numbers <= n that are either squarefree, a divisor of n, or both.

Original entry on oeis.org

1, 2, 3, 4, 4, 5, 6, 8, 7, 7, 8, 10, 9, 10, 11, 14, 12, 14, 13, 15, 14, 15, 16, 20, 17, 17, 19, 19, 18, 19, 20, 24, 21, 22, 23, 28, 24, 25, 26, 30, 27, 28, 29, 31, 31, 30, 31, 37, 32, 33, 32, 34, 33, 37, 34, 38, 35, 36, 37, 41, 38, 39, 41, 44, 40, 41, 42, 44, 43, 44, 45, 53, 46, 47, 49
Offset: 1

Views

Author

Wesley Ivan Hurt, Feb 12 2022

Keywords

Examples

			a(10) = 7; There are 7 numbers less than or equal to 10 that are either squarefree, a divisor of 10, or both. The numbers are 1,2,3,5,6,7,10.
		

Crossrefs

Cf. A000005 (tau), A013928, A034444.

Programs

  • Maple
    f:= proc(n) nops(select(t -> n mod t = 0 or numtheory:-issqrfree(t), [$1..n])) end proc:
    map(f, [$1..100]); # Robert Israel, Dec 09 2024
  • Mathematica
    Module[{nn=80,sf},sf=Select[Range[nn],SquareFreeQ[#]&];Table[Length[Union[Select[sf,#<= n&],Divisors[n]]],{n,nn}]] (* Harvey P. Dale, Jul 03 2023 *)

Formula

a(n) = tau(n) + Sum_{k=1..n} mu(k)^2 - Sum_{d|n} mu(d)^2.
a(n) = A000005(n) + A013928(n+1) - A034444(n).