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.

A014963 Exponential of Mangoldt function M(n): a(n) = 1 unless n is a prime or prime power, in which case a(n) = that prime.

Original entry on oeis.org

1, 2, 3, 2, 5, 1, 7, 2, 3, 1, 11, 1, 13, 1, 1, 2, 17, 1, 19, 1, 1, 1, 23, 1, 5, 1, 3, 1, 29, 1, 31, 2, 1, 1, 1, 1, 37, 1, 1, 1, 41, 1, 43, 1, 1, 1, 47, 1, 7, 1, 1, 1, 53, 1, 1, 1, 1, 1, 59, 1, 61, 1, 1, 2, 1, 1, 67, 1, 1, 1, 71, 1, 73, 1, 1, 1, 1, 1, 79, 1, 3, 1, 83, 1, 1, 1, 1, 1, 89, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Keywords

Comments

There are arbitrarily long runs of ones (Sierpiński). - Franz Vrabec, Sep 26 2005
a(n) is the smallest positive integer such that n divides Product_{k=1..n} a(k), for all positive integers n. - Leroy Quet, May 01 2007
For n>1, resultant of the n-th cyclotomic polynomial with the 1st cyclotomic polynomial x-1. - Ralf Stephan, Aug 14 2013
A368749(n) is the smallest prime p such that the interval [a(p), a(q)] contains n 1's; q = nextprime(p), n >= 0. - David James Sycamore, Mar 21 2024

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Section 17.7.
  • I. Vardi, Computational Recreations in Mathematica. Reading, MA: Addison-Wesley, pp. 146-147, 152-153 and 249, 1991.

Crossrefs

Apart from initial 1, same as A020500. With ones replaced by zeros, equal to A120007.
Cf. A003418, A007947, A008683, A008472, A008578, A048671 (= n/a(n)), A072107 (partial sums), A081386, A081387, A099636, A100994, A100995, A140255 (inverse Mobius transform), A140254 (Mobius transform), A297108, A297109, A340675, A000027, A348846, A368749.
First column of A140256. Row sums of triangle A140581.
Cf. also A140579, A140580 (= n*a(n)).

