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

A010051 Characteristic function of primes: 1 if n is prime, else 0.

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0
Offset: 1

Views

Author

Keywords

Comments

The following sequences all have the same parity (with an extra zero term at the start of a(n)): a(n), A061007, A035026, A069754, A071574. - Jeremy Gardiner, Aug 09 2002
Hardy and Wright prove that the real number 0.011010100010... is irrational. See Nasehpour link. - Michel Marcus, Jun 21 2018
The spectral components (excluding the zero frequency) of the Fourier transform of the partial sequences {a(j)} with j=1..n and n an even number, exhibit a remarkable symmetry with respect to the central frequency component at position 1 + n/4. See the Fourier spectrum of the first 2^20 terms in Links, Comments in A289777, and Conjectures in A001223 of Sep 01 2019. It also appears that the symmetry grows with n. - Andres Cicuttin, Aug 23 2020

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 3.
  • V. Brun, Über das Goldbachsche Gesetz und die Anzahl der Primzahlpaare, Arch. Mat. Natur. B, 34, no. 8, 1915.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Oxford University Press, London, 1975.
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 65.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 132.

Crossrefs

Cf. A051006 (constant 0.4146825... (base 10) = 0.01101010001010001010... (base 2)), A001221 (inverse Moebius transform), A143519, A156660, A156659, A156657, A059500, A053176, A059456, A072762.
First differences of A000720, so A000720 gives partial sums.
Column k=1 of A117278.
Characteristic function of A000040.
Cf. A008683.

