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.

A378086 Number of nonsquarefree numbers < prime(n).

Original entry on oeis.org

0, 0, 1, 1, 3, 4, 5, 6, 7, 11, 11, 13, 14, 14, 16, 20, 22, 23, 25, 26, 27, 29, 31, 33, 36, 39, 39, 40, 41, 42, 49, 50, 53, 53, 57, 58, 61, 63, 64, 68, 70, 71, 74, 75, 76, 77, 81, 84, 86, 87, 88, 90, 91, 97, 99, 101, 103, 104, 107, 109, 109, 113, 119, 120, 121
Offset: 1

Views

Author

Gus Wiseman, Dec 04 2024

Keywords

Examples

			The nonsquarefree numbers counted under each term begin:
  n=1: n=2: n=3: n=4: n=5: n=6: n=7: n=8: n=9: n=10: n=11: n=12:
  --------------------------------------------------------------
   .    .    4    4    9    12   16   18   20   28    28    36
                       8    9    12   16   18   27    27    32
                       4    8    9    12   16   25    25    28
                            4    8    9    12   24    24    27
                                 4    8    9    20    20    25
                                      4    8    18    18    24
                                           4    16    16    20
                                                12    12    18
                                                9     9     16
                                                8     8     12
                                                4     4     9
                                                            8
                                                            4
		

Crossrefs

For nonprime numbers we have A014689.
Restriction of A057627 to the primes.
First-differences are A061399 (zeros A068361), squarefree A061398 (zeros A068360).
For composite instead of squarefree we have A065890.
For squarefree we have A071403, differences A373198.
Greatest is A378032 (differences A378034), restriction of A378033 (differences A378036).
A000040 lists the primes, differences A001223, seconds A036263.
A005117 lists the squarefree numbers.
A013929 lists the nonsquarefree numbers, differences A078147, seconds A376593.
A070321 gives the greatest squarefree number up to n.
A112925 gives the greatest squarefree number between primes, differences A378038.
A112926 gives the least squarefree number between primes, differences A378037.
A120327 gives the least nonsquarefree number >= n, first-differences A378039.
A377783 gives the least nonsquarefree > prime(n), differences A377784.

Programs

  • Mathematica
    Table[Length[Select[Range[Prime[n]],!SquareFreeQ[#]&]],{n,100}]
  • Python
    from math import isqrt
    from sympy import prime, mobius
    def A378086(n): return (p:=prime(n))-sum(mobius(k)*(p//k**2) for k in range(1,isqrt(p)+1)) # Chai Wah Wu, Dec 05 2024

Formula

a(n) = A057627(prime(n)).