Programs

  • Haskell
    a014963 1 = 1
    a014963 n | until ((> 0) . (`mod` spf)) (`div` spf) n == 1 = spf
              | otherwise = 1
              where spf = a020639 n
    -- Reinhard Zumkeller, Sep 09 2011
    
  • Maple
    a := n -> if n < 2 then 1 else numtheory[factorset](n); if 1 < nops(%) then 1 else op(%) fi fi; # Peter Luschny, Jun 23 2009
    A014963 := n -> n/ilcm(op(numtheory[divisors](n) minus {1,n}));
    seq(A014963(i), i=1..69); # Peter Luschny, Mar 23 2011
    # The following is Nowicki's LCM-Transform - N. J. A. Sloane, Jan 09 2024
    LCMXFM:=proc(a)  local p,q,b,i,k,n:
    if whattype(a) <> list then RETURN([]); fi:
    n:=nops(a):
    b:=[a[1]]: p:=[a[1]];
    for i from 2 to n do q:=[op(p),a[i]]; k := lcm(op(q))/lcm(op(p));
    b:=[op(b),k]; p:=q;; od:
    RETURN(b); end:
    # Alternative, to be called by 'seq' as shown, not for a single n.
    a := proc(n) option remember; local i; global f; f := ifelse(n=1, 1, f*n);
    iquo(f, mul(a(i)^iquo(n, i), i=1..n-1)) end: seq(a(n), n=1..95); # Peter Luschny, Apr 05 2025
  • Mathematica
    a[n_?PrimeQ] := n; a[n_/;Length[FactorInteger[n]] == 1] := FactorInteger[n][[1]][[1]]; a[n_] := 1; Table[a[n], {n, 95}] (* Alonso del Arte, Jan 16 2011 *)
    a[n_] := Exp[ MangoldtLambda[n]]; Table[a[n], {n, 95}] (* Jean-François Alcover, Jul 29 2013 *)
    Ratios[LCM @@ # & /@ Table[Range[n], {n, 100}]] (* Horst H. Manninger, Mar 08 2024 *)
    Table[Which[PrimeQ[n],n,PrimePowerQ[n],Surd[n,FactorInteger[n][[-1,2]]],True,1],{n,100}] (* Harvey P. Dale, Mar 01 2025 *)
  • PARI
    A014963(n)=
    {
        local(r);
        if( isprime(n), return(n));
        if( ispower(n,,&r) && isprime(r), return(r) );
        return(1);
    }  \\ Joerg Arndt, Jan 16 2011
    
  • PARI
    a(n)=ispower(n,,&n);if(isprime(n),n,1) \\ Charles R Greathouse IV, Jun 10 2011
    
  • Python
    from sympy import factorint
    def A014963(n):
        y = factorint(n)
        return list(y.keys())[0] if len(y) == 1 else 1
    print([A014963(n) for n in range(1, 71)]) # Chai Wah Wu, Sep 04 2014
  • Sage
    def A014963(n) : return simplify(exp(add(moebius(d)*log(n/d) for d in divisors(n))))
    [A014963(n) for n in (1..50)]  # Peter Luschny, Feb 02 2012
    
  • Sage
    def a(n):
        if n == 1: return 1
        return prod(1 - E(n)**k for k in ZZ(n).coprime_integers(n+1))
    [a(n) for n in range(1, 14)] # F. Chapoton, Mar 17 2020
    

Formula

a(n) = A003418(n) / A003418(n-1) = lcm {1..n} / lcm {1..n-1}. [This is equivalent to saying that this sequence is the LCM-transform (as defined by Nowicki, 2013) of the positive integers. - David James Sycamore, Jan 09 2024.]
a(n) = 1/Product_{d|n} d^mu(d) = Product_{d|n} (n/d)^mu(d). - Vladeta Jovovic, Jan 24 2002
a(n) = gcd( C(n+1,1), C(n+2,2), ..., C(2n,n) ) where C(n,k) = binomial(n,k). - Benoit Cloitre, Jan 31 2003
a(n) = gcd(C(n,1), C(n+1,2), C(n+2,3), ...., C(2n-2,n-1)), where C(n,k) = binomial(n,k). - Benoit Cloitre, Jan 31 2003; corrected by Ant King, Dec 27 2005
Note: a(n) != gcd(A008472(n), A007947(n)) = A099636(n), GCD of rad(n) and sopf(n) (this fails for the first time at n=30), since a(30) = 1 but gcd(rad(30), sopf(30)) = gcd(30,10) = 10.
a(n)^A100995(n) = A100994(n). - N. J. A. Sloane, Feb 20 2005
a(n) = Product_{k=1..n-1, if(gcd(n, k)=1, 1-exp(2*Pi*i*k/n), 1)}, i=sqrt(-1); a(n) = n/A048671(n). - Paul Barry, Apr 15 2005
Sum_{n>=1} (log(a(n))-1)/n = -2*A001620 [Bateman Manuscript Project Vol III, ed. by Erdelyi et al.]. - R. J. Mathar, Mar 09 2008
n*a(n) = A140580(n) = n^2/A048671(n) = A140579 * [1,2,3,...]. - Gary W. Adamson, May 17 2008
a(n) = (2*Pi)^phi(n) / Product_{gcd(n,k)=1} Gamma(k/n)^2 (for n > 1). - Peter Luschny, Aug 08 2009
a(n) = A166140(n) / A166142(n). - Mats Granvik, Oct 08 2009
a(n) = GCD of rows in A167990. - Mats Granvik, Nov 16 2009
a(n) = A010055(n)*(A007947(n) - 1) + 1. - Reinhard Zumkeller, Mar 26 2010
a(n) = 1 + (A007947(n)-1) * floor(1/A001221(n)), for n>1. - Enrique Pérez Herrero, Jun 01 2011
a(n) = Product_{k=1..n-1} if(gcd(k,n)=1, 2*sin(Pi*k/n), 1). - Peter Luschny, Jun 09 2011
a(n) = exp(Sum_{k>=1} A191898(n,k)/k) for n>1 (conjecture). - Mats Granvik, Jun 19 2011
Dirichlet g.f.: Sum_{n>0} e^Lambda(n)/n^s = Zeta(s) + Sum_{p prime} Sum_{k>0} (p-1)/p^(k*s) = Zeta(s) - ppzeta(s) + Sum(p prime, p/(p^s-1)); for a ppzeta definition see A010055. - Enrique Pérez Herrero, Jan 19 2013
a(n) = exp(lim_{s->1} zeta(s)*Sum_{d|n} moebius(d)/d^(s-1)) for n>1. - Mats Granvik, Jul 31 2013
a(n) = gcd_{k=1..n-1} binomial(n,k) for n > 1, see A014410. - Michel Marcus, Dec 08 2015 [Corrected by Jinyuan Wang, Mar 20 2020]
a(n) = 1 + Sum_{k=2..n} (k-1)*A010051(k)*(floor(k^n/n) - floor((k^n - 1)/n)). - Anthony Browne, Jun 16 2016
The Dirichlet series for log(a(n)) = Lambda(n) is given by the logarithmic derivative of the zeta function -zeta'(s)/zeta(s). - Mats Granvik, Oct 30 2016
a(n) = A008578(1+A297109(n)), For all n >= 1, Product_{d|n} a(d) = n. - Antti Karttunen, Feb 01 2021
Product_{k=1..floor(n/2)} Product_{j=1..floor(n/k)} a(j) = n!. - Ammar Khatab, Jan 28 2025

Extensions

Additional reference from Eric W. Weisstein, Jun 29 2008

A297108 If n is prime(k)^e, e >= 1, then a(n) = 2^(k-1), otherwise 0; Möbius transform of A048675.

Original entry on oeis.org

0, 1, 2, 1, 4, 0, 8, 1, 2, 0, 16, 0, 32, 0, 0, 1, 64, 0, 128, 0, 0, 0, 256, 0, 4, 0, 2, 0, 512, 0, 1024, 1, 0, 0, 0, 0, 2048, 0, 0, 0, 4096, 0, 8192, 0, 0, 0, 16384, 0, 8, 0, 0, 0, 32768, 0, 0, 0, 0, 0, 65536, 0, 131072, 0, 0, 1, 0, 0, 262144, 0, 0, 0, 524288, 0, 1048576, 0, 0, 0, 0, 0, 2097152, 0, 2, 0, 4194304
Offset: 1

Views

Author

Antti Karttunen, Dec 25 2017

Keywords

Comments

This is also Xor-Moebius transform of A248663, in other words, the unique sequence satisfying SumXOR_{d divides n} a(d) = A248663(n) for all n > 0, where SumXOR is the analog of summation under the binary XOR operation. See A295901 for a list of some of the properties of this transform.

Crossrefs

Programs

  • PARI
    A297108(n) = if(1==omega(n),2^(primepi(factor(n)[1,1])-1),0);
    \\ A more complicated way which demonstrates the Moebius transform:
    A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; }; \\ This function after Michel Marcus
    A297108(n) = sumdiv(n,d,moebius(n/d)*A048675(d));
    \\ And yet another way demonstrating the comment:
    A248663(n) = A048675(core(n));
    A297108(n) = { my(v=0); fordiv(n, d, if(issquarefree(n/d), v=bitxor(v, A248663(d)))); (v); } \\ after code in A295901.