Programs

  • Haskell
    import Data.List (unfoldr)
    a010051 :: Integer -> Int
    a010051 n = a010051_list !! (fromInteger n-1)
    a010051_list = unfoldr ch (1, a000040_list) where
       ch (i, ps'@(p:ps)) = Just (fromEnum (i == p),
                                  (i + 1, if i == p then ps else ps'))
    -- Reinhard Zumkeller, Apr 17 2012, Sep 15 2011
    
  • Magma
    s:=[]; for n in [1..100] do if IsPrime(n) then s:=Append(s,1); else s:=Append(s,0); end if; end for; s;
    
  • Magma
    [IsPrime(n) select 1 else 0: n in [1..100]];  // Bruno Berselli, Mar 02 2011
    
  • Maple
    A010051:= n -> if isprime(n) then 1 else 0 fi;
  • Mathematica
    Table[ If[ PrimeQ[n], 1, 0], {n, 105}] (* Robert G. Wilson v, Jan 15 2005 *)
    Table[Boole[PrimeQ[n]], {n, 105}] (* Alonso del Arte, Aug 09 2011 *)
    Table[PrimePi[n] - PrimePi[n-1], {n,50}] (* G. C. Greubel, Jan 05 2017 *)
  • PARI
    a(n)=isprime(n) \\ Charles R Greathouse IV, Apr 16 2011
    
  • Python
    from sympy import isprime
    def A010051(n): return int(isprime(n)) # Chai Wah Wu, Jan 20 2022

Formula

a(n) = floor(cos(Pi*((n-1)! + 1)/n)^2) for n >= 2. - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Nov 07 2002
Let M(n) be the n X n matrix m(i, j) = 0 if n divides ij + 1, m(i, j) = 1 otherwise; then for n > 0 a(n) = -det(M(n)). - Benoit Cloitre, Jan 17 2003
n >= 2, a(n) = floor(phi(n)/(n - 1)) = floor(A000010(n)/(n - 1)). - Benoit Cloitre, Apr 11 2003
a(n) = Sum_{d|gcd(n, A034386(n))} mu(d). [Brun]
a(m*n) = a(m)*0^(n - 1) + a(n)*0^(m - 1). - Reinhard Zumkeller, Nov 25 2004
a(n) = 1 if n has no divisors other than 1 and n, and 0 otherwise. - Jon Perry, Jul 02 2005
Dirichlet generating function: Sum_{n >= 1} a(n)/n^s = primezeta(s), where primezeta is the prime zeta function. - Franklin T. Adams-Watters, Sep 11 2005
a(n) = (n-1)!^2 mod n. - Franz Vrabec, Jun 24 2006
a(n) = A047886(n, 1). - Reinhard Zumkeller, Apr 15 2008
Equals A051731 (the inverse Möbius transform) * A143519. - Gary W. Adamson, Aug 22 2008
a(n) = A051731((n + 1)! + 1, n) from Wilson's theorem: n is prime if and only if (n + 1)! is congruent to -1 mod n. - N-E. Fahssi, Jan 20 2009, Jan 29 2009
a(n) = A166260/A001477. - Mats Granvik, Oct 10 2009
a(n) = 0^A070824, where 0^0=1. - Mats Granvik, Gary W. Adamson, Feb 21 2010
It appears that a(n) = (H(n)*H(n + 1)) mod n, where H(n) = n!*Sum_{k=1..n} 1/k = A000254(n). - Gary Detlefs, Sep 12 2010
Dirichlet generating function: log( Sum_{n >= 1} 1/(A112624(n)*n^s) ). - Mats Granvik, Apr 13 2011
a(n) = A100995(n) - sqrt(A100995(n)*A193056(n)). - Mats Granvik, Jul 15 2011
a(n) * (2 - n mod 4) = A151763(n). - Reinhard Zumkeller, Oct 06 2011
(n - 1)*a(n) = ( (2*n + 1)!! * Sum_{k=1..n}(1/(2*k + 1))) mod n, n > 2. - Gary Detlefs, Oct 07 2011
For n > 1, a(n) = floor(1/A001222(n)). - Enrique Pérez Herrero, Feb 23 2012
a(n) = mu(n) * Sum_{d|n} mu(d)*omega(d), where mu is A008683 and omega A001222 or A001221 indistinctly. - Enrique Pérez Herrero, Jun 06 2012
a(n) = A003418(n+1)/A003418(n) - A217863(n+1)/A217863(n) = A014963(n) - A072211(n). - Eric Desbiaux, Nov 25 2012
For n > 1, a(n) = floor(A014963(n)/n). - Eric Desbiaux, Jan 08 2013
a(n) = ((abs(n-2))! mod n) mod 2. - Timothy Hopper, May 25 2015
a(n) = abs(F(n)) - abs(F(n)-1/2) - abs(F(n)-1) + abs(f(n)-3/2), where F(n) = Sum_{m=2..n+1} (abs(1 - (n mod m)) - abs(1/2 - (n mod m)) + 1/2), n > 0. F(n) = 1 if n is prime, > 1 otherwise, except F(1) = 0. a(n) = 1 if F(n) = 1, 0 otherwise. - Timothy Hopper, Jun 16 2015
For n > 4, a(n) = (n-2)! mod n. - Thomas Ordowski, Jul 24 2016
From Ilya Gutkovskiy, Jul 24 2016: (Start)
G.f.: A(x) = Sum_{n>=1} x^A000040(n) = B(x)*(1 - x), where B(x) is the g.f. for A000720.
a(n) = floor(2/A000005(n)), for n>1. (End)
a(n) = pi(n) - pi(n-1) = A000720(n) - A000720(n-1), for n>=1. - G. C. Greubel, Jan 05 2017
Decimal expansion of Sum_{k>=1} (1/10)^prime(k) = 9 * Sum_{k>=1} pi(k)/10^(k+1), where pi(k) = A000720(k). - Amiram Eldar, Aug 11 2020
a(n) = 1 - ceiling((2/n) * Sum_{k=2..floor(sqrt(n))} floor(n/k)-floor((n-1)/k)), n>1. - Gary Detlefs, Sep 08 2023
a(n) = Sum_{d|n} mu(d)*omega(n/d), where mu = A008683 and omega = A001221. - Ridouane Oudra, Apr 12 2025
a(n) = 0 if (n^2 - 3*n + 2) * A000203(n) - 8 * A002127(n) > 0 else 1 (n>2, see Craig link). - Bill McEachen, Jul 04 2025

A156552 Unary-encoded compressed factorization of natural numbers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 8, 7, 6, 9, 16, 11, 32, 17, 10, 15, 64, 13, 128, 19, 18, 33, 256, 23, 12, 65, 14, 35, 512, 21, 1024, 31, 34, 129, 20, 27, 2048, 257, 66, 39, 4096, 37, 8192, 67, 22, 513, 16384, 47, 24, 25, 130, 131, 32768, 29, 36, 71, 258, 1025, 65536, 43, 131072, 2049, 38, 63, 68, 69, 262144
Offset: 1

Views

Author

Leonid Broukhis, Feb 09 2009

Keywords

Comments

The primes become the powers of 2 (2 -> 1, 3 -> 2, 5 -> 4, 7 -> 8); the composite numbers are formed by taking the values for the factors in the increasing order, multiplying them by the consecutive powers of 2, and summing. See the Example section.
From Antti Karttunen, Jun 27 2014: (Start)
The odd bisection (containing even terms) halved gives A244153.
The even bisection (containing odd terms), when one is subtracted from each and halved, gives this sequence back.
(End)
Question: Are there any other solutions that would satisfy the recurrence r(1) = 0; and for n > 1, r(n) = Sum_{d|n, d>1} 2^A033265(r(d)), apart from simple variants 2^k * A156552(n)? See also A297112, A297113. - Antti Karttunen, Dec 30 2017

Examples

			For 84 = 2*2*3*7 -> 1*1 + 1*2 + 2*4 + 8*8 =  75.
For 105 = 3*5*7 -> 2*1 + 4*2 + 8*4 = 42.
For 137 = p_33 -> 2^32 = 4294967296.
For 420 = 2*2*3*5*7 -> 1*1 + 1*2 + 2*4 + 4*8 + 8*16 = 171.
For 147 = 3*7*7 = p_2 * p_4 * p_4 -> 2*1 + 8*2 + 8*4 = 50.
		

Crossrefs

One less than A005941.
Inverse permutation: A005940 with starting offset 0 instead of 1.
Cf. also A297106, A297112 (Möbius transform), A297113, A153013, A290308, A300827, A323243, A323244, A323247, A324201, A324812 (n for which a(n) is a square), A324813, A324822, A324823, A324398, A324713, A324815, A324819, A324865, A324866, A324867.

Programs

  • Mathematica
    Table[Floor@ Total@ Flatten@ MapIndexed[#1 2^(#2 - 1) &, Flatten[ Table[2^(PrimePi@ #1 - 1), {#2}] & @@@ FactorInteger@ n]], {n, 67}] (* Michael De Vlieger, Sep 08 2016 *)
  • PARI
    a(n) = {my(f = factor(n), p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res}; \\ David A. Corneth, Mar 08 2019
    
  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n)))); \\ (based on the given recurrence) - Antti Karttunen, Mar 08 2019
    
  • Perl
    # Program corrected per instructions from Leonid Broukhis. - Antti Karttunen, Jun 26 2014
    # However, it gives correct answers only up to n=136, before corruption by a wrap-around effect.
    # Note that the correct answer for n=137 is A156552(137) = 4294967296.
    $max = $ARGV[0];
    $pow = 0;
    foreach $i (2..$max) {
    @a = split(/ /, `factor $i`);
    shift @a;
    $shift = 0;
    $cur = 0;
    while ($n = int shift @a) {
    $prime{$n} = 1 << $pow++ if !defined($prime{$n});
    $cur |= $prime{$n} << $shift++;
    }
    print "$cur, ";
    }
    print "\n";
    (Scheme, with memoization-macro definec from Antti Karttunen's IntSeq-library, two different implementations)
    (definec (A156552 n) (cond ((= n 1) 0) (else (+ (A000079 (+ -2 (A001222 n) (A061395 n))) (A156552 (A052126 n))))))
    (definec (A156552 n) (cond ((= 1 n) (- n 1)) ((even? n) (+ 1 (* 2 (A156552 (/ n 2))))) (else (* 2 (A156552 (A064989 n))))))
    ;; Antti Karttunen, Jun 26 2014
    
  • Python
    from sympy import primepi, factorint
    def A156552(n): return sum((1<Chai Wah Wu, Mar 10 2023

Formula

From Antti Karttunen, Jun 26 2014: (Start)
a(1) = 0, a(n) = A000079(A001222(n)+A061395(n)-2) + a(A052126(n)).
a(1) = 0, a(2n) = 1+2*a(n), a(2n+1) = 2*a(A064989(2n+1)). [Compare to the entanglement recurrence A243071].
For n >= 0, a(2n+1) = 2*A244153(n+1). [Follows from the latter clause of the above formula.]
a(n) = A005941(n) - 1.
As a composition of related permutations:
a(n) = A003188(A243354(n)).
a(n) = A054429(A243071(n)).
For all n >= 1, A005940(1+a(n)) = n and for all n >= 0, a(A005940(n+1)) = n. [The offset-0 version of A005940 works as an inverse for this permutation.]
This permutations also maps between the partition-lists A112798 and A125106:
A056239(n) = A161511(a(n)). [The sums of parts of each partition (the total sizes).]
A003963(n) = A243499(a(n)). [And also the products of those parts.]
(End)
From Antti Karttunen, Oct 09 2016: (Start)
A161511(a(n)) = A056239(n).
A029837(1+a(n)) = A252464(n). [Binary width of terms.]
A080791(a(n)) = A252735(n). [Number of nonleading 0-bits.]
A000120(a(n)) = A001222(n). [Binary weight.]
For all n >= 2, A001511(a(n)) = A055396(n).
For all n >= 2, A000120(a(n))-1 = A252736(n). [Binary weight minus one.]
A252750(a(n)) = A252748(n).
a(A250246(n)) = A252754(n).
a(A005117(n)) = A277010(n). [Maps squarefree numbers to a permutation of A003714, fibbinary numbers.]
A085357(a(n)) = A008966(n). [Ditto for their characteristic functions.]
For all n >= 0:
a(A276076(n)) = A277012(n).
a(A276086(n)) = A277022(n).
a(A260443(n)) = A277020(n).
(End)
From Antti Karttunen, Dec 30 2017: (Start)
For n > 1, a(n) = Sum_{d|n, d>1} 2^A033265(a(d)). [See comments.]
More linking formulas:
A106737(a(n)) = A000005(n).
A290077(a(n)) = A000010(n).
A069010(a(n)) = A001221(n).
A136277(a(n)) = A181591(n).
A132971(a(n)) = A008683(n).
A106400(a(n)) = A008836(n).
A268411(a(n)) = A092248(n).
A037011(a(n)) = A010052(n) [conjectured, depends on the exact definition of A037011].
A278161(a(n)) = A046951(n).
A001316(a(n)) = A061142(n).
A277561(a(n)) = A034444(n).
A286575(a(n)) = A037445(n).
A246029(a(n)) = A181819(n).
A278159(a(n)) = A124859(n).
A246660(a(n)) = A112624(n).
A246596(a(n)) = A069739(n).
A295896(a(n)) = A053866(n).
A295875(a(n)) = A295297(n).
A284569(a(n)) = A072411(n).
A286574(a(n)) = A064547(n).
A048735(a(n)) = A292380(n).
A292272(a(n)) = A292382(n).
A244154(a(n)) = A048673(n), a(A064216(n)) = A244153(n).
A279344(a(n)) = A279339(n), a(A279338(n)) = A279343(n).
a(A277324(n)) = A277189(n).
A037800(a(n)) = A297155(n).
For n > 1, A033265(a(n)) = 1+A297113(n).
(End)
From Antti Karttunen, Mar 08 2019: (Start)
a(n) = A048675(n) + A323905(n).
a(A324201(n)) = A000396(n), provided there are no odd perfect numbers.
The following sequences are derived from or related to the base-2 expansion of a(n):
A000265(a(n)) = A322993(n).
A002487(a(n)) = A323902(n).
A005187(a(n)) = A323247(n).
A324288(a(n)) = A324116(n).
A323505(a(n)) = A323508(n).
A079559(a(n)) = A323512(n).
A085405(a(n)) = A323239(n).
The following sequences are obtained by applying to a(n) a function that depends on the prime factorization of its argument, which goes "against the grain" because a(n) is the binary code of the factorization of n, which in these cases is then factored again:
A000203(a(n)) = A323243(n).
A033879(a(n)) = A323244(n) = 2*a(n) - A323243(n),
A294898(a(n)) = A323248(n).
A000005(a(n)) = A324105(n).
A000010(a(n)) = A324104(n).
A083254(a(n)) = A324103(n).
A001227(a(n)) = A324117(n).
A000593(a(n)) = A324118(n).
A001221(a(n)) = A324119(n).
A009194(a(n)) = A324396(n).
A318458(a(n)) = A324398(n).
A192895(a(n)) = A324100(n).
A106315(a(n)) = A324051(n).
A010052(a(n)) = A324822(n).
A053866(a(n)) = A324823(n).
A001065(a(n)) = A324865(n) = A323243(n) - a(n),
A318456(a(n)) = A324866(n) = A324865(n) OR a(n),
A318457(a(n)) = A324867(n) = A324865(n) XOR a(n),
A318458(a(n)) = A324398(n) = A324865(n) AND a(n),
A318466(a(n)) = A324819(n) = A323243(n) OR 2*a(n),
A318467(a(n)) = A324713(n) = A323243(n) XOR 2*a(n),
A318468(a(n)) = A324815(n) = A323243(n) AND 2*a(n).
(End)

Extensions

More terms from Antti Karttunen, Jun 28 2014

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

A318762 Number of permutations of a multiset whose multiplicities are the prime indices of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 6, 6, 4, 1, 12, 1, 5, 10, 24, 1, 30, 1, 20, 15, 6, 1, 60, 20, 7, 90, 30, 1, 60, 1, 120, 21, 8, 35, 180, 1, 9, 28, 120, 1, 105, 1, 42, 210, 10, 1, 360, 70, 140, 36, 56, 1, 630, 56, 210, 45, 11, 1, 420, 1, 12, 420, 720, 84, 168, 1, 72, 55
Offset: 1

Views

Author

Gus Wiseman, Sep 03 2018

Keywords

Comments

This multiset is generally not the same as the multiset of prime indices of n. For example, the prime indices of 12 are {1,1,2}, while a multiset whose multiplicities are {1,1,2} is {1,1,2,3}.

Examples

			The a(12) = 12 permutations are (1123), (1132), (1213), (1231), (1312), (1321), (2113), (2131), (2311), (3112), (3121), (3211).
		

Crossrefs

Programs

  • Maple
    a:= n-> (l-> add(i, i=l)!/mul(i!, i=l))(map(i->
           numtheory[pi](i[1])$i[2], ifactors(n)[2])):
    seq(a(n), n=1..100);  # Alois P. Heinz, Sep 03 2018
  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Total[primeMS[n]]!/Times@@Factorial/@primeMS[n],{n,100}]
  • PARI
    sig(n)={my(f=factor(n)); concat(vector(#f~, i, vector(f[i, 2], j, primepi(f[i, 1]))))}
    a(n)={if(n==1, 1, my(s=sig(n)); vecsum(s)!/prod(i=1, #s, s[i]!))}  \\ Andrew Howroyd, Dec 17 2018

Formula

If n = Product prime(x_i)^y_i is the prime factorization of n, then a(n) = (Sum x_i * y_i)! / Product (x_i!)^y_i.
a(n) = A008480(A181821(n)).
a(n) = A112624(n) * A124794(n). - Max Alekseyev, Oct 15 2023
Sum_{m in row n of A215366} a(m) = A005651(n).
Sum_{m in row n of A215366} a(m) * A008480(m) = A000670(n).
Sum_{m in row n of A215366} a(m) * A008480(m) / A001222(m)! = A000110(n).

A246660 Run Length Transform of factorials.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 2, 2, 6, 24, 1, 1, 1, 2, 1, 1, 2, 6, 2, 2, 2, 4, 6, 6, 24, 120, 1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 2, 2, 6, 24, 2, 2, 2, 4, 2, 2, 4, 12, 6, 6, 6, 12, 24, 24, 120, 720, 1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 2, 2, 6, 24, 1, 1, 1
Offset: 0

Views

Author

Peter Luschny, Sep 07 2014

Keywords

Comments

For the definition of the Run Length Transform see A246595.
Only Jordan-Polya numbers (A001013) are terms of this sequence.

Crossrefs

Cf. A003714 (gives the positions of ones).
Run Length Transforms of other sequences: A001316, A071053, A227349, A246588, A246595, A246596, A246661, A246674.

Programs

  • Mathematica
    Table[Times @@ (Length[#]!&) /@ Select[Split[IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 83}] (* Jean-François Alcover, Jul 11 2017 *)
  • PARI
    A246660(n) = { my(i=0, p=1); while(n>0, if(n%2, i++; p = p * i, i = 0); n = n\2); p; };
    for(n=0, 8192, write("b246660.txt", n, " ", A246660(n)));
    \\ Antti Karttunen, Sep 08 2014
    
  • Python
    from operator import mul
    from functools import reduce
    from re import split
    from math import factorial
    def A246660(n):
        return reduce(mul,(factorial(len(d)) for d in split('0+',bin(n)[2:]) if d)) if n > 0 else 1 # Chai Wah Wu, Sep 09 2014
  • Sage
    def RLT(f, size):
        L = lambda n: [a for a in Integer(n).binary().split('0') if a != '']
        return [mul([f(len(d)) for d in L(n)]) for n in range(size)]
    A246660_list = lambda len: RLT(factorial, len)
    A246660_list(88)
    
  • Scheme
    ;; A stand-alone loop version, like the Pari-program above:
    (define (A246660 n) (let loop ((n n) (i 0) (p 1)) (cond ((zero? n) p) ((odd? n) (loop (/ (- n 1) 2) (+ i 1) (* p (+ 1 i)))) (else (loop (/ n 2) 0 p)))))
    ;; One based on given recurrence, utilizing memoizing definec-macro from my IntSeq-library:
    (definec (A246660 n) (cond ((zero? n) 1) ((even? n) (A246660 (/ n 2))) (else (* (A007814 (+ n 1)) (A246660 (/ (- n 1) 2))))))
    ;; Yet another implementation, using fold:
    (define (A246660 n) (fold-left (lambda (a r) (* a (A000142 r))) 1 (bisect (reverse (binexp->runcount1list n)) (- 1 (modulo n 2)))))
    (definec (A000142 n) (if (zero? n) 1 (* n (A000142 (- n 1)))))
    ;; Other functions are as in A227349 - Antti Karttunen, Sep 08 2014
    

Formula

a(2^n-1) = n!.
a(0) = 1, a(2n) = a(n), a(2n+1) = a(n) * A007814(2n+2). - Antti Karttunen, Sep 08 2014
a(n) = A112624(A005940(1+n)). - Antti Karttunen, May 29 2017
a(n) = A323505(n) / A323506(n). - Antti Karttunen, Jan 17 2019

A306438 Number of non-crossing set partitions whose block sizes are the prime indices of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 1, 2, 4, 1, 6, 1, 5, 5, 1, 1, 10, 1, 10, 6, 6, 1, 10, 3, 7, 5, 15, 1, 30, 1, 1, 7, 8, 7, 30, 1, 9, 8, 20, 1, 42, 1, 21, 21, 10, 1, 15, 4, 21, 9, 28, 1, 35, 8, 35, 10, 11, 1, 105, 1, 12, 28, 1, 9, 56, 1, 36, 11, 56, 1, 70, 1, 13, 28, 45, 9
Offset: 1

Views

Author

Gus Wiseman, Feb 15 2019

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 a(18) = 10 non-crossing set partitions of type (2, 2, 1) are:
  {{1},{2,3},{4,5}}
  {{1},{2,5},{3,4}}
  {{1,2},{3},{4,5}}
  {{1,2},{3,4},{5}}
  {{1,2},{3,5},{4}}
  {{1,3},{2},{4,5}}
  {{1,4},{2,3},{5}}
  {{1,5},{2},{3,4}}
  {{1,5},{2,3},{4}}
  {{1,5},{2,4},{3}}
Missing from this list are the following crossing set partitions:
  {{1},{2,4},{3,5}}
  {{1,3},{2,4},{5}}
  {{1,3},{2,5},{4}}
  {{1,4},{2},{3,5}}
  {{1,4},{2,5},{3}}
		

Crossrefs

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[If[n==1,1,With[{y=primeMS[n]},Binomial[Total[y],Length[y]-1]*(Length[y]-1)!/Product[Count[y,i]!,{i,Max@@y}]]],{n,80}]

Formula

a(n) = falling(m, k - 1)/Product_i (y)_i! where m is the sum of parts (A056239(n)), k is the number of parts (A001222(n)), y is the integer partition with Heinz number n (row n of A296150), (y)_i is the number of i's in y, and falling(x, y) is the falling factorial x(x - 1)(x - 2) ... (x - y + 1) [Kreweras].
Equivalently, a(n) = falling(A056239(n), A001222(n) - 1)/A112624(n).

A130675 Factorial of bigomega(n).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 6, 2, 2, 1, 6, 1, 2, 2, 24, 1, 6, 1, 6, 2, 2, 1, 24, 2, 2, 6, 6, 1, 6, 1, 120, 2, 2, 2, 24, 1, 2, 2, 24, 1, 6, 1, 6, 6, 2, 1, 120, 2, 6, 2, 6, 1, 24, 2, 24, 2, 2, 1, 24, 1, 2, 6, 720, 2, 6, 1, 6, 2, 6, 1, 120, 1, 2, 6, 6, 2, 6, 1, 120, 24, 2, 1, 24, 2, 2, 2, 24, 1, 24
Offset: 1

Views

Author

Giovanni Teofilatto, Aug 12 2007

Keywords

Comments

a(n) = 1 iff n=1 or n is prime. - Wesley Ivan Hurt, Jun 05 2014

Crossrefs

Programs

Formula

a(n) = A000142(A001222(n)).
a(n) = A008480(n) * A112624(n). - Amiram Eldar, Mar 08 2024

Extensions

A 16 split into 1,6, a 21 split into 2,1, a(1) replaced by 1, and definition clarified by R. J. Mathar, Aug 23 2010

A323508 a(n) = A323505(A156552(n)).

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 16, 24, 12, 24, 32, 48, 64, 48, 24, 120, 128, 36, 256, 96, 48, 96, 512, 240, 24, 192, 48, 192, 1024, 72, 2048, 720, 96, 384, 48, 144, 4096, 768, 192, 480, 8192, 144, 16384, 384, 96, 1536, 32768, 1440, 48, 72, 384, 768, 65536, 144, 96, 960, 768, 3072, 131072, 288, 262144, 6144, 192, 5040, 192, 288, 524288, 1536, 1536
Offset: 1

Views

Author

Antti Karttunen, Jan 17 2019

Keywords

Comments

Sequence contains only terms of A001013 and each a(n) is a multiple of A112624(n).

Crossrefs

Programs

Formula

a(n) = A323505(A156552(n)).

A112622 If p^b(p,n) is the highest power of the prime p dividing n, then a(n) = product_{p|n} b(p,n)^b(p,n).

Original entry on oeis.org

1, 1, 1, 4, 1, 1, 1, 27, 4, 1, 1, 4, 1, 1, 1, 256, 1, 4, 1, 4, 1, 1, 1, 27, 4, 1, 27, 4, 1, 1, 1, 3125, 1, 1, 1, 16, 1, 1, 1, 27, 1, 1, 1, 4, 4, 1, 1, 256, 4, 4, 1, 4, 1, 27, 1, 27, 1, 1, 1, 4, 1, 1, 4, 46656, 1, 1, 1, 4, 1, 1, 1, 108, 1, 1, 4, 4, 1, 1, 1, 256, 256, 1, 1, 4, 1, 1, 1, 27, 1, 4, 1, 4, 1, 1, 1, 3125, 1, 4, 4, 16, 1, 1, 1, 27, 1
Offset: 1

Views

Author

Leroy Quet, Dec 25 2005

Keywords

Comments

a(1) = 1 (empty product).

Examples

			45 = 3^2 * 5^1. So a(45) = 2^2 * 1^1 = 4.
72 = 2^3 * 3^2. So a(72) = 3^3 * 2^2 = 108.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{fi = Last@Transpose@FactorInteger@n}, Times @@ (fi^fi)]; Rest@Array[f, 93] (* Robert G. Wilson v *)
  • PARI
    a(n)=local(v,r,i);v=factorint(n);r=1;for(i=1,matsize(v)[1],r*=v[i,2]^v[i,2]);r (Herrgesell)

Extensions

More terms from Robert G. Wilson v and Lambert Herrgesell (zero815(AT)googlemail.com), Dec 27 2005
Corrected the starting offset, data section extended to 105 terms - Antti Karttunen, May 28 2017

A306694 a(n) is the denominator of log(A014963(n))/log(n) if n > 1 and a(1) = 1.

Original entry on oeis.org

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

Views

Author

Mats Granvik, Mar 05 2019

Keywords

Comments

Log(A112624(n)) is the inverse Möbius transform of log(a(n)).

Crossrefs

Programs

  • Maple
    with(numtheory): pexp := n -> ifactors(n)[2][1][2]:
    a := n -> if nops(factorset(n)) = 1 then pexp(n) else 1 fi:
    seq(a(n), n=1..101); # Peter Luschny, Mar 19 2019
  • Mathematica
    Table[Denominator[FullSimplify[MangoldtLambda[n]/Log[n]]], {n, 1, 101}]
  • PARI
    A306694(n) = if((n=isprimepower(n))>0,n,1); \\ Antti Karttunen, Nov 17 2019
  • Sage
    def a(n):
        F = n.factor()
        return 1 if len(F) != 1 else F[0][1]
    print([a(n) for n in (1..101)]) # Peter Luschny, Mar 18 2019
    

Formula

If n is a prime power (in the sense of A246655) then a(n) is the exponent of this prime and otherwise a(n) is 1. - Peter Luschny, Mar 18 2019
Dirichlet generating function: zeta(s) + Sum_{n>=1} n*primezeta((n + 1)*s). - Mats Granvik, Mar 24 2019

Extensions

Data section extended up to term a(121) by Antti Karttunen, Nov 17 2019
Showing 1-10 of 10 results.