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-7 of 7 results.

A001222 Number of prime divisors of n counted with multiplicity (also called big omega of n, bigomega(n) or Omega(n)).

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 3, 1, 2, 2, 4, 1, 3, 1, 3, 2, 2, 1, 4, 2, 2, 3, 3, 1, 3, 1, 5, 2, 2, 2, 4, 1, 2, 2, 4, 1, 3, 1, 3, 3, 2, 1, 5, 2, 3, 2, 3, 1, 4, 2, 4, 2, 2, 1, 4, 1, 2, 3, 6, 2, 3, 1, 3, 2, 3, 1, 5, 1, 2, 3, 3, 2, 3, 1, 5, 4, 2, 1, 4, 2, 2, 2, 4, 1, 4, 2, 3, 2, 2, 2, 6, 1, 3, 3, 4, 1, 3, 1, 4, 3, 2, 1, 5, 1, 3, 2
Offset: 1

Views

Author

Keywords

Comments

Maximal number of terms in any factorization of n.
Number of prime powers (not including 1) that divide n.
Sum of exponents in prime-power factorization of n. - Daniel Forgues, Mar 29 2009
Sum_{d|n} 2^(-A001221(d) - a(n/d)) = Sum_{d|n} 2^(-a(d) - A001221(n/d)) = 1 (see Dressler and van de Lune link). - Michel Marcus, Dec 18 2012
Row sums in A067255. - Reinhard Zumkeller, Jun 11 2013
Conjecture: Let f(n) = (x+y)^a(n), and g(n) = x^a(n), and h(n) = (x+y)^A046660(n) * y^A001221(n) with x, y complex numbers and 0^0 = 1. Then f(n) = Sum_{d|n} g(d)*h(n/d). This is proved for x = 1-y (see Dressler and van de Lune link). - Werner Schulte, Feb 10 2018
Let r, s be some fixed integers. Then we have:
(1) The sequence b(n) = Dirichlet convolution of r^bigomega(n) and s^bigomega(n) is multiplicative with b(p^e) = (r^(e+1)-s^(e+1))/(r-s) for prime p and e >= 0. The case r = s leads to b(p^e) = (e+1)*r^e.
(2) The sequence c(n) = Dirichlet convolution of r^bigomega(n) and mu(n)*s^bigomega(n) is multiplicative with c(p^e) = (r-s)*r^(e-1) and c(1) = 1 for prime p and e > 0 where mu(n) = A008683(n). - Werner Schulte, Feb 20 2019
a(n) is also the length of the composition series for every solvable group of order n. - Miles Englezou, Apr 25 2024

Examples

			16=2^4, so a(16)=4; 18=2*3^2, so a(18)=3.
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 119, #12, omega(n).
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, pp. 48-57.
  • M. Kac, Statistical Independence in Probability, Analysis and Number Theory, Carus Monograph 12, Math. Assoc. Amer., 1959, see p. 64.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 92.

Crossrefs

