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.

A340467 a(n) is the n-th squarefree number having n prime factors.

This page as a plain text file.
%I A340467 #26 Aug 31 2024 17:50:46
%S A340467 2,10,66,462,4290,53130,903210,17687670,406816410,11125544430,
%T A340467 338431883790,11833068917670,457077357006270,20384767656323070,
%U A340467 955041577211912190,49230430891074322890,2740956243836856315270,168909608387276001835590,11054926927790884163355330
%N A340467 a(n) is the n-th squarefree number having n prime factors.
%C A340467 a(n) is the n-th product of n distinct primes.
%C A340467 All terms are even.
%C A340467 This sequence differs from A073329 which has also nonsquarefree terms.
%H A340467 Alois P. Heinz, <a href="/A340467/b340467.txt">Table of n, a(n) for n = 1..350</a>
%F A340467 a(n) = A340316(n,n).
%F A340467 a(n) = A005117(m) <=> A072047(m) = n = A340313(m).
%F A340467 A001221(a(n)) = A001222(a(n)) = n.
%F A340467 a(n) < A070826(n+1), the least odd number with exactly n distinct prime divisors.
%e A340467 a(1) = A000040(1) = 2.
%e A340467 a(2) = A006881(2) = 10.
%e A340467 a(3) = A007304(3) = 66.
%e A340467 a(4) = A046386(4) = 462.
%e A340467 a(5) = A046387(5) = 4290.
%e A340467 a(6) = A067885(6) = 53130.
%e A340467 a(7) = A123321(7) = 903210.
%e A340467 a(8) = A123322(8) = 17687670.
%e A340467 a(9) = A115343(9) = 406816410.
%e A340467 a(10) = A281222(10) = 11125544430.
%o A340467 (Python)
%o A340467 from math import isqrt, prod
%o A340467 from sympy import primerange, integer_nthroot, primepi
%o A340467 def A340467(n):
%o A340467     if n == 1: return 2
%o A340467     def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b+1,isqrt(x//c)+1),a+1)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b+1,integer_nthroot(x//c,m)[0]+1),a+1) for d in g(x,a2,b2,c*b2,m-1)))
%o A340467     def f(x): return int(n+x-sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,n)))
%o A340467     def bisection(f,kmin=0,kmax=1):
%o A340467         while f(kmax) > kmax: kmax <<= 1
%o A340467         while kmax-kmin > 1:
%o A340467             kmid = kmax+kmin>>1
%o A340467             if f(kmid) <= kmid:
%o A340467                 kmax = kmid
%o A340467             else:
%o A340467                 kmin = kmid
%o A340467         return kmax
%o A340467     return bisection(f) # _Chai Wah Wu_, Aug 31 2024
%Y A340467 Main diagonal of A340316.
%Y A340467 Cf. A001221, A001222, A005117, A070826, A072047, A073329, A101695, A340313.
%Y A340467 Cf. A000040, A006881, A007304, A046386, A046387, A067885, A123321, A123322, A115343, A281222.
%K A340467 nonn
%O A340467 1,1
%A A340467 _Alois P. Heinz_, Jan 08 2021