login
Number of integers less than n that have the same greatest prime factor as n.
1

%I #8 Feb 16 2025 08:34:07

%S 0,0,0,1,0,1,0,2,2,1,0,3,0,1,2,3,0,4,0,3,2,1,0,5,4,1,6,3,0,5,0,4,2,1,

%T 4,7,0,1,2,6,0,5,0,3,7,1,0,8,6,8,2,3,0,9,4,7,2,1,0,9,0,1,8,5,4,5,0,3,

%U 2,9,0,10,0,1,10,3,6,5,0,11,11,1,0,10,4,1,2,7,0,12

%N Number of integers less than n that have the same greatest prime factor as n.

%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/GreatestPrimeFactor.html">Greatest Prime Factor</a>

%F a(n) = |{j < n : gpf(j) = gpf(n)}|.

%F a(n) = A078899(n) - 1.

%p R:= NULL:

%p for n from 1 to 100 do p:= max(numtheory:-factorset(n)); if assigned(C[p]) then C[p]:= C[p]+1 else C[p]:= 0 fi;

%p R:= R, C[p]

%p od:R; # _Robert Israel_, Nov 07 2024

%t Table[Length[Select[Range[n - 1], FactorInteger[#][[-1, 1]] == FactorInteger[n][[-1, 1]] &]], {n, 90}]

%Y Cf. A006530, A047983, A078899, A334655, A335097, A377734.

%K nonn

%O 1,8

%A _Ilya Gutkovskiy_, Nov 05 2024