OFFSET
1,1
COMMENTS
Position of the first composite number (which is always 4) on row n of A249821. The fourth column of A249822.
According to the definition, this is the number of multiples of prime(n) below prime(n)^3 (and thus, the number of numbers below prime(n)^2) which do not have a smaller factor than prime(n). That is, the numbers remaining below prime(n)^2 after deleting all multiples of primes less than prime(n), as is done by applying the first n-1 steps of the sieve of Eratosthenes (when the first step is elimination of multiples of 2). This explains that the first differences are a(n+1)-a(n) = A050216(n)-1 for n>1, and a(n) = A054272(n)+2. - M. F. Hasler, Dec 31 2014
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..5001
FORMULA
a(1) = 1, a(n) = Sum_{d|A002110(n-1)} moebius(d)*floor(prime(n)^2/d). [Follows when A030078(n), prime(n)^3 is substituted to the similar formula given for A078898(n). Here A002110(n) gives the product of the first n primes. Because the latter is always squarefree, one could use also Liouville's lambda (A008836) instead of Moebius mu (A008683)].
Other identities. For all n >= 1:
A249821(n, a(n)) = 4.
EXAMPLE
prime(1) = 2 occurs as the least prime factor in range [1,8] for four times (all even numbers <= 8), thus a(1) = 4.
prime(2) = 3 occurs as the least prime factor in range [1,27] for five times (when n is: 3, 9, 15, 21, 27), thus a(2) = 5.
MATHEMATICA
f[n_] := Count[Range[Prime[n]^3], x_ /; Min[First /@ FactorInteger[x]] == Prime@ n]; Array[f, 16] (* Michael De Vlieger, Mar 30 2015 *)
PROG
(PARI)
A250474(n) = 3 + primepi(prime(n)^2) - n; \\ Fast implementation.
for(n=1, 5001, write("b250474.txt", n, " ", A250474(n)));
\\ The following program reflects the given sum formula, but is far from the optimal solution:
allocatemem(234567890);
A002110(n) = prod(i=1, n, prime(i));
A020639(n) = if(1==n, n, vecmin(factor(n)[, 1]));
for(n=1, 23, print1(A250474(n), ", "));
(Scheme)
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 23 2014
STATUS
approved