Formula

If A001221(n) = 1 [when n is in A000961], then a(n) = 2^(A297109(n)-1) = 2^(A055396(n)-1), otherwise 0.
a(n) = Sum_{d|n} A048675(d)*A008683(n/d).

A120007 Mobius transform of sum of prime factors of n with multiplicity (A001414).

Original entry on oeis.org

0, 2, 3, 2, 5, 0, 7, 2, 3, 0, 11, 0, 13, 0, 0, 2, 17, 0, 19, 0, 0, 0, 23, 0, 5, 0, 3, 0, 29, 0, 31, 2, 0, 0, 0, 0, 37, 0, 0, 0, 41, 0, 43, 0, 0, 0, 47, 0, 7, 0, 0, 0, 53, 0, 0, 0, 0, 0, 59, 0, 61, 0, 0, 2, 0, 0, 67, 0, 0, 0, 71, 0, 73, 0, 0, 0, 0, 0, 79, 0, 3, 0, 83, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Keywords

Comments

Same as A014963, except this function is zero when n is not a prime power, whereas A014963 is one.
Moreover, this sequence, A014963, A297108 and A297109 partition the natural numbers to identical equivalence classes: For all i, j >= 1, a(i) = a(j) <=> A014963(i) = A014963(j) <=> A297108(i) = A297108(j) <=> A297109(i) = A297109(j). - Antti Karttunen, Feb 01 2021

