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.

A243351 Difference between 2n and the n-th squarefree number: a(n) = 2n - A005117(n).

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 4, 5, 5, 6, 7, 7, 7, 7, 8, 9, 8, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 14, 15, 13, 13, 13, 13, 14, 15, 15, 16, 15, 16, 17, 17, 18, 19, 19, 20, 19, 20, 21, 20, 21, 21, 22, 23, 23, 23, 23, 24, 25, 25, 23, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2014

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{sf=Select[Range[150],SquareFreeQ]},Table[2n-sf[[n]],{n,Length[ sf]}]] (* Harvey P. Dale, Jun 26 2021 *)
  • Python
    from math import isqrt
    from sympy import mobius
    def A243351(n):
        def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return (n<<1)-m # Chai Wah Wu, Aug 12 2024

Formula

a(n) = 2n - A005117(n).
a(n) = n - A243348(n).
a(n) ~ c * n, where c = 2 - Pi^2/6 (A152416). - Amiram Eldar, Mar 04 2024