%I #12 Oct 23 2024 00:42:33
%S 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,16,17,17,18,19,20,20,21,22,23,
%T 24,25,25,26,26,27,28,28,29,30,30,30,31,32,32,33,33,34,35,35,35,36,37,
%U 38,38,39,39,40,41,42,42,42,42,43,43,43,44,45,46,47,47,47,47,48,48,49
%N Number of 13-smooth numbers <= n.
%C Range = primes 2 to 13. Input pn=13 in script below. Code below is much faster than the code for cross-reference. For input of n=200 13 times as fast and many times faster for larger input of n.
%H Harvey P. Dale, <a href="/A080684/b080684.txt">Table of n, a(n) for n = 1..1000</a>
%t Accumulate[Table[If[Max[FactorInteger[n][[All,1]]]<14,1,0],{n,80}]] (* _Harvey P. Dale_, Jul 23 2018 *)
%o (PARI) smoothn(n,pn) = { for(m=1,n, pr=1; forprime(p=2,pn, pr*=p; ); ct=1; for(x=1,m, f=0; forprime(y=nextprime(pn+1),floor(x), if(x%y == 0,f=1; break) ); if(gcd(x,pr)<>1,if(f==0,ct+=1; )) ); print1(ct","); ) }
%o (Python)
%o from sympy import prevprime, integer_log
%o def A080684(n):
%o def g(x,m): return sum((x//3**i).bit_length() for i in range(integer_log(x,3)[0]+1)) if m==3 else sum(g(x//(m**i),prevprime(m))for i in range(integer_log(x,m)[0]+1))
%o return g(n,13) # _Chai Wah Wu_, Oct 22 2024
%Y Cf. A071520, A051038.
%K easy,nonn
%O 1,2
%A _Cino Hilliard_, Mar 02 2003