OFFSET
1,3
COMMENTS
By the divisor function and the fundamental theorem of arithmetic, the triangle T(n,k) in A251683 gives the number of positive integers with n divisors and k given prime factors; since these k primes can be chosen from those <= n, in the formula section T(n,k) is weighted by binomial(pi(n), k).
This sequence extends the prime counting function to all integers. On a prime p, a(p) matches pi(p) (the number of primes up to p). For prime-indexed primes (A006450), the values are themselves prime; in fact a(p)=k when p is the k-th prime. Proofs see formula section.
LINKS
Felix Huber, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Divisor Function
Eric Weisstein's World of Mathematics, Fundamental Theorem of Arithmetic
FORMULA
EXAMPLE
a(6) = 9 because 12, 18, 20, 32, 45, 50, 75, 243 and 3125 are the only 9 positive integers with 6 divisors and no prime divisor greater than 6.
a(13) = 6 because 13 is the sixth prime number.
MAPLE
# b and t by Alois P. Heinz (A251683)
with(numtheory):
b:=proc(n) option remember;
expand(x*(1+add(b(n/d), d=divisors(n) minus {1, n})))
end:
t:=n->(p->[seq(coeff(p, x, i), i=1..degree(p))])(b(n)):
A390375:=proc(n)
T:=t(n);
return max(1, add(T[k]*binomial(pi(n), k), k=1..nops(T)));
end proc:
seq(A390375(n), n=1..58);
MATHEMATICA
b[n_]:=x(1+Sum[b[n/d], {d, Divisors[n]~Complement~{1, n}}]); T[n_]:=CoefficientList[b[n]/x, x];
a[n_]:=If[n>1, Sum[T[n][[k]]*Binomial[PrimePi[n], k], {k, 1, PrimeOmega[n]}], 1]; Array[a, 58] (* James C. McMahon, Nov 08 2025 *)
PROG
(Python)
from sympy.functions.combinatorial.numbers import primepi
def A390375(n: int) -> int:
ordfact = A251683_row(n)
return max(1, sum(f * binomial(primepi(n), k + 1) for k, f in enumerate(ordfact)))
print([A390375(n) for n in range(1, 59)]) # Peter Luschny, Nov 06 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Felix Huber, Nov 05 2025
STATUS
approved
