OFFSET
1,5
COMMENTS
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^16, where red represents prime n, gold represents proper prime power n, green represents squarefree composite n, and blue and purple represent n that is neither squarefree nor a prime power, where purple represents a powerful n that is not a prime power. Large green dots represent composite primorials n.
FORMULA
a(n) > 0 for n > 1, since 1 is powerful, smaller than n > 1, and coprime to n >= 1.
EXAMPLE
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.
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}]
PROG
(PARI) a(n) = #select(x->(ispowerful(x) && gcd(x, n)==1), [1..n-1]); \\ Michel Marcus, Apr 11 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael De Vlieger, Apr 05 2025
STATUS
approved
