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.

A007457 Number of (j,k): j+k=n, (j,n)=(k,n)=1, j,k squarefree.

Original entry on oeis.org

0, 1, 2, 2, 2, 2, 4, 4, 2, 2, 4, 4, 6, 4, 4, 6, 8, 6, 6, 6, 4, 8, 8, 8, 8, 8, 8, 6, 10, 8, 10, 10, 8, 12, 8, 10, 14, 12, 10, 12, 16, 10, 18, 14, 12, 14, 16, 14, 16, 14, 10, 16, 20, 14, 12, 16, 14, 20, 18, 14, 22, 20, 16, 20
Offset: 1

Views

Author

Keywords

Comments

Terms are even or 1: range = A004275. [Reinhard Zumkeller, Sep 26 2011]

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a007457 n = length [k | k <- [1..n-1], gcd k n == 1, a008966 k == 1,
                            let j = n - k, gcd j n == 1, a008966 j == 1]
    -- Reinhard Zumkeller, Sep 26 2011
    
  • Magma
    f:=func; [0] cat [#[i:i in [1..n-1]| f(i,n) and f(n-i,n) ]:n in [2..70]]; // Marius A. Burtea, Nov 19 2019
    
  • Magma
    [0] cat [&+[MoebiusMu(i*(n-i))^2:i in [1..n-1]]:n in [2..70]]; // Marius A. Burtea, Nov 19 2019
  • Maple
    with(numtheory): seq(add(mobius(i*(n-i))^2, i=1..n-1), n=1..80); # Ridouane Oudra, Nov 18 2019
  • Mathematica
    a[n_] := Count[ Table[ If[ SquareFreeQ[j] && GCD[j, n] == 1, If[k = n-j; SquareFreeQ[k] && GCD[k, n] == 1, 1]], {j, 1, n-1}], 1]; Table[a[n], {n, 1, 64}](* Jean-François Alcover, Nov 28 2011 *)

Formula

a(n) = Sum_{i=1..n-1} mu(i*(n-i))^2. - Ridouane Oudra, Nov 18 2019