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.

Showing 1-3 of 3 results.

A058933 Let k be bigomega(n) (i.e., n is a k-almost-prime). a(n) = number of k-almost-primes <= n.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 4, 1, 3, 4, 5, 2, 6, 5, 6, 1, 7, 3, 8, 4, 7, 8, 9, 2, 9, 10, 5, 6, 10, 7, 11, 1, 11, 12, 13, 3, 12, 14, 15, 4, 13, 8, 14, 9, 10, 16, 15, 2, 17, 11, 18, 12, 16, 5, 19, 6, 20, 21, 17, 7, 18, 22, 13, 1, 23, 14, 19, 15, 24, 16, 20, 3, 21, 25, 17, 18, 26, 19, 22, 4, 8, 27, 23
Offset: 1

Views

Author

Naohiro Nomoto, Jan 11 2001

Keywords

Comments

Equivalently, the number of positive integers less than or equal to n with the same number of prime factors as n, counted with multiplicity. - Gus Wiseman, Dec 28 2018
There is a close relationship between a(n) and a(n^2). See A209934 for an exploratory quantification. - Peter Munn, Aug 04 2019

Examples

			3 is prime, so a(3)=2. 10 is 2-almost prime (semiprime), so a(10)=4.
From _Gus Wiseman_, Dec 28 2018: (Start)
Column n lists the a(n) positive integers less than or equal to n with the same number of prime factors as n, counted with multiplicity:
  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20
  ---------------------------------------------------------------------
  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20
        2     3  4  5     6  9   7   8   11  10  14      13  12  17  18
              2     3     4  6   5       7   9   10      11  8   13  12
                    2        4   3       5   6   9       7       11  8
                                 2       3   4   6       5       7
                                         2       4       3       5
                                                         2       3
                                                                 2
(End)
		

Crossrefs

Positions of 1's are A000079.
Equivalent sequence restricted to squarefree numbers: A340313.

Programs

  • Maple
    p:= proc() 0 end:
    a:= proc(n) option remember; local t;
          t:= numtheory[bigomega](n);
          p(t):= p(t)+1
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Oct 09 2015
  • Mathematica
    p[] = 0; a[n] := a[n] = Module[{t}, t = PrimeOmega[n]; p[t] = p[t]+1]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jan 24 2017, after Alois P. Heinz *)
  • PARI
    a(n) = my(k=bigomega(n)); sum(i=1, n, bigomega(i)==k); \\ Michel Marcus, Jun 27 2024
    
  • Python
    from math import prod, isqrt
    from sympy import isprime, primepi, primerange, integer_nthroot, primeomega
    def A058933(n):
        if n==1: return 1
        if isprime(n): return primepi(n)
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b,isqrt(x//c)+1),a)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b,integer_nthroot(x//c,m)[0]+1),a) for d in g(x,a2,b2,c*b2,m-1)))
        return int(sum(primepi(n//prod(c[1] for c in a))-a[-1][0] for a in g(n,0,1,1,primeomega(n)))) # Chai Wah Wu, Aug 28 2024

Formula

Ordinal transform of A001222 (bigomega). - Franklin T. Adams-Watters, Aug 28 2006
If a(n) < a(3^A001222(2n)) = A078843(A001222(2n)) then a(2n) = a(n), otherwise a(2n) > a(n). - Peter Munn, Aug 05 2019

Extensions

Name edited by Peter Munn, Dec 30 2022

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.

Original entry on oeis.org

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
Offset: 1

Views

Author

Peter Dolland, Jan 04 2021

Keywords

Comments

This is a permutation of all squarefree numbers > 1.

Examples

			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
		

Crossrefs

Cf. A005117 (squarefree numbers), A072047 (number of prime factors), A340313 (indexing), A078840 (all natural numbers, not only squarefree).
Columns k=1..2: A002110, A306237.
Main diagonal gives A340467.
Cf. A358677.

Programs

  • 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
    def A340316_T(n,k):
        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
        return bisection(f) # Chai Wah Wu, Aug 31 2024

Formula

A(A072047(n), A340313(n)) = A005117(n) for n > 1.

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

Original entry on oeis.org

2, 10, 66, 462, 4290, 53130, 903210, 17687670, 406816410, 11125544430, 338431883790, 11833068917670, 457077357006270, 20384767656323070, 955041577211912190, 49230430891074322890, 2740956243836856315270, 168909608387276001835590, 11054926927790884163355330
Offset: 1

Views

Author

Alois P. Heinz, Jan 08 2021

Keywords

Comments

a(n) is the n-th product of n distinct primes.
All terms are even.
This sequence differs from A073329 which has also nonsquarefree terms.

Examples

			a(1) = A000040(1) = 2.
a(2) = A006881(2) = 10.
a(3) = A007304(3) = 66.
a(4) = A046386(4) = 462.
a(5) = A046387(5) = 4290.
a(6) = A067885(6) = 53130.
a(7) = A123321(7) = 903210.
a(8) = A123322(8) = 17687670.
a(9) = A115343(9) = 406816410.
a(10) = A281222(10) = 11125544430.
		

Crossrefs

Programs

  • Python
    from math import isqrt, prod
    from sympy import primerange, integer_nthroot, primepi
    def A340467(n):
        if n == 1: return 2
        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(n+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
        return bisection(f) # Chai Wah Wu, Aug 31 2024

Formula

a(n) = A340316(n,n).
a(n) = A005117(m) <=> A072047(m) = n = A340313(m).
A001221(a(n)) = A001222(a(n)) = n.
a(n) < A070826(n+1), the least odd number with exactly n distinct prime divisors.
Showing 1-3 of 3 results.