login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A096917 Smallest prime factor of n-th product of 3 distinct primes. 7

%I #13 Aug 31 2024 01:57:29

%S 2,2,2,2,2,2,3,2,2,2,2,2,3,2,2,2,2,2,3,2,2,3,2,2,3,2,2,3,2,3,2,2,2,2,

%T 2,3,2,3,2,2,2,5,3,2,2,2,2,2,3,2,2,3,2,2,5,3,2,2,3,2,2,2,2,2,2,3,3,2,

%U 2,2,5,2,2,2,3,2,3,2,3,2,2,3,2,3,2,2,3,5,2,2,2,3,2,5,2,3,2,2,3,2,3,2

%N Smallest prime factor of n-th product of 3 distinct primes.

%C a(n)*A096918(n)*A096919(n) = A007304(n); a(n) < A096918(n) < A096919(n);

%C a(n) = A020639(A007304(n)).

%t f[n_]:=Last/@FactorInteger[n]=={1,1,1};f1[n_]:=Min[First/@FactorInteger[n]];f2[n_]:=Max[First/@FactorInteger[n]];lst={};Do[If[f[n],AppendTo[lst,f1[n]]],{n,0,7!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Apr 10 2010 *)

%o (Python)

%o from math import isqrt

%o from sympy import primepi, primerange, integer_nthroot, primefactors

%o def A096917(n):

%o def f(x): return int(n+x-sum(primepi(x//(k*m))-b for a,k in enumerate(primerange(integer_nthroot(x,3)[0]+1),1) for b,m in enumerate(primerange(k+1,isqrt(x//k)+1),a+1)))

%o def bisection(f,kmin=0,kmax=1):

%o while f(kmax) > kmax: kmax <<= 1

%o while kmax-kmin > 1:

%o kmid = kmax+kmin>>1

%o if f(kmid) <= kmid:

%o kmax = kmid

%o else:

%o kmin = kmid

%o return kmax

%o return min(primefactors(bisection(f))) # _Chai Wah Wu_, Aug 30 2024

%K nonn,changed

%O 1,1

%A _Reinhard Zumkeller_, Jul 15 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 1 17:13 EDT 2024. Contains 375592 sequences. (Running on oeis4.)