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-10 of 31 results. Next

A349338 Dirichlet convolution of A000010 (Euler totient phi) with A080339 (characteristic function of noncomposite numbers).

Original entry on oeis.org

1, 2, 3, 3, 5, 5, 7, 6, 8, 9, 11, 8, 13, 13, 14, 12, 17, 14, 19, 14, 20, 21, 23, 16, 24, 25, 24, 20, 29, 22, 31, 24, 32, 33, 34, 22, 37, 37, 38, 28, 41, 32, 43, 32, 38, 45, 47, 32, 48, 44, 50, 38, 53, 42, 54, 40, 56, 57, 59, 36, 61, 61, 54, 48, 64, 52, 67, 50, 68, 58, 71, 44, 73, 73, 68, 56, 76, 62, 79, 56, 72, 81
Offset: 1

Views

Author

Antti Karttunen, Nov 17 2021

Keywords

Comments

Möbius transform of A230593.
The number of integers k from 1 to n such that gcd(n, k) is a noncomposite number. - Amiram Eldar, Jun 21 2025

Crossrefs

Programs

  • Mathematica
    a[n_] := DivisorSum[n, Boole[!CompositeQ[#]] * EulerPhi[n/#] &]; Array[a, 100] (* Amiram Eldar, Nov 17 2021 *)
  • PARI
    A349338(n) = sumdiv(n, d, eulerphi(n/d)*((1==d)||isprime(d)));
    
  • PARI
    a(n) = {my(f = factor(n), p = f[,1], e = f[,2]); n * vecprod(apply(x -> 1-1/x, p)) * (1 + vecsum(apply(x -> 1/x, p - vector(#e, i, e[i] == 1)~)));} \\ Amiram Eldar, Jun 21 2025

Formula

a(n) = Sum_{d|n} A000010(n/d) * A080339(d).
a(n) = Sum_{d|n} A008683(n/d) * A230593(d).
a(n) = Sum_{d|n} A349435(n/d) * A348976(d).
a(n) = A000010(n) + A117494(n). [Because A117494 is the Möbius transform of A069359]
For all n >= 1, a(A005117(n)) = A348976(A005117(n)).
Sum_{k=1..n} a(k) ~ 3 * (1 + A085548) * n^2 / Pi^2. - Vaclav Kotesovec, Nov 20 2021

A317939 Numerators of sequence whose Dirichlet convolution with itself yields A080339 = A010051 (characteristic function of primes) + A063524 (1, 0, 0, 0, ...).

Original entry on oeis.org

1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 3, 1, -1, -1, -5, 1, 3, 1, 3, -1, -1, 1, -5, -1, -1, 1, 3, 1, 3, 1, 7, -1, -1, -1, -15, 1, -1, -1, -5, 1, 3, 1, 3, 3, -1, 1, 35, -1, 3, -1, 3, 1, -5, -1, -5, -1, -1, 1, -15, 1, -1, 3, -21, -1, 3, 1, 3, -1, 3, 1, 35, 1, -1, 3, 3, -1, 3, 1, 35, -5, -1, 1, -15, -1, -1, -1, -5, 1, -15, -1, 3, -1, -1, -1, -63, 1, 3, 3
Offset: 1

Views

Author

Antti Karttunen, Aug 14 2018

Keywords

Crossrefs

Cf. A010051, A080339, A046644 (denominators).

Programs

  • PARI
    up_to = 65537;
    DirSqrt(v) = {my(n=#v, u=vector(n)); u[1]=1; for(n=2, n, u[n]=(v[n]/v[1] - sumdiv(n, d, if(d>1&&dA317937.
    v317939aux = DirSqrt(vector(up_to, n, if(1==n,1,isprime(n))));
    A317939(n) = numerator(v317939aux[n]);

Formula

a(n) = numerator of f(n), where f(1) = 1, f(n) = (1/2) * (A010051(n) - Sum_{d|n, d>1, d 1.

A355939 Dirichlet inverse of A080339, characteristic function of noncomposite numbers.

Original entry on oeis.org

1, -1, -1, 1, -1, 2, -1, -1, 1, 2, -1, -3, -1, 2, 2, 1, -1, -3, -1, -3, 2, 2, -1, 4, 1, 2, -1, -3, -1, -6, -1, -1, 2, 2, 2, 6, -1, 2, 2, 4, -1, -6, -1, -3, -3, 2, -1, -5, 1, -3, 2, -3, -1, 4, 2, 4, 2, 2, -1, 12, -1, 2, -3, 1, 2, -6, -1, -3, 2, -6, -1, -10, -1, 2, -3, -3, 2, -6, -1, -5, 1, 2, -1, 12, 2, 2, 2, 4, -1, 12, 2, -3, 2, 2, 2, 6, -1, -3, -3, 6, -1, -6, -1, 4, -6
Offset: 1

Views

Author

Antti Karttunen, Jul 21 2022

Keywords

Comments

The absolute values of this sequence are given by A008480. Compare also to A355817 and A335452.

Crossrefs

Programs

  • Mathematica
    s[n_] := If[CompositeQ[n], 0, 1]; a[1] = 1; a[n_] := a[n] = -DivisorSum[n, s[n/#]*a[#] &, # < n &]; Array[a, 100] (* Amiram Eldar, Jul 21 2022 *)
  • PARI
    memoA355939 = Map();
    A355939(n) = if(1==n,1,my(v); if(mapisdefined(memoA355939,n,&v), v, v = -sumdiv(n,d,if(dA355939(d),0)); mapput(memoA355939,n,v); (v)));

Formula

a(1) = 1, and for n > 1, a(n) = -Sum_{d|n, dA010051(n/d) * a(d).
Dirichlet g.f.: 1/(1 + B(s)), where B(s) is d.g.f. of characteristic function of primes. - Vaclav Kotesovec, Jul 22 2022

A000040 The prime numbers.

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, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271
Offset: 1

Views

Author

Keywords

Comments

See A065091 for comments, formulas etc. concerning only odd primes. For all information concerning prime powers, see A000961. For contributions concerning "almost primes" see A002808.
A number p is prime if (and only if) it is greater than 1 and has no positive divisors except 1 and p.
A natural number is prime if and only if it has exactly two (positive) divisors.
A prime has exactly one proper positive divisor, 1.
The paper by Kaoru Motose starts as follows: "Let q be a prime divisor of a Mersenne number 2^p-1 where p is prime. Then p is the order of 2 (mod q). Thus p is a divisor of q - 1 and q > p. This shows that there exist infinitely many prime numbers." - Pieter Moree, Oct 14 2004
1 is not a prime, for if the primes included 1, then the factorization of a natural number n into a product of primes would not be unique, since n = n*1.
Prime(n) and pi(n) are inverse functions: A000720(a(n)) = n and a(n) is the least number m such that a(A000720(m)) = a(n). a(A000720(n)) = n if (and only if) n is prime.
Second sequence ever computed by electronic computer, on EDSAC, May 09 1949 (see Renwick link). - Russ Cox, Apr 20 2006
Every prime p > 3 is a linear combination of previous primes prime(n) with nonzero coefficients c(n) and |c(n)| < prime(n). - Amarnath Murthy, Franklin T. Adams-Watters and Joshua Zucker, May 17 2006; clarified by Chayim Lowen, Jul 17 2015
The Greek transliteration of 'Prime Number' is 'Protos Arithmos'. - Daniel Forgues, May 08 2009 [Edited by Petros Hadjicostas, Nov 18 2019]
A number n is prime if and only if it is different from zero and different from a unit and each multiple of n decomposes into factors such that n divides at least one of the factors. This applies equally to the integers (where a prime has exactly four divisors (the definition of divisors is relaxed such that they can be negative)) and the positive integers (where a prime has exactly two distinct divisors). - Peter Luschny, Oct 09 2012
Motivated by his conjecture on representations of integers by alternating sums of consecutive primes, for any positive integer n, Zhi-Wei Sun conjectured that the polynomial P_n(x) = Sum_{k=0..n} a(k+1)*x^k is irreducible over the field of rational numbers with the Galois group S_n, and moreover P_n(x) is irreducible mod a(m) for some m <= n(n+1)/2. It seems that no known criterion on irreducibility of polynomials implies this conjecture. - Zhi-Wei Sun, Mar 23 2013
Questions on a(2n) and Ramanujan primes are in A233739. - Jonathan Sondow, Dec 16 2013
From Hieronymus Fischer, Apr 02 2014: (Start)
Natural numbers such that there is exactly one base b such that the base-b alternate digital sum is 0 (see A239707).
Equivalently: Numbers p > 1 such that b = p-1 is the only base >= 1 for which the base-b alternate digital sum is 0.
Equivalently: Numbers p > 1 such that the base-b alternate digital sum is <> 0 for all bases 1 <= b < p-1. (End)
An integer n > 1 is a prime if and only if it is not the sum of positive integers in arithmetic progression with common difference 2. - Jean-Christophe Hervé, Jun 01 2014
Conjecture: Numbers having prime factors <= prime(n+1) are {k|k^f(n) mod primorial(n)=1}, where f(n) = lcm(prime(i)-1, i=1..n) = A058254(n) and primorial(n) = A002110(n). For example, numbers with no prime divisor <= prime(7) = 17 are {k|k^60 mod 30030=1}. - Gary Detlefs, Jun 07 2014
Cramer conjecture prime(n+1) - prime(n) < C log^2 prime(n) is equivalent to the inequality (log prime(n+1)/log prime(n))^n < e^C, as n tend to infinity, where C is an absolute constant. - Thomas Ordowski, Oct 06 2014
I conjecture that for any positive rational number r there are finitely many primes q_1,...,q_k such that r = Sum_{j=1..k} 1/(q_j-1). For example, 2 = 1/(2-1) + 1/(3-1) + 1/(5-1) + 1/(7-1) + 1/(13-1) with 2, 3, 5, 7 and 13 all prime, 1/7 = 1/(13-1) + 1/(29-1) + 1/(43-1) with 13, 29 and 43 all prime, and 5/7 = 1/(3-1) + 1/(7-1) + 1/(31-1) + 1/(71-1) with 3, 7, 31 and 71 all prime. - Zhi-Wei Sun, Sep 09 2015
I also conjecture that for any positive rational number r there are finitely many primes p_1,...,p_k such that r = Sum_{j=1..k} 1/(p_j+1). For example, 1 = 1/(2+1) + 1/(3+1) + 1/(5+1) + 1/(7+1) + 1/(11+1) + 1/(23+1) with 2, 3, 5, 7, 11 and 23 all prime, and 10/11 = 1/(2+1) + 1/(3+1) + 1/(5+1) + 1/(7+1) + 1/(43+1) + 1/(131+1) + 1/(263+1) with 2, 3, 5, 7, 43, 131 and 263 all prime. - Zhi-Wei Sun, Sep 13 2015
Numbers k such that ((k-2)!!)^2 == +-1 (mod k). - Thomas Ordowski, Aug 27 2016
Does not satisfy Benford's law [Diaconis, 1977; Cohen-Katz, 1984; Berger-Hill, 2017]. - N. J. A. Sloane, Feb 07 2017
Prime numbers are the integer roots of 1 - sin(Pi*Gamma(s)/s)/sin(Pi/s). - Peter Luschny, Feb 23 2018
Conjecture: log log a(n+1) - log log a(n) < 1/n. - Thomas Ordowski, Feb 17 2023

Examples

			From _David A. Corneth_, Oct 22 2024: (Start)
7 is a prime number as it has exactly two divisors, 1 and 7.
8 is not a prime number as it does not have exactly two divisors (it has 1, 2, 4 and 8 as divisors though it is sufficient to find one other divisor than 1 and 8)
55 is not a prime number as it does not have exactly two divisors. One other divisor than 1 and 55 is 5.
59 is a prime number as it has exactly two divisors; 1 and 59. (End)
		

References

  • M. Aigner and G. M. Ziegler, Proofs from The Book, Springer-Verlag, Berlin, 2nd. ed., 2001; see p. 3.
  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 2.
  • E. Bach and Jeffrey Shallit, Algorithmic Number Theory, I, Chaps. 8, 9.
  • D. M. Bressoud, Factorization and Primality Testing, Springer-Verlag NY 1989.
  • M. Cipolla, "La determinazione asintotica dell'n-mo numero primo.", Rend. d. R. Acc. di sc. fis. e mat. di Napoli, s. 3, VIII (1902), pp. 132-166.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 127-149.
  • R. Crandall and C. Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 1.
  • Martin Davis, "Algorithms, Equations, and Logic", pp. 4-15 of S. Barry Cooper and Andrew Hodges, Eds., "The Once and Future Turing: Computing the World", Cambridge 2016.
  • J.-P. Delahaye, Merveilleux nombres premiers, Pour la Science-Belin Paris, 2000.
  • J.-P. Delahaye, Savoir si un nombre est premier: facile, Pour La Science, 303(1) 2003, pp. 98-102.
  • M. Dietzfelbinger, Primality Testing in Polynomial Time, Springer NY 2004.
  • M. du Sautoy, The Music of the Primes, Fourth Estate / HarperCollins, 2003; see p. 5.
  • J. Elie, "L'algorithme AKS", in 'Quadrature', No. 60, pp. 22-32, 2006 EDP-sciences, Les Ulis (France);
  • W. & F. Ellison, Prime Numbers, Hermann Paris 1985
  • T. Estermann, Introduction to Modern Prime Number Theory, Camb. Univ. Press, 1969.
  • J. M. Gandhi, Formulae for the nth prime. Proc. Washington State Univ. Conf. on Number Theory, 96-106. Wash. St. Univ., Pullman, Wash., 1971.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §3.2 Prime Numbers, pp. 77-78.
  • R. K. Guy, Unsolved Problems Number Theory, Section A.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 2.
  • Peter Hilton and Jean Pedersen, A Mathematical Tapestry: Demonstrating the Beautiful Unity of Mathematics, Cambridge University Press, 2010, pp. (260-264).
  • H. D. Huskey, Derrick Henry Lehmer [1905-1991]. IEEE Ann. Hist. Comput. 17 (1995), no. 2, 64-68. Math. Rev. 96b:01035, cf. http://www.ams.org/mathscinet-getitem?mr=1336709
  • M. N. Huxley, The Distribution of Prime Numbers, Oxford Univ. Press, 1972.
  • D. S. Jandu, Prime Numbers And Factorization, Infinite Bandwidth Publishing, N. Hollywood CA 2007.
  • E. Landau, Handbuch der Lehre von der Verteilung der Primzahlen, Chelsea, NY, 1974.
  • D. H. Lehmer, The sieve problem for all-purpose computers. Math. Tables and Other Aids to Computation, Math. Tables and Other Aids to Computation, 7, (1953). 6-14. Math. Rev. 14:691e
  • D. N. Lehmer, "List of Prime Numbers from 1 to 10,006,721", Carnegie Institute, Washington, D.C. 1909.
  • W. J. LeVeque, Topics in Number Theory. Addison-Wesley, Reading, MA, 2 vols., 1956, Vol. 1, Chap. 6.
  • H. Lifchitz, Table des nombres premiers de 0 à 20 millions (Tomes I & II), Albert Blanchard, Paris 1971.
  • R. F. Lukes, C. D. Patterson and H. C. Williams, Numerical sieving devices: their history and some applications. Nieuw Arch. Wisk. (4) 13 (1995), no. 1, 113-139. Math. Rev. 96m:11082, cf http://www.ams.org/mathscinet-getitem?mr=96m:11082
  • P. Ribenboim, The New Book of Prime Number Records, Springer-Verlag NY 1995.
  • P. Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004.
  • H. Riesel, Prime Numbers and Computer Methods for Factorization, Birkhäuser Boston, Cambridge MA 1994.
  • B. Rittaud, "31415879. Ce nombre est-il premier?" ['Is this number prime?'], La Recherche, Vol. 361, pp. 70-73, Feb 15 2003, Paris.
  • D. Shanks, Solved and Unsolved Problems in Number Theory, 2nd. ed., Chelsea, 1978, Chap. 1.
  • 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, pages 107-119.
  • D. Wells, Prime Numbers: The Most Mysterious Figures In Math, J. Wiley NY 2005.
  • H. C. Williams and Jeffrey Shallit, Factoring integers before computers. Mathematics of Computation 1943-1993: a half-century of computational mathematics (Vancouver, BC, 1993), 481-531, Proc. Sympos. Appl. Math., 48, AMS, Providence, RI, 1994. Math. Rev. 95m:11143

Crossrefs

For is_prime and next_prime, see A010051 and A151800.
Cf. A000720 ("pi"), A001223 (differences between primes), A002476, A002808, A003627, A006879, A006880, A008578, A080339, A233588.
Cf. primes in lexicographic order: A210757, A210758, A210759, A210760, A210761.
Cf. A003558, A179480 (relating to the Quasi-order theorem of Hilton and Pedersen).
Boustrophedon transforms: A000747, A000732, A230953.
a(2n) = A104272(n) - A233739(n).
Related sequences:
Primes (p) and composites (c): A002808, A000720, A065855.
Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954.
Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759.

Programs

  • GAP
    A000040:=Filtered([1..10^5],IsPrime); # Muniru A Asiru, Sep 04 2017
    
  • Haskell
    -- See also Haskell Wiki Link.
    import Data.List (genericIndex)
    a000040 n = genericIndex a000040_list (n - 1)
    a000040_list = base ++ larger where
    base = [2,3,5,7,11,13,17]
    larger = p : filter prime more
    prime n = all ((> 0) . mod n) $ takeWhile (\x -> x*x <= n) larger
    _ : p : more = roll $ makeWheels base
    roll (Wheel n rs) = [n * k + r | k <- [0..], r <- rs]
    makeWheels = foldl nextSize (Wheel 1 [1])
    nextSize (Wheel size bs) p = Wheel (size * p)
    [r | k <- [0..p-1], b <- bs, let r = size*k+b, mod r p > 0]
    data Wheel = Wheel Integer [Integer]
    -- Reinhard Zumkeller, Apr 07 2014
    
  • Magma
    [n : n in [2..500] | IsPrime(n)];
    
  • Magma
    a := func< n | NthPrime(n) >;
    
  • Maple
    A000040 := n->ithprime(n); [ seq(ithprime(i),i=1..100) ];
    # For illustration purposes only:
    isPrime := s -> is(1 = sin(Pi*GAMMA(s)/s)/sin(Pi/s)):
    select(isPrime, [$2..100]); # Peter Luschny, Feb 23 2018
  • Mathematica
    Prime[Range[60]]
  • Maxima
    A000040(n) := block(
    if n = 1 then return(2),
    return( next_prime(A000040(n-1)))
    )$ /* recursive, to be replaced if possible - R. J. Mathar, Feb 27 2012 */
    
  • PARI
    {a(n) = if( n<1, 0, prime(n))};
    
  • PARI
    /* The following functions provide asymptotic approximations, one based on the asymptotic formula cited above (slight overestimate for n > 10^8), the other one based on pi(x) ~ li(x) = Ei(log(x)) (slight underestimate): */
    prime1(n)=n*(log(n)+log(log(n))-1+(log(log(n))-2)/log(n)-((log(log(n))-6)*log(log(n))+11)/log(n)^2/2)
    prime2(n)=solve(X=n*log(n)/2,2*n*log(n),real(eint1(-log(X)))+n)
    \\ M. F. Hasler, Oct 21 2013
    
  • PARI
    forprime(p=2, 10^3, print1(p, ", ")) \\ Felix Fröhlich, Jun 30 2014
    
  • PARI
    primes(10^5) \\ Altug Alkan, Mar 26 2018
    
  • Python
    from sympy import primerange
    print(list(primerange(2, 272))) # Michael S. Branicky, Apr 30 2022
  • Sage
    a = sloane.A000040
    a.list(58)  # Jaap Spies, 2007
    
  • Sage
    prime_range(1, 300)  # Zerinvary Lajos, May 27 2009
    

Formula

The prime number theorem is the statement that a(n) ~ n * log n as n -> infinity (Hardy and Wright, page 10).
For n >= 2, n*(log n + log log n - 3/2) < a(n); for n >= 20, a(n) < n*(log n + log log n - 1/2). [Rosser and Schoenfeld]
For all n, a(n) > n log n. [Rosser]
n log(n) + n (log log n - 1) < a(n) < n log n + n log log n for n >= 6. [Dusart, quoted in the Wikipedia article]
a(n) = n log n + n log log n + (n/log n)*(log log n - log n - 2) + O( n (log log n)^2/ (log n)^2). [Cipolla, see also Cesàro or the "Prime number theorem" Wikipedia article for more terms in the expansion]
a(n) = 2 + Sum_{k = 2..floor(2n*log(n)+2)} (1-floor(pi(k)/n)), for n > 1, where the formula for pi(k) is given in A000720 (Ruiz and Sondow 2002). - Jonathan Sondow, Mar 06 2004
I conjecture that Sum_{i>=1} (1/(prime(i)*log(prime(i)))) = Pi/2 = 1.570796327...; Sum_{i=1..100000} (1/(prime(i)*log(prime(i)))) = 1.565585514... It converges very slowly. - Miklos Kristof, Feb 12 2007
The last conjecture has been discussed by the math.research newsgroup recently. The sum, which is greater than Pi/2, is shown in sequence A137245. - T. D. Noe, Jan 13 2009
A000005(a(n)) = 2; A002033(a(n+1)) = 1. - Juri-Stepan Gerasimov, Oct 17 2009
A001222(a(n)) = 1. - Juri-Stepan Gerasimov, Nov 10 2009
From Gary Detlefs, Sep 10 2010: (Start)
Conjecture:
a(n) = {n| n! mod n^2 = n(n-1)}, n <> 4.
a(n) = {n| n!*h(n) mod n = n-1}, n <> 4, where h(n) = Sum_{k=1..n} 1/k. (End)
For n = 1..15, a(n) = p + abs(p-3/2) + 1/2, where p = m + int((m-3)/2), and m = n + int((n-2)/8) + int((n-4)/8). - Timothy Hopper, Oct 23 2010
a(2n) <= A104272(n) - 2 for n > 1, and a(2n) ~ A104272(n) as n -> infinity. - Jonathan Sondow, Dec 16 2013
Conjecture: Sequence = {5 and n <> 5| ( Fibonacci(n) mod n = 1 or Fibonacci(n) mod n = n - 1) and 2^(n-1) mod n = 1}. - Gary Detlefs, May 25 2014
Conjecture: Sequence = {5 and n <> 5| ( Fibonacci(n) mod n = 1 or Fibonacci(n) mod n = n - 1) and 2^(3*n) mod 3*n = 8}. - Gary Detlefs, May 28 2014
Satisfies a(n) = 2*n + Sum_{k=1..(a(n)-1)} cot(k*Pi/a(n))*sin(2*k*n^a(n)*Pi/a(n)). - Ilya Gutkovskiy, Jun 29 2016
Sum_{n>=1} 1/a(n)^s = P(s), where P(s) is the prime zeta function. - Eric W. Weisstein, Nov 08 2016
a(n) = floor(1 - log(-1/2 + Sum_{ d | A002110(n-1) } mu(d)/(2^d-1))/log(2)) where mu(d) = A008683(d) [Ghandi, 1971] (see Ribenboim). Golomb gave a proof in 1974: Give each positive integer a probability of W(n) = 1/2^n, then the probability M(d) of the integer multiple of number d equals 1/(2^d-1). Suppose Q = a(1)*a(2)*...*a(n-1) = A002110(n-1), then the probability of random integers that are mutually prime with Q is Sum_{ d | Q } mu(d)*M(d) = Sum_{ d | Q } mu(d)/(2^d-1) = Sum_{ gcd(m, Q) = 1 } W(m) = 1/2 + 1/2^a(n) + 1/2^a(n+1) + 1/2^a(n+2) + ... So ((Sum_{ d | Q } mu(d)/(2^d-1)) - 1/2)*2^a(n) = 1 + x(n), which means that a(n) is the only integer so that 1 < ((Sum_{ d | Q } mu(d)/(2^d-1)) - 1/2)*2^a(n) < 2. - Jinyuan Wang, Apr 08 2019
Conjecture: n * (log(n)+log(log(n))-1+((log(log(n))-A)/log(n))) is asymptotic to a(n) if and only if A=2. - Alain Rocchelli, Feb 12 2025
From Stefano Spezia, Apr 13 2025: (Start)
a(n) = 1 + Sum_{m=1..2^n} floor(floor(n/Sum_{j=1..m} A080339(j))^(1/n)) [Willans, 1964].
a(n) = 1 + Sum_{m=1..2^n} floor(floor(n/(1 + A000720(m)))^(1/n)) [Willans, 1964]. (End)

A008480 Number of ordered prime factorizations of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 2, 1, 1, 3, 1, 3, 2, 2, 1, 4, 1, 2, 1, 3, 1, 6, 1, 1, 2, 2, 2, 6, 1, 2, 2, 4, 1, 6, 1, 3, 3, 2, 1, 5, 1, 3, 2, 3, 1, 4, 2, 4, 2, 2, 1, 12, 1, 2, 3, 1, 2, 6, 1, 3, 2, 6, 1, 10, 1, 2, 3, 3, 2, 6, 1, 5, 1, 2, 1, 12, 2, 2, 2, 4, 1, 12, 2, 3, 2, 2, 2, 6, 1, 3, 3, 6, 1
Offset: 1

Views

Author

Keywords

Comments

a(n) depends only on the prime signature of n (cf. A025487). So a(24) = a(375) since 24 = 2^3 * 3 and 375 = 3 * 5^3 both have prime signature (3,1).
Multinomial coefficients in prime factorization order. - Max Alekseyev, Nov 07 2006
The Dirichlet inverse is given by A080339, negating all but the A080339(1) element in A080339. - R. J. Mathar, Jul 15 2010
Number of (distinct) permutations of the multiset of prime factors. - Joerg Arndt, Feb 17 2015
Number of not divisible chains in the divisor lattice of n. - Peter Luschny, Jun 15 2013

References

  • A. Knopfmacher, J. Knopfmacher, and R. Warlimont, "Ordered factorizations for integers and arithmetical semigroups", in Advances in Number Theory, (Proc. 3rd Conf. Canadian Number Theory Assoc., 1991), Clarendon Press, Oxford, 1993, pp. 151-165.
  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 292-295.

Crossrefs

Cf. A124010, record values and where they occur: A260987, A260633.
Absolute values of A355939.

Programs

  • Haskell
    a008480 n = foldl div (a000142 $ sum es) (map a000142 es)
                where es = a124010_row n
    -- Reinhard Zumkeller, Nov 18 2015
    
  • Maple
    a:= n-> (l-> add(i, i=l)!/mul(i!, i=l))(map(i-> i[2], ifactors(n)[2])):
    seq(a(n), n=1..100);  # Alois P. Heinz, May 26 2018
  • Mathematica
    Prepend[ Array[ Multinomial @@ Last[ Transpose[ FactorInteger[ # ] ] ]&, 100, 2 ], 1 ]
    (* Second program: *)
    a[n_] := With[{ee = FactorInteger[n][[All, 2]]}, Total[ee]!/Times @@ (ee!)]; Array[a, 101] (* Jean-François Alcover, Sep 15 2019 *)
  • PARI
    a(n)={my(sig=factor(n)[,2]); vecsum(sig)!/vecprod(apply(k->k!, sig))} \\ Andrew Howroyd, Nov 17 2018
    
  • Python
    from math import prod, factorial
    from sympy import factorint
    def A008480(n): return factorial(sum(f:=factorint(n).values()))//prod(map(factorial,f)) # Chai Wah Wu, Aug 05 2023
  • Sage
    def A008480(n):
        S = [s[1] for s in factor(n)]
        return factorial(sum(S)) // prod(factorial(s) for s in S)
    [A008480(n) for n in (1..101)]  # Peter Luschny, Jun 15 2013
    

Formula

If n = Product (p_j^k_j) then a(n) = ( Sum (k_j) )! / Product (k_j !).
Dirichlet g.f.: 1/(1-B(s)) where B(s) is D.g.f. of characteristic function of primes.
a(p^k) = 1 if p is a prime.
a(A002110(n)) = A000142(n) = n!.
a(n) = A050382(A101296(n)). - R. J. Mathar, May 26 2017
a(n) = 1 <=> n in { A000961 }. - Alois P. Heinz, May 26 2018
G.f. A(x) satisfies: A(x) = x + A(x^2) + A(x^3) + A(x^5) + ... + A(x^prime(k)) + ... - Ilya Gutkovskiy, May 10 2019
a(n) = C(k, n) for k = A001222(n) where C(k, n) is defined as the k-fold Dirichlet convolution of A001221(n) with itself, and where C(0, n) is the multiplicative identity with respect to Dirichlet convolution.
The average order of a(n) is asymptotic (up to an absolute constant) to 2A sqrt(2*Pi) log(n) / sqrt(log(log(n))) for some absolute constant A > 0. - Maxie D. Schmidt, May 28 2021
The sums of a(n) for n <= x and k >= 1 such that A001222(n)=k have asymptotic order of the form x*(log(log(x)))^(k+1/2) / ((2k+1) * (k-1)!). - Maxie D. Schmidt, Feb 12 2021
Other DGFs include: (1+P(s))^(-1) in terms of the prime zeta function for Re(s) > 1 where the + version weights the sequence by A008836(n), see the reference by Fröberg on P(s). - Maxie D. Schmidt, Feb 12 2021
The bivariate DGF (1+zP(s))^(-1) has coefficients a(n) / n^s (-1)^(A001221(n)) z^(A001222(n)) for Re(s) > 1 and 0 < |z| < 2 - Maxie D. Schmidt, Feb 12 2021
The distribution of the distinct values of the sequence for n<=x as x->infinity satisfy a CLT-type Erdős-Kac theorem analog proved by M. D. Schmidt, 2021. - Maxie D. Schmidt, Feb 12 2021
a(n) = abs(A355939(n)). - Antti Karttunen and Vaclav Kotesovec, Jul 22 2022
a(n) = A130675(n)/A112624(n). - Amiram Eldar, Mar 08 2024

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Jun 17 2007

A046644 From square root of Riemann zeta function: form Dirichlet series Sum b_n/n^s whose square is zeta function; sequence gives denominator of b_n.

Original entry on oeis.org

1, 2, 2, 8, 2, 4, 2, 16, 8, 4, 2, 16, 2, 4, 4, 128, 2, 16, 2, 16, 4, 4, 2, 32, 8, 4, 16, 16, 2, 8, 2, 256, 4, 4, 4, 64, 2, 4, 4, 32, 2, 8, 2, 16, 16, 4, 2, 256, 8, 16, 4, 16, 2, 32, 4, 32, 4, 4, 2, 32, 2, 4, 16, 1024, 4, 8, 2, 16, 4, 8, 2, 128, 2, 4, 16, 16, 4, 8
Offset: 1

Views

Author

Keywords

Comments

From Antti Karttunen, Aug 21 2018: (Start)
a(n) is the denominator of any rational-valued sequence f(n) which has been defined as f(n) = (1/2) * (b(n) - Sum_{d|n, d>1, d
Proof:
Proof is by induction. We assume as our induction hypothesis that the given multiplicative formula for A046644 (resp. additive formula for A046645) holds for all proper divisors d|n, dA046645(p) = 1. [Remark: for squares of primes, f(p^2) = (4*b(p^2) - 1)/8, thus a(p^2) = 8.]
First we note that A005187(x+y) <= A005187(x) + A005187(y), with equivalence attained only when A004198(x,y) = 0, that is, when x and y do not have any 1-bits in the shared positions. Let m = Sum_{e} A005187(e), with e ranging over the exponents in prime factorization of n.
For [case A] any n in A268388 it happens that only when d (and thus also n/d) are infinitary divisors of n will Sum_{e} A005187(e) [where e now ranges over the union of multisets of exponents in the prime factorizations of d and n/d] attain value m, which is the maximum possible for such sums computed for all divisor pairs d and n/d. For any n in A268388, A037445(n) = 2^k, k >= 2, thus A037445(n) - 2 = 2 mod 4 (excluding 1 and n from the count, thus -2). Thus, in the recursive formula above, the maximal denominator that occurs in the sum is 2^m which occurs k times, with k being an even number, but not a multiple of 4, thus the factor (1/2) in the front of the whole sum will ensure that the denominator of the whole expression is 2^m [which thus is equal to 2^A046645(n) = a(n)].
On the other hand [case B], for squares in A050376 (A082522, numbers of the form p^(2^k) with p prime and k>0), all the sums A005187(x)+A005187(y), where x+y = 2^k, 0 < x <= y < 2^k are less than A005187(2^k), thus it is the lonely "middle pair" f(p^(2^(k-1))) * f(p^(2^(k-1))) among all the pairs f(d)*f(n/d), 1 < d < n = p^(2^k) which yields the maximal denominator. Furthermore, as it occurs an odd number of times (only once), the common factor (1/2) for the whole sum will increase the exponent of 2 in denominator by one, which will be (2*A005187(2^(k-1))) + 1 = A005187(2^k) = A046645(p^(2^k)).
(End)
From Antti Karttunen, Aug 21 2018: (Start)
The following list gives a few such pairs num(n), b(n) for which b(n) is Dirichlet convolution of num(n)/a(n). Here ε stands for sequence A063524 (1, 0, 0, ...).
Numerators Dirichlet convolution of numerator(n)/a(n) yields
------- -----------
(End)
This sequence gives an upper bound for the denominators of any rational-valued sequence obtained as the "Dirichlet Square Root" of any integer-valued sequence. - Andrew Howroyd, Aug 23 2018

Crossrefs

See A046643 for more details. See also A046645, A317940.
Cf. A299150, A299152, A317832, A317926, A317932, A317934 (for denominator sequences of other similar constructions).

Programs

Formula

From Antti Karttunen, Jul 08 2017: (Start)
Multiplicative with a(p^n) = 2^A005187(n).
a(1) = 1; for n > 1, a(n) = A000079(A005187(A067029(n))) * a(A028234(n)).
a(n) = A000079(A046645(n)).
(End)
Sum_{j=1..n} A046643(j)/A046644(j) ~ n / sqrt(Pi*log(n)) * (1 + (1 - gamma/2)/(2*log(n))), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, May 04 2025

A036234 Number of primes <= n, if 1 is counted as a prime.

Original entry on oeis.org

1, 2, 3, 3, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20
Offset: 1

Keywords

Comments

This sequence is the largest nondecreasing sequence a(n) such that a(Prime(n)-1) = n. - Tanya Khovanova, Jun 20 2007
Partial sums of A080339. - Jaroslav Krizek, Mar 23 2009
Let G(n) be the graph whose vertices represent integers 1 through n, and where vertices a and b are adjacent iff gcd(a,b)>1. Then a(n) is the independence number of G(n). - Aaron Dunigan AtLee, May 23 2009
a(1)=1; a(n)= max[A061395(n), A061395(n-1)]. - Jacques ALARDET, Dec 28 2011
It appears that a(n) is the minimal index i for which binomial(k*prime(i), prime(i)) mod prime(i) = k. For example, binomial(11*prime(n), prime(n)) mod prime(n) produces the sequence 1,2,1,4,0,11,11,11,11 and a(11)=6. It also appears that binomial(k*prime(a(n)-1), prime(a(n)-1)) mod prime(a(n)-1) = 0 iff k is prime. - Gary Detlefs, Aug 05 2013
a(n) is the number of noncomposite numbers <= n. The noncomposite number are in A008578. - Omar E. Pol, Aug 31 2013
Number of distinct terms in n-th row of the triangle in A080786. - Reinhard Zumkeller, Sep 10 2013

Crossrefs

Programs

Formula

a(n) = A000720(n) + 1. - Jaroslav Krizek, Mar 23 2009

A080355 a(1)=1; thereafter, a(n+1) = a(n) + 2^(prime(n)-1).

Original entry on oeis.org

1, 3, 7, 23, 87, 1111, 5207, 70743, 332887, 4527191, 272962647, 1346704471, 70066181207, 1169577808983, 5567624320087, 75936368497751, 4579535995868247, 292809912147579991, 1445731416754426967, 75232707711592633431, 1255824328429003936855, 5978190811298649150551
Offset: 1

Author

N. J. A. Sloane, based on information supplied by Artur Jasinski, Mar 21 2003

Keywords

Comments

Original name: a(1)=1; for n>1, a(n) = a(n-1) + 2^(j-1), where j = prime(n-1) is position of n-th 1 in A080339.
Or, take an initial segment of A080339, stopping at the n-th 1, reverse and interpret as a binary number. E.g., to get the 4th term: 11101 -> 10111 = 23, so a(4) = 23.
Indices of noncomposite terms in the sequence are 1, 2, 3, 4, 9, 310, 418, .... Next term (i.e., index of a prime), if it exists, is > 2000. See also post to SeqFan list by Tomasz Ordowski. - M. F. Hasler, Oct 30 2018

Crossrefs

Cf. A076793.

Programs

  • Magma
    [n le 1 select 1 else Self(n-1) + 2^(NthPrime(n-1)-1): n in [1..25]]; // Vincenzo Librandi, Oct 31 2018
  • Maple
    a:=n->1+add(2^(ithprime(k)-1),k=1..n-1): seq(a(n),n=1..25); # Muniru A Asiru, Oct 31 2018
  • Mathematica
    RecurrenceTable[{a[1]==1, a[n] == 2^(Prime[n-1] - 1) + a[n-1]}, a, {n, 25}] (* Vincenzo Librandi, Oct 31 2018 *)
    nxt[{n_,a_}]:={n+1,a+2^(Prime[n]-1)}; NestList[nxt,{1,1},30][[All,2]] (* Harvey P. Dale, Aug 07 2019 *)
  • PARI
    apply( A080355(n)=1+sum(i=1,n-1,2^(prime(i)-1)), [1..50]) \\ M. F. Hasler, Oct 30 2018
    

Formula

a(n) = 1 + Sum_{k=1..n-1} 2^(prime(k)-1).
a(n) = A076793(n-1) / 2 + 1. - Georg Fischer, Aug 12 2023

Extensions

More terms from Vladeta Jovovic, Mar 26 2003

A379312 Positive integers whose prime indices include a unique 1 or prime number.

Original entry on oeis.org

2, 3, 5, 11, 14, 17, 21, 26, 31, 35, 38, 39, 41, 46, 57, 58, 59, 65, 67, 69, 74, 77, 83, 86, 87, 94, 95, 98, 106, 109, 111, 115, 119, 122, 127, 129, 141, 142, 143, 145, 146, 147, 157, 158, 159, 178, 179, 182, 183, 185, 191, 194, 202, 206, 209, 211, 213, 214
Offset: 1

Author

Gus Wiseman, Dec 28 2024

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The terms together with their prime indices begin:
    2: {1}
    3: {2}
    5: {3}
   11: {5}
   14: {1,4}
   17: {7}
   21: {2,4}
   26: {1,6}
   31: {11}
   35: {3,4}
   38: {1,8}
   39: {2,6}
   41: {13}
   46: {1,9}
   57: {2,8}
   58: {1,10}
   59: {17}
   65: {3,6}
   67: {19}
   69: {2,9}
   74: {1,12}
   77: {4,5}
		

Crossrefs

These "old" primes are listed by A008578.
For no composite parts we have A302540, counted by A034891 (strict A036497).
For all composite parts we have A320629, counted by A023895 (strict A204389).
For a unique prime part we have A331915, counted by A379304 (strict A379305).
Positions of ones in A379311, see A379313.
Partitions of this type are counted by A379314, strict A379315.
A000040 lists the prime numbers, differences A001223.
A002808 lists the composite numbers, nonprimes A018252, differences A073783 or A065310.
A055396 gives least prime index, greatest A061395.
A056239 adds up prime indices, row sums of A112798, counted by A001222.
A080339 is the characteristic function for the old prime numbers.
A376682 gives k-th differences of old prime numbers, see A030016, A075526.
Other counts of prime indices:
- A330944 nonprime, see A002095, A096258, A320628, A330945.
- A379306 squarefree, see A302478, A379308, A379309, A379316.
- A379310 nonsquarefree, see A114374, A256012, A379307.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[1000],Length[Select[prix[#],#==1||PrimeQ[#]&]]==1&]

A321895 Irregular triangle read by rows where T(H(u),H(v)) is the coefficient of p(v) in M(u), where H is Heinz number, M is augmented monomial symmetric functions, and p is power sum symmetric functions.

Original entry on oeis.org

1, 1, 1, 0, -1, 1, 1, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 2, -3, 1, -1, 1, 0, 0, 0, -1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, -1, -2, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, -6, 3, 8, -6, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Author

Gus Wiseman, Nov 20 2018

Keywords

Comments

Row n has length A000041(A056239(n)).
The Heinz number of an integer partition (y_1, ..., y_k) is prime(y_1) * ... * prime(y_k).
The augmented monomial symmetric functions are given by M(y) = c(y) * m(y) where c(y) = Product_i (y)_i! where (y)_i is the number of i's in y and m is monomial symmetric functions.

Examples

			Triangle begins:
   1
   1
   1   0
  -1   1
   1   0   0
  -1   1   0
   1   0   0   0   0
   2  -3   1
  -1   1   0   0   0
  -1   0   1   0   0
   1   0   0   0   0   0   0
   2  -1  -2   1   0
   1   0   0   0   0   0   0   0   0   0   0
  -1   1   0   0   0   0   0
  -1   0   1   0   0   0   0
  -6   3   8  -6   1
   1   0   0   0   0   0   0   0   0   0   0   0   0   0   0
   2  -1  -2   1   0   0   0
For example, row 12 gives: M(211) = 2p(4) - p(22) - 2p(31) + p(211).
		

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Sum[Product[(-1)^(Length[t]-1)*(Length[t]-1)!,{t,s}],{s,Select[sps[Range[PrimeOmega[n]]]/.Table[i->If[n==1,{},primeMS[n]][[i]],{i,PrimeOmega[n]}],Times@@Prime/@Total/@#==m&]}],{n,18},{m,Sort[Times@@Prime/@#&/@IntegerPartitions[Total[primeMS[n]]]]}]
Showing 1-10 of 31 results. Next