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.

A382768 Number of k < n that are coprime to n and neither squarefree nor prime powers.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 3, 0, 1, 0, 5, 0, 5, 0, 2, 0, 3, 0, 6, 0, 2, 0, 7, 0, 7, 0, 2, 1, 9, 0, 9, 0, 5, 1, 12, 0, 8, 1, 7, 1, 14, 0, 15, 1, 5, 2, 10, 0, 16, 2, 8, 0, 17, 0, 18, 2, 5, 3, 16, 0, 20, 1, 10, 3, 21, 0
Offset: 1

Views

Author

Michael De Vlieger, Apr 04 2025

Keywords

Comments

Let s = A126706, the set of numbers that are neither squarefree nor prime powers.
Let q(k) be the number of terms in A126706 that do not exceed k. For example, q(20) = 3, since s(1..3) = {12, 18, 20}.
a(n) = 0 for n < A382248(n). Only 72 numbers n are such that a(n) = 0, with n = 2310 the largest n such that a(n) = 0.
a(A002110(k)) = 0 for k < 6.

Crossrefs

Programs

  • Magma
    nn := 120; q := 1; t := []; res := []; for n in [1..nn] do if not IsSquarefree(n) and not IsPrimePower(n) then Append(~t, n); q +:= 1; end if; c := 0; for i in [1..#t] do if GCD(t[i], n) eq 1 then c +:= 1; end if; end for; Append(~res, c); end for; res; // Vincenzo Librandi, Apr 22 2025
  • Mathematica
    nn = 120; q = 1; Table[Set[{c, i}, {0, 1}]; If[Nor[SquareFreeQ[n], PrimePowerQ[n]], t[q] = n; q++]; While[i < q, If[CoprimeQ[t[i], n], c++]; i++]; c, {n, nn}]