|
|
A340316
|
|
Square array A(n,k), n>=1, k>=1, read by antidiagonals, where row n is the increasing list of all squarefree numbers with n primes.
|
|
7
|
|
|
2, 3, 6, 5, 10, 30, 7, 14, 42, 210, 11, 15, 66, 330, 2310, 13, 21, 70, 390, 2730, 30030, 17, 22, 78, 462, 3570, 39270, 510510, 19, 26, 102, 510, 3990, 43890, 570570, 9699690, 23, 33, 105, 546, 4290, 46410, 690690, 11741730, 223092870
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
This is a permutation of all squarefree numbers > 1.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
First six rows and columns:
2 3 5 7 11 13
6 10 14 15 21 22
30 42 66 70 78 102
210 330 390 462 510 546
2310 2730 3570 3990 4290 4830
30030 39270 43890 46410 51870 53130
|
|
PROG
|
(Haskell)
a340316 n k = a340316_row n !! (k-1)
a340316_row n = [a005117_list !! k | k <- [0..], a072047_list !! k == n]
(Python)
from math import prod, isqrt
from sympy import prime, primerange, integer_nthroot, primepi
if n == 1: return prime(k)
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)))
def f(x): return int(k+x-sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x, 0, 1, 1, n)))
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
|
|
CROSSREFS
|
Cf. A005117 (squarefree numbers), A072047 (number of prime factors), A340313 (indexing), A078840 (all natural numbers, not only squarefree).
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|