cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A096917 Smallest prime factor of the n-th product of 3 distinct primes.

This page as a plain text file.
%I A096917 #21 Nov 03 2024 02:03:44
%S A096917 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 A096917 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 A096917 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 A096917 Smallest prime factor of the n-th product of 3 distinct primes.
%H A096917 Amiram Eldar, <a href="/A096917/b096917.txt">Table of n, a(n) for n = 1..10000</a>
%F A096917 a(n)*A096918(n)*A096919(n) = A007304(n).
%F A096917 a(n) < A096918(n) < A096919(n).
%F A096917 a(n) = A020639(A007304(n)).
%t A096917 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 A096917 (Python)
%o A096917 from math import isqrt
%o A096917 from sympy import primepi, primerange, integer_nthroot, primefactors
%o A096917 def A096917(n):
%o A096917     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 A096917     def bisection(f,kmin=0,kmax=1):
%o A096917         while f(kmax) > kmax: kmax <<= 1
%o A096917         while kmax-kmin > 1:
%o A096917             kmid = kmax+kmin>>1
%o A096917             if f(kmid) <= kmid:
%o A096917                 kmax = kmid
%o A096917             else:
%o A096917                 kmin = kmid
%o A096917         return kmax
%o A096917     return min(primefactors(bisection(f))) # _Chai Wah Wu_, Aug 30 2024
%Y A096917 Cf. A020639, A007304, A096918, A096919.
%K A096917 nonn
%O A096917 1,1
%A A096917 _Reinhard Zumkeller_, Jul 15 2004