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-6 of 6 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

A335097 Number of integers less than n with the same number of prime factors (counted with multiplicity) as n.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Oct 31 2020

Keywords

Examples

			a(10) = 3 because bigomega(10) = 2 and also bigomega(4) = bigomega(6) = bigomega(9) = 2.
		

Crossrefs

Cf. A000079 (positions of 0's), A001222, A047983, A058933, A067004, A322838, A334655.

Programs

  • Maple
    A:= NULL:
    for n from 1 to 100 do
      t:= numtheory:-bigomega(n);
      if not assigned(R[t]) then
        A:= A,0;
        R[t]:= 1;
       else
        A:= A, R[t];
        R[t]:= R[t]+1;
       fi
    od:
    A; # Robert Israel, Oct 24 2021
  • Mathematica
    Table[Length[Select[Range[n - 1], PrimeOmega[#] == PrimeOmega[n] &]], {n, 80}]
  • PARI
    a(n)={my(t=bigomega(n)); sum(k=1, n-1, bigomega(k)==t)} \\ Andrew Howroyd, Oct 31 2020
    
  • Python
    from math import prod, isqrt
    from sympy import isprime, primepi, primerange, integer_nthroot, primeomega
    def A335097(n):
        if n==1: return 0
        if isprime(n): return primepi(n)-1
        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)))-1) # Chai Wah Wu, Aug 28 2024

Formula

a(n) = |{j < n : bigomega(j) = bigomega(n)}|.
a(n) = A058933(n) - 1.

A322837 Number of positive integers less than n with fewer distinct prime factors than n.

Original entry on oeis.org

0, 1, 1, 1, 1, 5, 1, 1, 1, 8, 1, 9, 1, 10, 10, 1, 1, 12, 1, 13, 13, 13, 1, 14, 1, 15, 1, 16, 1, 29, 1, 1, 19, 19, 19, 19, 1, 20, 20, 20, 1, 40, 1, 22, 22, 22, 1, 23, 1, 24, 24, 24, 1, 25, 25, 25, 25, 25, 1, 57, 1, 27, 27, 1, 28, 62, 1, 29, 29, 65, 1, 30, 1, 31
Offset: 1

Views

Author

Gus Wiseman, Dec 28 2018

Keywords

Examples

			Column n lists the a(n) positive integers less than n with fewer distinct prime factors than n:
  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20
  ---------------------------------------------------------------------
     1  1  1  1  5  1  1  1  9   1   11  1   13  13  1   1   17  1   19
                 4           8       9       11  11          16      17
                 3           7       8       9   9           13      16
                 2           5       7       8   8           11      13
                 1           4       5       7   7           9       11
                             3       4       5   5           8       9
                             2       3       4   4           7       8
                             1       2       3   3           5       7
                                     1       2   2           4       5
                                             1   1           3       4
                                                             2       3
                                                             1       2
                                                                     1
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[n],PrimeNu[#]
    				
  • PARI
    \\ See Corneth link

A322839 Numbers n with more prime factors (counted with multiplicity) than n+1.

Original entry on oeis.org

4, 6, 8, 10, 12, 16, 18, 20, 22, 24, 28, 30, 32, 36, 40, 42, 45, 46, 48, 50, 52, 54, 56, 58, 60, 64, 66, 68, 70, 72, 76, 78, 80, 81, 82, 84, 88, 90, 92, 96, 100, 102, 104, 105, 106, 108, 110, 112, 114, 117, 120, 126, 128, 130, 132, 136, 138, 140, 144, 148, 150
Offset: 1

Views

Author

Gus Wiseman, Dec 28 2018

Keywords

Comments

First differs from A074827 in having 104.

Examples

			104 has four prime factors (2, 2, 2, 13), while 105 has only three (3, 5, 7), so 104 belongs to the sequence.
		

Crossrefs

Programs

A322841 Number of positive integers less than n with more distinct prime factors than n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 2, 0, 3, 0, 0, 5, 5, 0, 6, 0, 0, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 13, 1, 1, 1, 1, 17, 1, 1, 1, 20, 0, 21, 2, 2, 2, 24, 2, 25, 2, 2, 2, 28, 2, 2, 2, 2, 2, 33, 0, 34, 3, 3, 36, 3, 0, 38, 4, 4, 0, 41, 5, 42, 5, 5, 5, 5, 0, 47, 6, 48
Offset: 1

Views

Author

Gus Wiseman, Dec 28 2018

Keywords

Examples

			Column n lists the a(n) positive integers less than n with more distinct prime factors than n:
  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20
  ---------------------------------------------------------------------
                    6  6  6      10      12          15  15      18
                                  6      10          14  14      15
                                          6          12  12      14
                                                     10  10      12
                                                      6   6      10
                                                                  6
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; nops(numtheory[factorset](n)) end:
    a:= proc(n) option remember;
          (t-> add(`if`(b(i)>t, 1, 0), i=1..n-1))(b(n))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Dec 28 2018
  • Mathematica
    Table[Length[Select[Range[n],PrimeNu[#]>PrimeNu[n]&]],{n,100}]
  • PARI
    a(n) = my(omegan=omega(n)); sum(k=1, n-1, omega(k) > omegan); \\ Michel Marcus, Dec 29 2018
    
  • PARI
    first(n) = {my(t = 1, pp = 1, res = vector(n)); forprime(p = 2, oo, pp*=p; if(pp > n, v = vector(t); break); t++); for(i = 1, n, o = omega(i); res[i] = v[o+1]; for(j = 1, o, v[j]++)); res} \\ David A. Corneth, Dec 29 2018

A322840 Positive integers n with fewer prime factors (counted with multiplicity) than n + 1.

Original entry on oeis.org

1, 3, 5, 7, 11, 13, 15, 17, 19, 23, 26, 29, 31, 35, 37, 39, 41, 43, 47, 49, 51, 53, 55, 59, 61, 62, 63, 65, 67, 69, 71, 73, 74, 77, 79, 83, 87, 89, 91, 95, 97, 99, 101, 103, 107, 109, 111, 113, 115, 119, 123, 125, 127, 129, 131, 134, 137, 139, 143, 146, 149
Offset: 1

Views

Author

Gus Wiseman, Dec 28 2018

Keywords

Examples

			49 = 7*7 has two prime factors, while 50 = 2*5*5 has three, so 49 belongs to the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[100],PrimeOmega[#]?(#[[1]]< #[[2]]&),1,Heads->False]//Flatten (* _Harvey P. Dale, Sep 23 2021 *)
  • PARI
    isok(n) = bigomega(n) < bigomega(n+1); \\ Michel Marcus, Dec 29 2018
Showing 1-6 of 6 results.