Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #19 Jul 06 2023 09:49:01
%S 2,3,14,5,22,7,39,34,38,11,46,13,115,58,62,17,155,19,111,82,86,23,94,
%T 141,235,106,159,29,118,31,183,305,134,201,142,37,219,365,158,41,166,
%U 43,415,178,267,47,623,194,291,202,206,53,214,218,327,226,339,59,791,61
%N Least number k such that the floor of the average of the distinct prime factors of k is n, or -1 if no such number exists.
%C All terms are squarefree. - _Jon E. Schoenfield_, Jul 02 2023
%F a(p) = p for prime p. - _David A. Corneth_, Jul 02 2023
%e a(4) = 14, because 14 = 2 * 7, floor((2 + 7) / 2) = 4, and no lesser number satisfies this.
%t seq[len_, kmax_] := Module[{s = Table[0, {len}], c = 0, k = 2, i}, While[c < len && k < kmax, i = Floor[Mean[FactorInteger[k][[;; , 1]]]] - 1; If[i <= len && s[[i]] == 0, c++; s[[i]] = k]; k++]; s]; seq[60, 1000] (* _Amiram Eldar_, Jul 02 2023 *)
%o (PARI) f(n) = my(p = factor(n)[, 1]); vecsum(p)\#p; \\ A363895
%o a(n) = my(k=2); while (f(k) != n, k++); k; \\ _Michel Marcus_, Jul 02 2023
%Y Cf. A363895.
%K nonn
%O 2,1
%A _Jean-Marc Rebert_, Jul 02 2023