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-3 of 3 results.

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

A382770 Number of powerful k < n such that k and n are coprime.

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, 12, 5, 7, 5, 11, 3, 12, 4, 8, 6, 13, 2
Offset: 1

Views

Author

Michael De Vlieger, Apr 05 2025

Keywords

Comments

First differs from A304574 at n = 73: a(73) = 12, A304574(n) = 11, because 72 = 2^3 * 3^2 is powerful but not a perfect power (i.e., an Achilles number in A052486).

Examples

			Let s = A001694, the sequence of powerful numbers.
a(1) = 0 since the smallest powerful number is 1 itself.
a(2) = 1 since s(1) = 1 is smaller than and coprime to 2.
a(3) = 1 since s(1) = 1 is smaller than and coprime to 3.
a(4) = 1 since s(1..2) = {1, 4}; 1 is smaller than and coprime to 4, but 4 = 4.
a(5) = 2 since s(1..2) = {1, 4}, both smaller than and coprime to 5.
a(6) = 1 since s(1..2) = {1, 4}; 1 is smaller than and coprime to 6, but gcd(4,6) > 1.
a(8) = 1 since s(1..3) = {1, 4, 8}; 1 and 4 are both smaller than and coprime to 8, but 8 = 8.
a(9) = 3 since s(1..3) = {1, 4, 8} are all smaller than and coprime to 9.
a(73) = 12 since s(1..12) = {1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 72}, all coprime to prime 73. All except 72 are perfect powers, thus A304574(73) = 11, etc.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; q = 1; rad[x_] := Times @@ FactorInteger[x][[All, 1]]; {0}~Join~Rest@ Table[Set[{c, i}, {0, 1}]; If[Divisible[n, rad[n]^2], t[q] = n; q++]; While[i < q, If[CoprimeQ[t[i], n], c++]; i++]; c, {n, nn}]
  • PARI
    a(n) = #select(x->(ispowerful(x) && gcd(x,n)==1), [1..n-1]); \\ Michel Marcus, Apr 11 2025

Formula

a(n) > 0 for n > 1, since 1 is powerful, smaller than n > 1, and coprime to n >= 1.
Showing 1-3 of 3 results.