A382768 Number of k < n that are coprime to n and neither squarefree nor prime powers.
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
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..10000
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}]
Comments