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.

Showing 1-4 of 4 results.

A304574 Number of perfect powers (A001597) less than n and relatively prime to n.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 2, 1, 3, 2, 4, 1, 4, 2, 3, 2, 5, 1, 5, 2, 4, 2, 5, 1, 5, 3, 5, 4, 7, 1, 7, 4, 6, 4, 7, 2, 9, 4, 6, 3, 9, 2, 9, 4, 5, 4, 9, 2, 9, 4, 7, 5, 10, 3, 9, 4, 7, 5, 10, 2, 10, 5, 6, 5, 10, 3, 11, 5, 8, 3, 11, 3, 11, 5, 7, 5, 10, 3, 11, 4, 8, 6, 12, 2
Offset: 1

Views

Author

Gus Wiseman, May 14 2018

Keywords

Examples

			The a(33) = 6 perfect powers less than and relatively prime to 33 are {1, 4, 8, 16, 25, 32}.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[n-1],And[#==1||GCD@@FactorInteger[#][[All,2]]>1,GCD[n,#]==1]&]],{n,100}] (* Corrected by Peter Luschny, May 17 2018 *)
  • PARI
    ispow(n) = (n==1) || ispower(n);
    a(n) = #select(x->(ispow(x) && (gcd(n, x) == 1)), [1..n-1]); \\ Michel Marcus, May 17 2018
    
  • Sage
    def a(n):
        return len([k for k in (1..n-1) if k.is_perfect_power() and gcd(n,k) == 1])
    [a(n) for n in (1..84)] # Peter Luschny, May 16 2018

Extensions

a(1) = 0 corrected by Zak Seidov, May 15 2018

A304573 Number of non-perfect powers (A007916) less than n and relatively prime to n.

Original entry on oeis.org

0, 0, 1, 1, 2, 1, 4, 3, 3, 2, 6, 3, 8, 4, 5, 6, 11, 5, 13, 6, 8, 8, 17, 7, 15, 9, 13, 8, 21, 7, 23, 12, 14, 12, 17, 10, 27, 14, 18, 13, 31, 10, 33, 16, 19, 18, 37, 14, 33, 16, 25, 19, 42, 15, 31, 20, 29, 23, 48, 14, 50, 25, 30, 27, 38, 17, 55, 27, 36, 21, 59
Offset: 1

Views

Author

Gus Wiseman, May 14 2018

Keywords

Examples

			The a(21) = 8 positive integers less than and relatively prime to 21 that are not perfect powers are {2, 5, 10, 11, 13, 17, 19, 20}.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[2,n],And[GCD@@FactorInteger[#][[All,2]]==1,GCD[n,#]==1]&]],{n,50}]
  • PARI
    a(n) = sum(k=2, n-1, !ispower(k) && (gcd(n, k) == 1)); \\ Michel Marcus, May 15 2018

A304576 a(n) = Sum_{k < n, k squarefree and relatively prime to n} (-1)^(k-1).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 14 2018

Keywords

Crossrefs

Programs

  • Mathematica
    l[n_]:=Sum[(-1)^(k-1),{k,Select[Range[n],And[SquareFreeQ[#],GCD[n,#]==1]&]}];
    Table[l[n],{n,100}]
  • PARI
    a(n) = sum(k=1, n, if (issquarefree(k) && (gcd(n,k)==1), (-1)^(k-1))); \\ Michel Marcus, May 15 2018

A332685 a(n) = Sum_{k=1..n} mu(k/gcd(n, k)).

Original entry on oeis.org

1, 2, 1, 2, 0, 2, 0, 0, -1, 0, 0, 0, -1, -2, -2, -3, 0, -4, -1, -5, -4, -2, 0, -8, -3, -4, -4, -7, 0, -8, -2, -10, -5, -4, -4, -13, 0, -5, -4, -13, 1, -15, -1, -9, -10, -5, -1, -22, -4, -12, -5, -11, -1, -19, -6, -17, -6, -4, 1, -28, 0, -8, -12, -18, -6, -19, 0, -12, -5, -17
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 19 2020

Keywords

Comments

Inverse Moebius transform of A112399.

Crossrefs

Programs

  • Mathematica
    Table[Sum[MoebiusMu[k/GCD[n, k]], {k, 1, n}], {n, 1, 70}]
  • PARI
    a(n) = sum(k=1, n, moebius(k/gcd(n, k))); \\ Michel Marcus, Feb 21 2020

Formula

a(n) = Sum_{k=1..n} mu(lcm(n, k)/n).
a(n) = Sum_{d|n} A112399(d).
Showing 1-4 of 4 results.