OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..4000
FORMULA
a(n) = A184677(n) - 1.
EXAMPLE
For n=3, prime(3) = 5. Then the numbers up to 5^2 = 25 that have prime factors <= 5 are 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25. So a(3) = 15.
MAPLE
A[1]:= 2: p:= 2: P:= 1:
f:= proc(n) local x, y;
x:= n;
do
y:= igcd(x, P);
x:= x/y;
if x = 1 then return true fi;
if y = 1 then return false fi
od;
end proc:
for nn from 2 to 100 do
q:= p; p:= nextprime(p); P:= P*q;
A[nn]:= A[nn-1] + p + numboccur(true, map(f, [$q^2+1 .. p^2-1]))
od:
seq(A[i], i=1..100); # Robert Israel, Apr 06 2021
MATHEMATICA
Block[{nn = 46, w}, w = Array[FactorInteger[#][[All, 1]] &, Prime[nn]^2]; Table[-1 + Count[w[[1 ;; p^2]], _?(AllTrue[#, # <= p &] &)], {p, Prime@ Range@ nn}]] (* Michael De Vlieger, Mar 13 2021 *)
PROG
(PARI) forprime(n = 2, prime(35), i = 0; for(k = 2, n^2, v = factor(k)~[1, ]; if(vecmax(v) <= n, i++)); print1(i", "))
(PARI) a(n) = my(p=prime(n)); sum(k=2, p^2, vecmax(factor(k)[, 1]) <= p); \\ Michel Marcus, Mar 03 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Dimitris Valianatos, Mar 03 2021
EXTENSIONS
Definition clarified by Robert Israel, Apr 06 2021
STATUS
approved