Crossrefs

Cf. A000040, A001414, A007947, A014963, A010051, A010055, A061397, A070939, A140508 (Möbius transform of this sequence), A297108, A297109.

Programs

  • Haskell
    a120007 1 = 0
    a120007 n | until ((> 0) . (`mod` spf)) (`div` spf) n == 1 = spf
              | otherwise = 0
              where spf = a020639 n
    -- Reinhard Zumkeller, Sep 19 2011
    
  • Mathematica
    Table[If[Length@ # == 1, #[[1, 1]], 0] &@ FactorInteger@ n, {n, 96}] /. 1 -> 0 (* Michael De Vlieger, Jun 19 2016 *)
    Table[If[PrimePowerQ[n],FactorInteger[n][[1,1]],0],{n,100}] (* Harvey P. Dale, Jan 25 2020 *)
  • PARI
    A120007(n) = { my(v); if(isprimepower(n, &v), v, 0); }; \\ Antti Karttunen, Jan 31 2021

Formula

If n is a prime power p^k, k>0, a(n) = p; otherwise a(n) = 0.
Dirichlet g.f. sum_{p prime} p/(p^s-1) = sum_{k>0} primezeta(ks-1).
a(n) = A010055(n) * A007947(n). - Reinhard Zumkeller, Mar 26 2010
a(n) = A061397(A007947(n)). - Reinhard Zumkeller, Sep 19 2011, corrected by Antti Karttunen, Jan 31 2021
a(n) = Sum_{k=2..n} k*A010051(k)*(floor(k^n/n)-floor((k^n -1)/n)). - Anthony Browne, Jun 17 2016
If A297109(n) = 0, then a(n) = 0, otherwise a(n) = A000040(A297109(n)). - Antti Karttunen, Feb 01 2021

A248692 Fully multiplicative with a(prime(i)) = 2^i; If n = Product_{k >= 1} (p_k)^(c_k) where p_k is k-th prime A000040(k) and c_k >= 0 then a(n) = Product_{k >= 1} 2^(k*c_k).

Original entry on oeis.org

1, 2, 4, 4, 8, 8, 16, 8, 16, 16, 32, 16, 64, 32, 32, 16, 128, 32, 256, 32, 64, 64, 512, 32, 64, 128, 64, 64, 1024, 64, 2048, 32, 128, 256, 128, 64, 4096, 512, 256, 64, 8192, 128, 16384, 128, 128, 1024, 32768, 64, 256, 128, 512, 256, 65536, 128, 256, 128, 1024, 2048, 131072, 128, 262144, 4096, 256, 64
Offset: 1

Views

Author

Antti Karttunen, Oct 11 2014

Keywords

Comments

Equally, if n = p_i * p_j * ... * p_k, where p_i, p_j, ..., p_k are the primes A000040(i), A000040(j), ..., A000040(k) in the prime factorization of n (indices i, j, ..., k not necessarily distinct), then a(n) = 2^i * 2^j * 2^k.
a(1) = 1 (empty product).
Fully multiplicative with a(prime(i)) = 2^i.

Crossrefs

Programs

  • Maple
    a:= n-> mul((2^numtheory[pi](i[1]))^i[2], i=ifactors(n)[2]):
    seq(a(n), n=1..64);  # Alois P. Heinz, Jan 14 2021
  • Mathematica
    a[n_] := Product[{p, e} = pe; (2^PrimePi[p])^e, {pe, FactorInteger[n]}];
    Array[a, 100] (* Jean-François Alcover, Jan 03 2022 *)
  • PARI
    A248692(n) = if(1==n,n,my(f=factor(n)); for(i=1,#f~,f[i,1] = 2^primepi(f[i,1])); factorback(f)); \\ Antti Karttunen, Feb 01 2021

Formula

a(n) = 2^A056239(n) = A000079(A056239(n)).
Other identities. For all n >= 1:
a(A122111(n)) = a(n).
a(A000040(n)) = A000079(n).
For all n >= 0:
a(A000079(n)) = A000079(n).
a(n) = Product_{d|n} 2^A297109(d). - Antti Karttunen, Feb 01 2021
Sum_{n>=1} 1/a(n) = A065446. - Amiram Eldar, Dec 24 2022

A340676 If n is of the form s^(2^e), where s is a squarefree number, and e >= 0, then a(n) = 1+e, otherwise a(n) = 0.

Original entry on oeis.org

0, 1, 1, 2, 1, 1, 1, 0, 2, 1, 1, 0, 1, 1, 1, 3, 1, 0, 1, 0, 1, 1, 1, 0, 2, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 3, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 2, 1, 1, 1, 0, 1
Offset: 1

Views

Author

Antti Karttunen, Feb 01 2021

Keywords

Crossrefs

Positions of zeros: {1} U A340681, of 1's: A005117 \ {1}, of 2's: A062503 \ {1}, of 3's: A113849.
Positions of nonzero terms: A340682, of terms > 1: A340674.

Programs

  • Mathematica
    a[1] = 0; a[n_] := If[Length[(u = Union[FactorInteger[n][[;; , 2]]])] == 1 && u[[1]] == 2^(e = IntegerExponent[u[[1]], 2]), e + 1, 0]; Array[a, 100] (* Amiram Eldar, Feb 10 2021 *)
  • PARI
    A001511(n) = 1+valuation(n,2);
    A209229(n) = (n && !bitand(n,n-1));
    A104117(n) = (A209229(n)*A001511(n));
    A267116(n) = if(n>1, fold(bitor, factor(n)[, 2]), 0);
    A340676(n) = if(1==n,0,A104117(A267116(n)));

Formula

a(n) = A297109(A225546(n)).
For n > 1, a(n) = A104117(A267116(n)). - Peter Munn, Feb 05 2021

A387116 Number of ways to choose a constant sequence of integer partitions, one of each prime index of n.

Original entry on oeis.org

1, 1, 2, 1, 3, 0, 5, 1, 2, 0, 7, 0, 11, 0, 0, 1, 15, 0, 22, 0, 0, 0, 30, 0, 3, 0, 2, 0, 42, 0, 56, 1, 0, 0, 0, 0, 77, 0, 0, 0, 101, 0, 135, 0, 0, 0, 176, 0, 5, 0, 0, 0, 231, 0, 0, 0, 0, 0, 297, 0, 385, 0, 0, 1, 0, 0, 490, 0, 0, 0, 627, 0, 792, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Aug 21 2025

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.
If n is a prime power prime(x)^y, then a(n) is the number of integer partitions of x; otherwise, a(n) = 0.

Examples

			The a(49) = 5 choices:
  ((4),(4))
  ((3,1),(3,1))
  ((2,2),(2,2))
  ((2,1,1),(2,1,1))
  ((1,1,1,1),(1,1,1,1))
		

Crossrefs

Positions of zeros are A024619, complement A000961.
Twice-partitions of this type are counted by A047968, see also A296122.
For initial intervals instead of partitions we have A055396, see also A387111.
This is the constant case of A299200, see also A357977, A357982.
For disjoint instead of constant we have A383706.
For distinct instead of constant we have A387110.
For divisors instead of partitions we have A387114, see also A355731, A355739.
For strict partitions instead of partitions we have A387117.
A000041 counts integer partitions, strict A000009.
A003963 multiplies together prime indices.
A112798 lists prime indices, row sums A056239 or A066328, lengths A001222.
A120383 lists numbers divisible by all of their prime indices.
A289509 lists numbers with relatively prime prime indices.

Programs

Formula

a(n) = A000041(A297109(n)).
Showing 1-6 of 6 results.