Cf. A001221 (omega, primes counted without multiplicity), A008836 (Liouville's lambda, equal to (-1)^a(n)), A046660, A144494, A074946, A134334.
Bisections give A091304 and A073093. A086436 is essentially the same sequence. Cf. A022559 (partial sums), A066829 (parity), A092248 (parity of omega).
Sequences listing n such that a(n) = r: A000040 (r = 1), A001358 (r = 2), A014612 (r = 3), A014613 (r = 4), A014614 (r = 5), A046306 (r = 6), A046308 (r = 7), A046310 (r = 8), A046312 (r = 9), A046314 (r = 10), A069272 (r = 11), A069273 (r = 12), A069274 (r = 13), A069275 (r = 14), A069276 (r = 15), A069277 (r = 16), A069278 (r = 17), A069279 (r = 18), A069280 (r = 19), A069281 (r = 20). - Jason Kimberley, Oct 02 2011
Cf. A079149 (primes adj. to integers with at most 2 prime factors, a(n)<=2).
Cf. A027748 (without repetition).
Cf. A000010.

Programs

  • GAP
    Concatenation([0],List([2..150],n->Length(Factors(n)))); # Muniru A Asiru, Feb 21 2019
    
  • Haskell
    import Math.NumberTheory.Primes.Factorisation (factorise)
    a001222 = sum . snd . unzip . factorise
    -- Reinhard Zumkeller, Nov 28 2015
    
  • Julia
    using Nemo
    function NumberOfPrimeFactors(n; distinct=true)
        distinct && return length(factor(ZZ(n)))
        sum(e for (p, e) in factor(ZZ(n)); init=0)
    end
    println([NumberOfPrimeFactors(n, distinct=false) for n in 1:60])  # Peter Luschny, Jan 02 2024
  • Magma
    [n eq 1 select 0 else &+[p[2]: p in Factorization(n)]: n in [1..120]]; // Bruno Berselli, Nov 27 2013
    
  • Maple
    with(numtheory): seq(bigomega(n), n=1..111);
  • Mathematica
    Array[ Plus @@ Last /@ FactorInteger[ # ] &, 105]
    PrimeOmega[Range[120]] (* Harvey P. Dale, Apr 25 2011 *)
  • PARI
    vector(100,n,bigomega(n))
    
  • Python
    from sympy import primeomega
    def a(n): return primeomega(n)
    print([a(n) for n in range(1, 112)]) # Michael S. Branicky, Apr 30 2022
    
  • SageMath
    [sloane.A001222(n) for n in (1..120)] # Giuseppe Coppoletta, Jan 19 2015
    
  • SageMath
    [gp.bigomega(n) for n in range(1,131)] # G. C. Greubel, Jul 13 2024
    
  • Scheme
    (define (A001222 n) (let loop ((n n) (z 0)) (if (= 1 n) z (loop (/ n (A020639 n)) (+ 1 z)))))
    ;; Requires also A020639 for which an equally naive implementation can be found under that entry. - Antti Karttunen, Apr 12 2017
    

Formula

n = Product_(p_j^k_j) -> a(n) = Sum_(k_j).
Dirichlet g.f.: ppzeta(s)*zeta(s). Here ppzeta(s) = Sum_{p prime} Sum_{k>=1} 1/(p^k)^s. Note that ppzeta(s) = Sum_{p prime} 1/(p^s-1) and ppzeta(s) = Sum_{k>=1} primezeta(k*s). - Franklin T. Adams-Watters, Sep 11 2005
Totally additive with a(p) = 1.
a(n) = if n=1 then 0 else a(n/A020639(n)) + 1. - Reinhard Zumkeller, Feb 25 2008
a(n) = Sum_{k=1..A001221(n)} A124010(n,k). - Reinhard Zumkeller, Aug 27 2011
a(n) = A022559(n) - A022559(n-1).
G.f.: Sum_{p prime, k>=1} x^(p^k)/(1 - x^(p^k)). - Ilya Gutkovskiy, Jan 25 2017
a(n) = A091222(A091202(n)) = A000120(A156552(n)). - Antti Karttunen, circa 2004 and Mar 06 2017
a(n) >= A267116(n) >= A268387(n). - Antti Karttunen, Apr 12 2017
Sum_{k=1..n} 2^(-A001221(gcd(n,k)) - a(n/gcd(n,k)))/phi(n/gcd(n,k)) = Sum_{k=1..n} 2^(-a(gcd(n,k)) - A001221(n/gcd(n,k)))/phi(n/gcd(n,k)) = 1, where phi = A000010. - Richard L. Ollerton, May 13 2021
a(n) = a(A046523(n)) = A007814(A108951(n)) = A061395(A122111(n)) = A056239(A181819(n)) = A048675(A293442(n)). - Antti Karttunen, Apr 30 2022

Extensions

More terms from David W. Wilson

A265759 Numerators of primes-only best approximates (POBAs) to 1; see Comments.

Original entry on oeis.org

3, 2, 5, 13, 11, 19, 17, 31, 29, 43, 41, 61, 59, 73, 71, 103, 101, 109, 107, 139, 137, 151, 149, 181, 179, 193, 191, 199, 197, 229, 227, 241, 239, 271, 269, 283, 281, 313, 311, 349, 347, 421, 419, 433, 431, 463, 461, 523, 521, 571, 569, 601, 599, 619, 617
Offset: 1

Views

Author

Clark Kimberling, Dec 15 2015

Keywords

Comments

Suppose that x > 0. A fraction p/q of primes is a primes-only best approximate (POBA), and we write "p/q in B(x)", if 0 < |x - p/q| < |x - u/v| for all primes u and v such that v < q. Note that for some choices of x, there are values of q for which there are two POBAs. In these cases, the greater is placed first; e.g., B(3) = (7/2, 5/2, 17/5, 13/5, 23/7, 19/7, ...).
See A265772 and A265774 for definitions of lower POBA and upper POBA. In the following guide, for example, A001359/A006512 represents (conjecturally in some cases) the Lower POBAs p(n)/q(n) to 1, where p = A001359 and q = A006512 except for first terms in some cases. Every POBA is either a lower POBA or an upper POBA.
x Lower POBA Upper POBA POBA

Examples

			The POBAs for 1 start with 3/2, 2/3, 5/7, 13/11, 11/13, 19/17, 17/19, 31/29, 29/31, 43/41, 41/43, 61/59, 59/61. For example, if p and q are primes and q > 13, then 11/13 is closer to 1 than p/q is.
		

Crossrefs

Programs

  • Mathematica
    x = 1; z = 200; p[k_] := p[k] = Prime[k];
    t = Table[Max[Table[NextPrime[x*p[k], -1]/p[k], {k, 1, n}]], {n, 1, z}];
    d = DeleteDuplicates[t]; tL = Select[d, # > 0 &] (* lower POBA *)
    t = Table[Min[Table[NextPrime[x*p[k]]/p[k], {k, 1, n}]], {n, 1, z}];
    d = DeleteDuplicates[t]; tU = Select[d, # > 0 &] (* upper POBA *)
    v = Sort[Union[tL, tU], Abs[#1 - x] > Abs[#2 - x] &];
    b = Denominator[v]; s = Select[Range[Length[b]], b[[#]] == Min[Drop[b, # - 1]] &];
    y = Table[v[[s[[n]]]], {n, 1, Length[s]}] (* POBA, A265759/A265760 *)
    Numerator[tL]   (* A001359 *)
    Denominator[tL] (* A006512 *)
    Numerator[tU]   (* A006512 *)
    Denominator[tU] (* A001359 *)
    Numerator[y]    (* A265759 *)
    Denominator[y]  (* A265760 *)

A079148 Primes p such that p-1 has at most 2 prime factors, counted with multiplicity; i.e., primes p such that bigomega(p-1) = A001222(p-1) <= 2.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 47, 59, 83, 107, 167, 179, 227, 263, 347, 359, 383, 467, 479, 503, 563, 587, 719, 839, 863, 887, 983, 1019, 1187, 1283, 1307, 1319, 1367, 1439, 1487, 1523, 1619, 1823, 1907, 2027, 2039, 2063, 2099, 2207, 2447, 2459, 2579, 2819, 2879
Offset: 1

Views

Author

Cino Hilliard, Dec 27 2002

Keywords

Comments

Sum of reciprocals ~ 1.477.

Examples

			83 is in the sequence because 83 - 1 = 2*41 has 2 prime factors.
		

Crossrefs

Except for 2 and 3, this is identical to A005385.

Programs

  • Mathematica
    Select[Prime[Range[500]],PrimeOmega[#-1]<3&] (* Harvey P. Dale, May 17 2011 *)
  • PARI
    s(n) = {sr=0; forprime(x=2,n, if(bigomega(x-1) < 3, print1(x" "); sr+=1.0/x; ); ); print(); print(sr); } \\ Lists primes p<=n such that p-1 has at most 2 prime factors.

A079147 Primes p such that p+1 has at most 2 prime factors, counted with multiplicity; i.e., primes p such that bigomega(p+1) = A001222(p+1) <= 2.

Original entry on oeis.org

2, 3, 5, 13, 37, 61, 73, 157, 193, 277, 313, 397, 421, 457, 541, 613, 661, 673, 733, 757, 877, 997, 1093, 1153, 1201, 1213, 1237, 1321, 1381, 1453, 1621, 1657, 1753, 1873, 1933, 1993, 2017, 2137, 2341, 2473, 2557, 2593, 2797, 2857, 2917, 3061, 3217, 3253
Offset: 1

Views

Author

Cino Hilliard, Dec 27 2002

Keywords

Comments

Sum of reciprocals ~ 1.266

Examples

			157 is in the sequence because 157 + 1 = 2*79 has 2 prime factors.
		

Crossrefs

Except for 2, this is identical to A005383. Cf. A079148, A079149, A079150.

Programs

  • Mathematica
    Select[Prime[Range[500]],PrimeOmega[#+1]<3&] (* Harvey P. Dale, May 17 2018 *)
  • PARI
    s(n) = {sr=0; forprime(x=2,n, if(bigomega(x+1) < 3, print1(x" "); sr+=1.0/x; ); ); print(); print(sr); } \\ Lists primes p<=n such that p+1 has at most 2 prime factors.

A079152 Primes p such that either p-1 or p+1 has at most 3 prime factors, counted with multiplicity; i.e., primes p such that either bigomega(p-1) <= 3 or bigomega(p+1) <= 3, where bigomega(n) = A001222(n).

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 97, 101, 103, 107, 109, 113, 131, 137, 139, 149, 157, 163, 167, 173, 179, 181, 191, 193, 211, 223, 227, 229, 239, 241, 257, 263, 269, 277, 281, 283, 293, 311, 313, 317, 331
Offset: 1

Views

Author

Cino Hilliard, Dec 27 2002

Keywords

Comments

Up to 83, this is the sequence of prime numbers A000040. 89 is not in the sequence because both 89-1 = 88 = 2*2*2*11 and 89+1 = 90 = 2*3*3*5 have 4 prime factors.

Examples

			97 is in the sequence because 97+1 = 98 = 2*7*7 has 3 prime factors.
		

Crossrefs

Union of A079150 and A079151. Cf. A079149, A079153.

Programs

  • Magma
    bg:=func; [2] cat [p: p in PrimesInInterval(3,340)| bg(p-1) le 3 or bg(p+1) le 3]; // Marius A. Burtea, Jan 16 2020
  • Mathematica
    Select[Prime /@ Range[70], PrimeOmega[# - 1] <= 3 || PrimeOmega[# + 1] <= 3 & ] (* Jean-François Alcover, Jul 02 2013 *)
  • PARI
    s(n) = {sr=0; ct=0; forprime(x=2,n, if(bigomega(x-1) < 4 || bigomega(x+1) < 4, print1(x, ", "); sr+=1.0/x; ct+=1; ); ); print(); print(ct" "sr); } \\ Lists primes p<=n such that either p-1 or p+1 has at most 3 prime factors.
    

A037174 Primes which are not the sum of consecutive composite numbers.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 47, 61, 73, 107, 167, 179, 313, 347, 421, 479, 719, 863, 1153, 1213, 1283, 1307, 1523, 3467, 3733, 4007, 4621, 4787, 5087, 5113, 5413, 7523, 7703, 9817, 10333, 12347, 12539, 13381, 17027, 18553, 19717, 19813, 23399, 26003, 31873, 36097, 38833
Offset: 1

Views

Author

Keywords

Comments

It seems reasonable that a(n)/A079149(n) has an asymptote that could be estimated. - Peter Munn, Aug 21 2023

Crossrefs

Subsequence of A079149.
With {1}, the complement of A133576.
Primes that are the sum of specific numbers of consecutive composite numbers: A060254 (2), A060328 (3), A060329 (4), A060330 (5), A060331 (6), A060332 (7), A060333 (8).

Programs

  • Maple
    N:= 5000:
    primes,comps:= selectremove(isprime,{$2..N}):
    M:= nops(comps):
    X:= primes:
    for n from 1 to floor(sqrt(2*N)) do
    i:= 1;
    T:= add(comps[k],k=1..n);
    while T <= N do
    X := X minus {T};
    if i + n > M then break fi;
    T := T + comps[i+n] - comps[i];
    i := i+1;
    od;
    od:
    X;
    # Robert Israel, Jun 24 2008

Extensions

More terms from Jud McCranie, Jul 12 2000
Corrected by T. D. Noe, Aug 15 2008

A167609 Primes which are not the sum of two consecutive nonprimes A141468.

Original entry on oeis.org

2, 3, 7, 11, 13, 23, 37, 47, 59, 61, 73, 83, 107, 157, 167, 179, 193, 227, 263, 277, 313, 347, 359, 383, 397, 421, 457, 467, 479, 503, 541, 563, 587, 613, 661, 673, 719, 733, 757, 839, 863, 877, 887, 983, 997, 1019, 1093, 1153, 1187, 1201, 1213, 1237, 1283
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 07 2009

Keywords

Comments

2, and primes p such that floor(p/2) or ceiling(p/2) is prime, but not both. - Robert Israel, Jan 23 2024

Crossrefs

Programs

  • Maple
    filter:= proc(n) if n mod 4 = 1
      then isprime(n) and isprime((n+1)/2)
      else isprime(n) and isprime((n-1)/2)
    fi end proc:
    2, 3, op(select(filter, [seq(i,i=7 .. 10000, 2)])); # Robert Israel, Jan 23 2024

Extensions

Entries checked by R. J. Mathar, May 30 2010
Showing 1-7 of 7 results.