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 11 results. Next

A103994 A129360 * A115361.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Apr 15 2007

Keywords

Comments

Row sums = A104117: (1, 2, 0, 3, 0, 0, 0, 4, 0, 0, ...).

Examples

			First few rows of the triangle are:
   1;
   1,  1;
  -1,  0,  1;
   1,  1,  0,  1;
  -1,  0,  0,  0,  1;
  -1, -1,  1,  0,  0,  1;
  -1,  0,  0,  0,  0,  0,  1;
   1,  1,  0,  1,  0,  0,  0,  1;
   ...
		

Crossrefs

Column 1 is A209635 (Moebius transform of A104117).
Row sums are A104117.

Programs

  • Mathematica
    T[n_, k_] := If[Divisible[n, k], MoebiusMu[(n/k)/2^IntegerExponent[n/k, 2]], 0];
    Table[T[n, k], {n, 1, 13}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 14 2019 *)
  • PARI
    tabl(nn) = {Tm = matrix(nn, nn, n, k, if (! (n % k), moebius(n/k), 0)); Tr = matrix(nn, nn, n, k, n--; k--; if ((n==k), 1, if (n==2*k+1, -1, 0))); Ti = Tr^(-1); Tp = Tm*Ti*Ti; for (n=1, nn, for (k=1, n, print1(Tp[n, k], ", ");); print(););}
    
  • PARI
    T(n, k)={ if(n%k, 0, sumdiv(n/k, d, my(e=valuation(d, 2)); if(d==1<Andrew Howroyd, Aug 03 2018

Formula

A129360 * A115361 as infinite lower triangular matrices.
T(n,k) = A209635(n/k) for k | n, T(n,k) = 0 otherwise. - Andrew Howroyd, Aug 03 2018

Extensions

More terms from Michel Marcus, Mar 28 2015

A129558 A054523 * A129360.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Apr 20 2007

Keywords

Comments

Row sums = A062570, phi(2*n): (1, 2, 2, 4, 4, 4, 6, 8, ...).

Examples

			First few rows of the triangle:
  1;
  1, 1;
  1, 0, 1;
  2, 1, 0, 1;
  3, 0, 0, 0, 1;
  1, 1, 1, 0, 0, 1;
  5, 0, 0, 0, 0, 0, 1;
  4, 2, 0, 1, 0, 0, 0, 1;
  4, 0, 1, 0, 0, 0, 0, 0, 1;
  ...
		

Crossrefs

Formula

A054523 * A129360 as infinite lower triangular matrices.

A129564 A129360 * A000012.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Apr 21 2007

Keywords

Comments

Row sums = phi(2*n), A062570: (1, 2, 2, 4, 4, 4, 6, 8, 6, 8, ...).

Examples

			First few rows of the triangle:
  1;
  1, 1;
  0, 1, 1;
  1, 1, 1, 1;
  0, 1, 1, 1, 1;
  0, 0, 1, 1, 1, 1;
  0, 1, 1, 1, 1, 1, 1;
  1, 1, 1, 1, 1, 1, 1, 1;
  ...
		

Crossrefs

Formula

A129360 * A000012 as infinite lower triangular matrices.

A129570 A007318 * A129360.

Original entry on oeis.org

1, 1, 1, 0, 2, 1, -2, 3, 3, 1, -6, 4, 6, 4, 1, -14, 4, 10, 10, 5, 1, -30, 0, 15, 20, 15, 6, 1, -62, -14, 21, 35, 35, 21, 7, 1, -125, -48, 27, 56, 70, 56, 28, 8, 1, -245, -118, 27, 84, 126, 126, 84, 36, 9, 1
Offset: 1

Views

Author

Gary W. Adamson, Apr 22 2007

Keywords

Comments

Row sums = A119968: (1, 2, 3, 5, 9, 16, 27, ...). A129571 = A129360 * A007318.

Examples

			First few rows of the triangle:
    1;
    1,   1;
    0,   2,  1;
   -2,   3,  3,  1;
   -6,   4,  6,  4,  1;
  -14,   4, 10, 10,  5,  1;
  -30,   0, 15, 20, 15,  6,  1;
  -62, -14, 21, 35, 35, 21,  7,  1;
  ...
		

Crossrefs

Formula

Binomial transform of A129360 (as infinite lower triangular matrices).

A129571 A129360 * A007318.

Original entry on oeis.org

1, 1, 1, 0, 2, 1, 1, 3, 3, 1, 0, 4, 6, 4, 1, 0, 4, 10, 10, 5, 1, 0, 6, 15, 20, 15, 6, 1, 1, 7, 21, 35, 35, 21, 7, 1, 0, 6, 27, 56, 70, 56, 28, 8, 1, 0, 8, 36, 84, 126, 126, 84, 36, 9, 1
Offset: 1

Views

Author

Gary W. Adamson, Apr 22 2007

Keywords

Comments

First 10 row sums match A128022: (1, 2, 3, 8, 15, 30, 63, 128, 252, 510, ...). A129570 = A007318 * A129360.

Examples

			First few rows of the triangle:
  1;
  1,  1;
  0,  2,  1;
  1,  3,  3,  1;
  0,  4,  6,  4,  1;
  0,  4, 10, 10,  5,  1;
  0,  6, 15, 20, 15,  6,  1;
  1,  7, 21, 35, 35, 21,  7,  1;
  ...
		

Crossrefs

Formula

A129360 * A007318 as infinite lower triangular matrices.

A129569 A129360 * A128174.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Apr 22 2007

Keywords

Comments

Row sums = A055034: (1, 1, 1, 2, 2, 2, 3, 4, 3, 4, ...).

Examples

			First few rows of the triangle:
  1;
  0, 1;
  0, 0, 1;
  0, 1, 0, 1;
  0, 0, 1, 0, 1;
  0, 0, 0, 1, 0, 1;
  0, 0, 1, 0, 1, 0, 1;
  ...
		

Crossrefs

Formula

A129360 * A128174 as infinite lower triangular matrices.

A008683 Möbius (or Moebius) function mu(n). mu(1) = 1; mu(n) = (-1)^k if n is the product of k different primes; otherwise mu(n) = 0.

Original entry on oeis.org

1, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 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
Offset: 1

Views

Author

Keywords

Comments

Moebius inversion: f(n) = Sum_{d|n} g(d) for all n <=> g(n) = Sum_{d|n} mu(d)*f(n/d) for all n.
a(n) depends only on 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).
A008683 = A140579^(-1) * A140664. - Gary W. Adamson, May 20 2008
Coons & Borwein prove that Sum_{n>=1} mu(n) z^n is transcendental. - Jonathan Vos Post, Jun 11 2008; edited by Charles R Greathouse IV, Sep 06 2017
Equals row sums of triangle A144735 (the square of triangle A054533). - Gary W. Adamson, Sep 20 2008
Conjecture: a(n) is the determinant of Redheffer matrix A143104 where T(n, n) = 0. Verified for the first 50 terms. - Mats Granvik, Jul 25 2008
From Mats Granvik, Dec 06 2008: (Start)
The Editorial Office of the Journal of Number Theory kindly provided (via B. Conrey) the following proof of the conjecture: Let A be A143104 and B be A143104 where T(n, n) = 0.
"Suppose you expand det(B_n) along the bottom row. There is only a 1 in the first position and so the answer is (-1)^n times det(C_{n-1}) say, where C_{n-1} is the (n-1) by (n-1) matrix obtained from B_n by deleting the first column and the last row. Now the determinant of the Redheffer matrix is det(A_n) = M(n) where M(n) is the sum of mu(m) for 1 <= m <= n. Expanding det(A_n) along the bottom row, we see that det(A_n) = (-1)^n * det(C_{n-1}) + M(n-1). So we have det(B_n) = (-1)^n * det(C_{n-1}) = det(A_n) - M(n-1) = M(n) - M(n-1) = mu(n)." (End)
Conjecture: Consider the table A051731 and treat 1 as a divisor. Move the value in the lower right corner vertically to a divisor position in the transpose of the table and you will find that the determinant is the Moebius function. The number of permutation matrices that contribute to the Moebius function appears to be A074206. - Mats Granvik, Dec 08 2008
Convolved with A152902 = A000027, the natural numbers. - Gary W. Adamson, Dec 14 2008
[Pickover, p. 226]: "The probability that a number falls in the -1 mailbox turns out to be 3/Pi^2 - the same probability as for falling in the +1 mailbox". - Gary W. Adamson, Aug 13 2009
Let A = A176890 and B = A * A * ... * A, then the leftmost column in matrix B converges to the Moebius function. - Mats Granvik, Gary W. Adamson, Apr 28 2010 and May 28 2020
Equals row sums of triangle A176918. - Gary W. Adamson, Apr 29 2010
Calculate matrix powers: A175992^0 - A175992^1 + A175992^2 - A175992^3 + A175992^4 - ... Then the Mobius function is found in the first column. Compare this to the binomial series for (1+x)^-1 = 1 - x + x^2 - x^3 + x^4 - ... . - Mats Granvik, Gary W. Adamson, Dec 06 2010
From Richard L. Ollerton, May 08 2021: (Start)
Formulas for the numerous OEIS entries involving the Möbius transform (Dirichlet convolution of a(n) and some sequence h(n)) can be derived using the following (n >= 1):
Sum_{d|n} mu(d)*h(n/d) = Sum_{k=1..n} h(gcd(n,k))*mu(n/gcd(n,k))/phi(n/gcd(n,k)) = Sum_{k=1..n} h(n/gcd(n,k))*mu(gcd(n,k))/phi(n/gcd(n,k)), where phi = A000010.
Use of gcd(n,k)*lcm(n,k) = n*k provides further variations. (End)
Formulas for products corresponding to the sums above are also available for sequences f(n) > 0: Product_{d|n} f(n/d)^mu(d) = Product_{k=1..n} f(gcd(n,k))^(mu(n/gcd(n,k))/phi(n/gcd(n,k))) = Product_{k=1..n} f(n/gcd(n,k))^(mu(gcd(n,k))/phi(n/gcd(n,k))). - Richard L. Ollerton, Nov 08 2021

Examples

			G.f. = x - x^2 - x^3 - x^5 + x^6 - x^7 + x^10 - x^11 - x^13 + x^14 + x^15 + ...
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 24.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 161, #16.
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, pp. 64-65.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, th. 262 and 287.
  • Clifford A. Pickover, "The Math Book, from Pythagoras to the 57th Dimension, 250 Milestones in the History of Mathematics", Sterling Publishing, 2009, p. 226. - Gary W. Adamson, Aug 13 2009
  • G. Pólya and G. Szegő, Problems and Theorems in Analysis Volume II. Springer_Verlag 1976.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 98-99.

Crossrefs

Variants of a(n) are A178536, A181434, A181435.
Cf. A059956 (Dgf at s=2), A088453 (Dgf at s=3), A215267 (Dgf at s=4), A343308 (Dgf at s=5).

Programs

  • Axiom
    [moebiusMu(n) for n in 1..100]
    
  • Haskell
    import Math.NumberTheory.Primes.Factorisation (factorise)
    a008683 = mu . snd . unzip . factorise where
    mu [] = 1; mu (1:es) = - mu es; mu (_:es) = 0
    -- Reinhard Zumkeller, Dec 13 2015, Oct 09 2013
    
  • Haskell
    a008683 1 = 1
    a008683 n = - sum [a008683 d | d <- [1..(n-1)], n `mod` d == 0]
    -- Harry Richman, Jun 13 2025
    
  • Magma
    [ MoebiusMu(n) : n in [1..100]];
    
  • Maple
    with(numtheory): A008683 := n->mobius(n);
    with(numtheory): [ seq(mobius(n), n=1..100) ];
    # Note that older versions of Maple define mobius(0) to be -1.
    # This is unwise! Moebius(0) is better left undefined.
    with(numtheory):
    mu:= proc(n::posint) option remember; `if`(n=1, 1,
           -add(mu(d), d=divisors(n) minus {n}))
         end:
    seq(mu(n), n=1..100);  # Alois P. Heinz, Aug 13 2008
  • Mathematica
    Array[ MoebiusMu, 100]
    (* Second program: *)
    m = 100; A[_] = 0;
    Do[A[x_] = x - Sum[A[x^k], {k, 2, m}] + O[x]^m // Normal, {m}];
    CoefficientList[A[x]/x, x] (* Jean-François Alcover, Oct 20 2019, after Ilya Gutkovskiy *)
  • Maxima
    A008683(n):=moebius(n)$ makelist(A008683(n),n,1,30); /* Martin Ettl, Oct 24 2012 */
    
  • PARI
    a=n->if(n<1,0,moebius(n));
    
  • PARI
    {a(n) = if( n<1, 0, direuler( p=2, n, 1 - X)[n])};
    
  • PARI
    list(n)=my(v=vector(n,i,1)); forprime(p=2, sqrtint(n), forstep(i=p, n, p, v[i]*=-1); forstep(i=p^2, n, p^2, v[i]=0)); forprime(p=sqrtint(n)+1, n, forstep(i=p, n, p, v[i]*=-1)); v \\ Charles R Greathouse IV, Apr 27 2012
    
  • Python
    from sympy import mobius
    print([mobius(i) for i in range(1, 101)])  # Indranil Ghosh, Mar 18 2017
  • Sage
    @cached_function
    def mu(n):
        if n < 2: return n
        return -sum(mu(d) for d in divisors(n)[:-1])
    # Changing the sign of the sum gives the number of ordered factorizations of n A074206.
    print([mu(n) for n in (1..96)])  # Peter Luschny, Dec 26 2016
    

Formula

Sum_{d|n} mu(d) = 1 if n = 1 else 0.
Dirichlet generating function: Sum_{n >= 1} mu(n)/n^s = 1/zeta(s). Also Sum_{n >= 1} mu(n)*x^n/(1-x^n) = x.
In particular, Sum_{n > 0} mu(n)/n = 0. - Franklin T. Adams-Watters, Jun 20 2014
phi(n) = Sum_{d|n} mu(d)*n/d.
a(n) = A091219(A091202(n)).
Multiplicative with a(p^e) = -1 if e = 1; 0 if e > 1. - David W. Wilson, Aug 01 2001
abs(a(n)) = Sum_{d|n} 2^A001221(d)*a(n/d). - Benoit Cloitre, Apr 05 2002
Sum_{d|n} (-1)^(n/d)*mobius(d) = 0 for n > 2. - Emeric Deutsch, Jan 28 2005
a(n) = (-1)^omega(n) * 0^(bigomega(n) - omega(n)) for n > 0, where bigomega(n) and omega(n) are the numbers of prime factors of n with and without repetition (A001222, A001221, A046660). - Reinhard Zumkeller, Apr 05 2003
Dirichlet generating function for the absolute value: zeta(s)/zeta(2s). - Franklin T. Adams-Watters, Sep 11 2005
mu(n) = A129360(n) * (1, -1, 0, 0, 0, ...). - Gary W. Adamson, Apr 17 2007
mu(n) = -Sum_{d < n, d|n} mu(d) if n > 1 and mu(1) = 1. - Alois P. Heinz, Aug 13 2008
a(n) = A174725(n) - A174726(n). - Mats Granvik, Mar 28 2010
a(n) = first column in the matrix inverse of a triangular table with the definition: T(1, 1) = 1, n > 1: T(n, 1) is any number or sequence, k = 2: T(n, 2) = T(n, k-1) - T(n-1, k), k > 2 and n >= k: T(n,k) = (Sum_{i = 1..k-1} T(n-i, k-1)) - (Sum_{i = 1..k-1} T(n-i, k)). - Mats Granvik, Jun 12 2010
Product_{n >= 1} (1-x^n)^(-a(n)/n) = exp(x) (product form of the exponential function). - Joerg Arndt, May 13 2011
a(n) = Sum_{k=1..n, gcd(k,n)=1} exp(2*Pi*i*k/n), the sum over the primitive n-th roots of unity. See the Apostol reference, p. 48, Exercise 14 (b). - Wolfdieter Lang, Jun 13 2011
mu(n) = Sum_{k=1..n} A191898(n,k)*exp(-i*2*Pi*k/n)/n. (conjecture). - Mats Granvik, Nov 20 2011
Sum_{k=1..n} a(k)*floor(n/k) = 1 for n >= 1. - Peter Luschny, Feb 10 2012
a(n) = floor(omega(n)/bigomega(n))*(-1)^omega(n) = floor(A001221(n)/A001222(n))*(-1)^A001221(n). - Enrique Pérez Herrero, Apr 27 2012
Multiplicative with a(p^e) = binomial(1, e) * (-1)^e. - Enrique Pérez Herrero, Jan 19 2013
G.f. A(x) satisfies: x^2/A(x) = Sum_{n>=1} A( x^(2*n)/A(x)^n ). - Paul D. Hanna, Apr 19 2016
a(n) = -A008966(n)*A008836(n)/(-1)^A005361(n) = -floor(rad(n)/n)Lambda(n)/(-1)^tau(n/rad(n)). - Anthony Browne, May 17 2016
a(n) = Kronecker delta of A001221(n) and A001222(n) (which is A008966) multiplied by A008836(n). - Eric Desbiaux, Mar 15 2017
a(n) = A132971(A156552(n)). - Antti Karttunen, May 30 2017
Conjecture: a(n) = Sum_{k>=0} (-1)^(k-1)*binomial(A001222(n)-1, k)*binomial(A001221(n)-1+k, k), for n > 1. Verified for the first 100000 terms. - Mats Granvik, Sep 08 2018
From Peter Bala, Mar 15 2019: (Start)
Sum_{n >= 1} mu(n)*x^n/(1 + x^n) = x - 2*x^2. See, for example, Pólya and Szegő, Part V111, Chap. 1, No. 71.
Sum_{n >= 1} (-1)^(n+1)*mu(n)*x^n/(1 - x^n) = x + 2*(x^2 + x^4 + x^8 + x^16 + ...).
Sum_{n >= 1} (-1)^(n+1)*mu(n)*x^n/(1 + x^n) = x - 2*(x^4 + x^8 + x^16 + x^32 + ...).
Sum_{n >= 1} |mu(n)|*x^n/(1 - x^n) = Sum_{n >= 1} (2^w(n))*x^n, where w(n) is the number of different prime factors of n (Hardy and Wright, Chapter XVI, Theorem 264).
Sum_{n odd} |mu(n)|*x^n/(1 + x^(2*n)) = Sum_{n in S_1} (2^w_1(n))*x^n, where S_1 = {1, 5, 13, 17, 25, 29, ...} is the multiplicative semigroup of positive integers generated by 1 and the primes p = 1 (mod 4), and w_1(n) is the number of different prime factors p = 1 (mod 4) of n.
Sum_{n odd} (-1)^((n-1)/2)*mu(n)*x^n/(1 - x^(2*n)) = Sum_{n in S_3} (2^w_3(n))*x^n, where S_3 = {1, 3, 7, 9, 11, 19, 21, ...} is the multiplicative semigroup of positive integers generated by 1 and the primes p = 3 (mod 4), and where w_3(n) is the number of different prime factors p = 3 (mod 4) of n. (End)
G.f. A(x) satisfies: A(x) = x - Sum_{k>=2} A(x^k). - Ilya Gutkovskiy, May 11 2019
a(n) = sign(A023900(n)) * [A007947(n) = n] where [] is the Iverson bracket. - I. V. Serov, May 15 2019
a(n) = Sum_{k = 1..n} gcd(k, n)*a(gcd(k, n)) = Sum_{d divides n} a(d)*d*phi(n/d). - Peter Bala, Jan 16 2024

A001511 The ruler function: exponent of the highest power of 2 dividing 2n. Equivalently, the 2-adic valuation of 2n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of 2's dividing 2*n.
a(n) is equivalently the exponent of the smallest power of 2 which does not divide n. - David James Sycamore, Oct 02 2023
a(n) - 1 is the number of trailing zeros in the binary expansion of n.
If you are counting in binary and the least significant bit is numbered 1, the next bit is 2, etc., a(n) is the bit that is incremented when increasing from n-1 to n. - Jud McCranie, Apr 26 2004
Number of steps to reach an integer starting with (n+1)/2 and using the map x -> x*ceiling(x) (cf. A073524).
a(n) is the number of the disk to be moved at the n-th step of the optimal solution to Towers of Hanoi problem (comment from Andreas M. Hinz).
Shows which bit to flip when creating the binary reflected Gray code (bits are numbered from the right, offset is 1). This is essentially equivalent to Hinz's comment. - Adam Kertesz, Jul 28 2001
a(n) is the Hamming distance between n and n-1 (in binary). This is equivalent to Kertesz's comments above. - Tak-Shing Chan (chan12(AT)alumni.usc.edu), Feb 25 2003
Let S(0) = {1}, S(n) = {S(n-1), S(n-1)-{x}, x+1} where x = last term of S(n-1); sequence gives S(infinity). - Benoit Cloitre, Jun 14 2003
The sum of all terms up to and including the first occurrence of m is 2^m-1. - Donald Sampson (marsquo(AT)hotmail.com), Dec 01 2003
m appears every 2^m terms starting with the 2^(m-1)th term. - Donald Sampson (marsquo(AT)hotmail.com), Dec 08 2003
Sequence read mod 4 gives A092412. - Philippe Deléham, Mar 28 2004
If q = 2n/2^A001511(n) and if b(m) is defined by b(0)=q-1 and b(m)=2*b(m-1)+1, then 2n = b(A001511(n)) + 1. - Gerald McGarvey, Dec 18 2004
Repeating pattern ABACABADABACABAE ... - Jeremy Gardiner, Jan 16 2005
Relation to C(n) = Collatz function iteration using only odd steps: a(n) is the number of right bits set in binary representation of A004767(n) (numbers of the form 4*m+3). So for m=A004767(n) it follows that there are exactly a(n) recursive steps where m
Between every two instances of any positive integer m there are exactly m distinct values (1 through m-1 and one value greater than m). - Franklin T. Adams-Watters, Sep 18 2006
Number of divisors of n of the form 2^k. - Giovanni Teofilatto, Jul 25 2007
Every prefix up to (but not including) the first occurrence of some k >= 2 is a palindrome. - Gary W. Adamson, Sep 24 2008
1 interleaved with (2 interleaved with (3 interleaved with ( ... ))). - Eric D. Burgess (ericdb(AT)gmail.com), Oct 17 2009
A054525 (Möbius transform) * A001511 = A036987 = A047999^(-1) * A001511. - Gary W. Adamson, Oct 26 2009
Equals A051731 * A036987, (inverse Möbius transform of the Fredholm-Rueppel sequence) = A047999 * A036987. - Gary W. Adamson, Oct 26 2009
Cf. A173238, showing links between generalized ruler functions and A000041. - Gary W. Adamson, Feb 14 2010
Given A000041, P(x) = A(x)/A(x^2) with P(x) = (1 + x + 2x^2 + 3x^3 + 5x^4 + 7x^5 + ...), A(x) = (1 + x + 3x^2 + 4x^3 + 10x^4 + 13x^5 + ...), A(x^2) = (1 + x^2 + 3x^4 + 4x^6 + 10x^8 + ...), where A092119 = (1, 1, 3, 4, 10, ...) = Euler transform of the ruler sequence, A001511. - Gary W. Adamson, Feb 11 2010
Subtracting 1 from every term and deleting any 0's yields the same sequence, A001511. - Ben Branman, Dec 28 2011
In the listing of the compositions of n as lists in lexicographic order, a(k) is the last part of composition(k) for all k <= 2^(n-1) and all n, see example. - Joerg Arndt, Nov 12 2012
According to Hinz, et al. (see links), this sequence was studied by Louis Gros in his 1872 pamphlet "Théorie du Baguenodier" and has therefore been called the Gros sequence.
First n terms comprise least squarefree word of length n using positive integers, where "squarefree" means that the word contains no consecutive identical subwords; e.g., 1 contains no square; 11 contains a square but 12 does not; 121 contains no square; both 1211 and 1212 have squares but 1213 does not; etc. - Clark Kimberling, Sep 05 2013
Length of 0-run starting from 2 (10, 100, 110, 1000, 1010, ...), or length of 1-run starting from 1 (1, 11, 101, 111, 1001, 1011, ...) of every second number, from right to left in binary representation. - Armands Strazds, Apr 13 2017
a(n) is also the frequency of the largest part in the integer partition having viabin number n. The viabin number of an integer partition is defined in the following way. Consider the southeast border of the Ferrers board of the integer partition and consider the binary number obtained by replacing each east step with 1 and each north step, except the last one, with 0. The corresponding decimal form is, by definition, the viabin number of the given integer partition. "Viabin" is coined from "via binary". For example, consider the integer partition [2,2,2,1]. The southeast border of its Ferrers board yields 10100, leading to the viabin number 20. - Emeric Deutsch, Jul 24 2017
As A000005(n) equals the number of even divisors of 2n and A001227(n) = A001227(2n), the formula A001511(n) = A000005(n)/A001227(n) might be read as "The number of even divisors of 2n is always divisible by the number of odd divisors of 2n" (where number of divisors means sum of zeroth powers of divisors). Conjecture: For any nonnegative integer k, the sum of the k-th powers of even divisors of n is always divisible by the sum of the k-th powers of odd divisors of n. - Ivan N. Ianakiev, Jul 06 2019
From Benoit Cloitre, Jul 14 2022: (Start)
To construct the sequence, start from 1's separated by a place 1,,1,,1,,1,,1,,1,,1,,1,,1,,1,,1,,1,,1,,1,...
Then put the 2's in every other remaining place
1,2,1,,1,2,1,,1,2,1,,1,2,1,,1,2,1,,1,2,1,,1,2,1,...
Then the 3's in every other remaining place
1,2,1,3,1,2,1,,1,2,1,3,1,2,1,,1,2,1,3,1,2,1,,1,2,1,...
Then the 4's in every other remaining place
1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,,1,2,1,3,1,2,1,4,1,2,1,...
By iterating this process, we get the ruler function 1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,5,1,2,1,3,1,2,1,4,1,2,1,... (End)
a(n) is the least positive integer k for which there does not exist i+j=n and a(i)=a(j)=k (cf. A322523). - Rémy Sigrist and Jianing Song, Aug 23 2022
a(n) is the smallest positive integer that does not occur in the coincidences of the sequence so far a(1..n-1) and its reverse. - Neal Gersh Tolunsky, Jan 18 2023
The geometric mean of this sequence approaches the Somos constant (A112302). - Jwalin Bhatt, Jan 31 2025

Examples

			For example, 2^1|2, 2^2|4, 2^1|6, 2^3|8, 2^1|10, 2^2|12, ... giving the initial terms 1, 2, 1, 3, 1, 2, ...
From _Omar E. Pol_, Jun 12 2009: (Start)
Triangle begins:
1;
2,1;
3,1,2,1;
4,1,2,1,3,1,2,1;
5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1;
6,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1;
7,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,6,1,2,1,3,...
(End)
S(0) = {} S(1) = 1 S(2) = 1, 2, 1 S(3) = 1, 2, 1, 3, 1, 2, 1 S(4) = 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1. - Yann David (yann_david(AT)hotmail.com), Mar 21 2010
From _Joerg Arndt_, Nov 12 2012: (Start)
The 16 compositions of 5 as lists in lexicographic order:
[ n]  a(n)  composition
[ 1]  [ 1]  [ 1 1 1 1 1 ]
[ 2]  [ 2]  [ 1 1 1 2 ]
[ 3]  [ 1]  [ 1 1 2 1 ]
[ 4]  [ 3]  [ 1 1 3 ]
[ 5]  [ 1]  [ 1 2 1 1 ]
[ 6]  [ 2]  [ 1 2 2 ]
[ 7]  [ 1]  [ 1 3 1 ]
[ 8]  [ 4]  [ 1 4 ]
[ 9]  [ 1]  [ 2 1 1 1 ]
[10]  [ 2]  [ 2 1 2 ]
[11]  [ 1]  [ 2 2 1 ]
[12]  [ 3]  [ 2 3 ]
[13]  [ 1]  [ 3 1 1 ]
[14]  [ 2]  [ 3 2 ]
[15]  [ 1]  [ 4 1 ]
[16]  [ 5]  [ 5 ]
a(n) is the last part in each list.
(End)
From _Omar E. Pol_, Aug 20 2013: (Start)
Also written as a triangle in which the right border gives A000027 and row lengths give A011782 and row sums give A000079 the sequence begins:
1;
2;
1,3;
1,2,1,4;
1,2,1,3,1,2,1,5;
1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,6;
1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,7;
(End)
G.f. = x + 2*x^2 + x^3 + 3*x^4 + x^5 + 2*x^6 + x^7 + 4*x^8 + x^9 + 2*x^10 + ...
		

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003.
  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 2nd ed., 2001-2003; see Dim- and Dim+ on p. 98; Dividing Rulers, on pp. 436-437; The Ruler Game, pp. 469-470; Ruler Fours, Fives, ... Fifteens on p. 470.
  • L. Gros, Théorie du Baguenodier, Aimé Vingtrinier, Lyon, 1872.
  • R. K. Guy, Unsolved Problems in Number Theory, Springer, 1st edition, 1981. See section E22.
  • A. M. Hinz, The Tower of Hanoi, in Algebras and combinatorics (Hong Kong, 1997), 277-289, Springer, Singapore, 1999.
  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.1.3, Problem 41, p. 589.
  • Andrew Schloss, "Towers of Hanoi" composition, in The Digital Domain. Elektra/Asylum Records 9 60303-2, 1983. Works by Jaffe (Finale to "Silicon Valley Breakdown"), McNabb ("Love in the Asylum"), Schloss ("Towers of Hanoi"), Mattox ("Shaman"), Rush, Moorer ("Lions are Growing") and others.
  • 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).

Crossrefs

Column 1 of table A050600.
Sequence read mod 2 gives A035263.
Sequence is bisection of A007814, A050603, A050604, A067029, A089309.
This is Guy Steele's sequence GS(4, 2) (see A135416).
Cf. A005187 (partial sums), A085058 (bisection), A112302 (geometric mean), A171977 (2^a(n)).
Cf. A287896, A002487, A209229 (Mobius trans.), A092673 (Dirichlet inv.).
Cf. generalized ruler functions for k=3,4,5: A051064, A115362, A055457.

Programs

  • Haskell
    a001511 n = length $ takeWhile ((== 0) . (mod n)) a000079_list
    -- Reinhard Zumkeller, Sep 27 2011
    
  • Haskell
    a001511 n | odd n = 1 | otherwise = 1 + a001511 (n `div` 2)
    -- Walt Rorie-Baety, Mar 22 2013
    
  • MATLAB
    nmax=5;r=1;for n=2:nmax;r=[r n r];end % Adriano Caroli, Feb 26 2016
    
  • Magma
    [Valuation(2*n,2): n in [1..105]]; // Bruno Berselli, Nov 23 2015
    
  • Maple
    A001511 := n->2-wt(n)+wt(n-1); # where wt is defined in A000120
    # This is the binary logarithm of the denominator of (256^n-1)B_{8n}/n, in Maple parlance a := n -> log[2](denom((256^n-1)*bernoulli(8*n)/n)). - Peter Luschny, May 31 2009
    A001511 := n -> padic[ordp](2*n,2): seq(A001511(n), n=1..105);  # Peter Luschny, Nov 26 2010
    a:= n-> ilog2((Bits[Xor](2*n, 2*n-1)+1)/2): seq(a(n), n=1..50);  # Gary Detlefs, Dec 13 2018
  • Mathematica
    Array[ If[ Mod[ #, 2] == 0, FactorInteger[ # ][[1, 2]], 0] &, 105] + 1 (* or *)
    Nest[ Flatten[ # /. a_Integer -> {1, a + 1}] &, {1}, 7] (* Robert G. Wilson v, Mar 04 2005 *)
    IntegerExponent[2*n, 2] (* Alexander R. Povolotsky, Aug 19 2011 *)
    myHammingDistance[n_, m_] := Module[{g = Max[m, n], h = Min[m, n]}, b1 = IntegerDigits[g, 2]; b2 = IntegerDigits[h, 2, Length[b1]]; HammingDistance[b1, b2]] (* Vladimir Shevelev A206853 *) Table[ myHammingDistance[n, n - 1], {n, 111}] (* Robert G. Wilson v, Apr 05 2012 *)
    Table[Position[Reverse[IntegerDigits[n,2]],1,1,1],{n,110}]//Flatten (* Harvey P. Dale, Aug 18 2017 *)
  • PARI
    a(n) = sum(k=0,floor(log(n)/log(2)),floor(n/2^k)-floor((n-1)/2^k)) /* Ralf Stephan */
    
  • PARI
    a(n)=if(n%2,1,factor(n)[1,2]+1) /* Jon Perry, Jun 06 2004 */
    
  • PARI
    {a(n) = if( n, valuation(n, 2) + 1, 0)}; /* Michael Somos, Sep 30 2006 */
    
  • PARI
    {a(n)=if(n==1,1,polcoeff(x-sum(k=1, n-1, a(k)*x^k*(1-x^k)*(1-x+x*O(x^n))), n))} /* Paul D. Hanna, Jun 22 2007 */
    
  • Python
    def a(n): return bin(n)[2:][::-1].index("1") + 1 # Indranil Ghosh, May 11 2017
    
  • Python
    A001511 = lambda n: (n&-n).bit_length() # M. F. Hasler, Apr 09 2020
    
  • Python
    def A001511(n): return (~n & n-1).bit_length()+1 # Chai Wah Wu, Jul 01 2022
    
  • Sage
    [valuation(2*n,2) for n in (1..105)]  # Bruno Berselli, Nov 23 2015
    
  • Scheme
    (define (A001511 n) (let loop ((n n) (e 1)) (if (odd? n) e (loop (/ n 2) (+ 1 e))))) ;; Antti Karttunen, Oct 06 2017

Formula

a(n) = A007814(n) + 1 = A007814(2*n).
a(2*n+1) = 1; a(2*n) = 1 + a(n). - Philippe Deléham, Dec 08 2003
a(n) = 2 - A000120(n) + A000120(n-1), n >= 1. - Daniele Parisse
a(n) = 1 + log_2(abs(A003188(n) - A003188(n-1))).
Multiplicative with a(p^e) = e+1 if p = 2; 1 if p > 2. - David W. Wilson, Aug 01 2001
For any real x > 1/2: lim_{N->infinity} (1/N)*Sum_{n=1..N} x^(-a(n)) = 1/(2*x-1); also lim_{N->infinity} (1/N)*Sum_{n=1..N} 1/a(n) = log(2). - Benoit Cloitre, Nov 16 2001
s(n) = Sum_{k=1..n} a(k) is asymptotic to 2*n since s(n) = 2*n - A000120(n). - Benoit Cloitre, Aug 31 2002
For any n >= 0, for any m >= 1, a(2^m*n + 2^(m-1)) = m. - Benoit Cloitre, Nov 24 2002
a(n) = Sum_{d divides n and d is odd} mu(d)*tau(n/d). - Vladeta Jovovic, Dec 04 2002
G.f.: A(x) = Sum_{k>=0} x^(2^k)/(1-x^(2^k)). - Ralf Stephan, Dec 24 2002
a(1) = 1; for n > 1, a(n) = a(n-1) + (-1)^n*a(floor(n/2)). - Vladeta Jovovic, Apr 25 2003
A fixed point of the mapping 1->12; 2->13; 3->14; 4->15; 5->16; ... . - Philippe Deléham, Dec 13 2003
Product_{k>0} (1+x^k)^a(k) is g.f. for A000041(). - Vladeta Jovovic, Mar 26 2004
G.f. A(x) satisfies A(x) = A(x^2) + x/(1-x). - Franklin T. Adams-Watters, Feb 09 2006
a(A118413(n,k)) = A002260(n,k); = a(A118416(n,k)) = A002024(n,k); a(A014480(n)) = A003602(A014480(n)). - Reinhard Zumkeller, Apr 27 2006
Ordinal transform of A003602. - Franklin T. Adams-Watters, Aug 28 2006 (The ordinal transform of a sequence b_0, b_1, b_2, ... is the sequence a_0, a_1, a_2, ... where a_n is the number of times b_n has occurred in {b_0 ... b_n}.)
Could be extended to n <= 0 using a(-n) = a(n), a(0) = 0, a(2*n) = a(n)+1 unless n=0. - Michael Somos, Sep 30 2006
A094267(2*n) = A050603(2*n) = A050603(2*n + 1) = a(n). - Michael Somos, Sep 30 2006
Sequence = A129360 * A000005 = M*V, where M = an infinite lower triangular matrix and V = d(n) as a vector: [1, 2, 2, 3, 2, 4, ...]. - Gary W. Adamson, Apr 15 2007
Row sums of triangle A130093. - Gary W. Adamson, May 13 2007
Dirichlet g.f.: zeta(s)*2^s/(2^s-1). - Ralf Stephan, Jun 17 2007
a(n) = -Sum_{d divides n} mu(2*d)*tau(n/d). - Benoit Cloitre, Jun 21 2007
G.f.: x/(1-x) = Sum_{n>=1} a(n)*x^n*( 1 - x^n ). - Paul D. Hanna, Jun 22 2007
2*n = 2^a(n)* A000265(n). - Eric Desbiaux, May 14 2009 [corrected by Alejandro Erickson, Apr 17 2012]
Multiplicative with a(2^k) = k + 1, a(p^k) = 1 for any odd prime p. - Franklin T. Adams-Watters, Jun 09 2009
With S(n): 2^n - 1 first elements of the sequence then S(0) = {} (empty list) and if n > 0, S(n) = S(n-1), n, S(n-1). - Yann David (yann_david(AT)hotmail.com), Mar 21 2010
a(n) = log_2(A046161(n)/A046161(n-1)). - Johannes W. Meijer, Nov 04 2012
a((2*n-1)*2^p) = p+1, p >= 0 and n >= 1. - Johannes W. Meijer, Feb 05 2013
a(n+1) = 1 + Sum_{j=0..ceiling(log_2(n+1))} (j * (1 - abs(sign((n mod 2^(j + 1)) - 2^j + 1)))). - Enrico Borba, Oct 01 2015
Conjecture: a(n) = A181988(n)/A003602(n). - L. Edson Jeffery, Nov 21 2015
a(n) = log_2(A006519(n)) + 1. - Doug Bell, Jun 02 2017
Inverse Moebius transform of A209229. - Andrew Howroyd, Aug 04 2018
a(n) = 1 + (A183063(n)/A001227(n)). - Omar E. Pol, Nov 06 2018 (after Franklin T. Adams-Watters)
a(n) = log_2((Xor(2*n,2*n-1)+1)/2). - Gary Detlefs, Dec 13 2018
(2^(a(n)-1)-1)*(n mod 4) = 2*floor(((n+1) mod 4)/3). - Gary Detlefs, Dec 14 2018
a(n) = A000005(n)/A001227(n). - Ivan N. Ianakiev, Jul 05 2019
a(n) = Sum_{j=1..r} (j/2^j)*(Product_{k=1..j} (1 - (-1)^floor( (n+2^(j-1))/2^(k-1) ))), for n < a predefined 2^r. - Adriano Caroli, Sep 30 2019

Extensions

Name edited following suggestion by David James Sycamore, Oct 05 2023

A054525 Triangle T(n,k): T(n,k) = mu(n/k) if k divides n, T(n,k) = 0 otherwise (n >= 1, 1 <= k <= n).

Original entry on oeis.org

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

Author

N. J. A. Sloane, Apr 09 2000

Keywords

Comments

A051731 = the inverse of this triangle = A129372 * A115361. - Gary W. Adamson, Apr 15 2007
If a column T(n,0)=0 is added, these are the coefficients of the necklace polynomials multiplied by n [Moree, Metropolis]. - R. J. Mathar, Nov 11 2008

Examples

			Triangle (with rows n >= 1 and columns k >= 1) begins as follows:
   1;
  -1,  1;
  -1,  0,  1;
   0, -1,  0,  1;
  -1,  0,  0,  0,  1;
   1, -1, -1,  0,  0,  1;
  -1,  0,  0,  0,  0,  0,  1;
   0,  0,  0, -1,  0,  0,  0,  1; ...
Matrix inverse is triangle A051731:
  1;
  1, 1;
  1, 0, 1;
  1, 1, 0, 1;
  1, 0, 0, 0, 1;
  1, 1, 1, 0, 0, 1;
  1, 0, 0, 0, 0, 0, 1;
  1, 1, 0, 1, 0, 0, 0, 1; ...
		

Crossrefs

Programs

  • Maple
    A054525 := proc(n,k)
        if n mod k = 0 then
            numtheory[mobius](n/k) ;
        else
            0 ;
        end if;
    end proc: # R. J. Mathar, Oct 21 2012
  • Mathematica
    t[n_, k_] := If[Divisible[n, k], MoebiusMu[n/k ], 0]; Table[t[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jan 14 2014 *)
  • PARI
    tabl(nn) = {T = matrix(nn, nn, n, k, if (! (n % k), moebius(n/k), 0)); for (n=1, nn, for (k=1, n, print1(T[n, k], ", ");); print(););} \\ Michel Marcus, Mar 28 2015
    
  • PARI
    row(n) = Vecrev(sumdiv(n, d, moebius(d)*x^(n/d))/x); \\ Michel Marcus, Aug 24 2021
    
  • Python
    from math import isqrt, comb
    from sympy import mobius
    def A054525(n): return 0 if (a:=(m:=isqrt(k:=n<<1))+(k>m*(m+1)))%(b:=n-comb(a,2)) else mobius(a//b) # Chai Wah Wu, Nov 13 2024

Formula

Matrix inverse of triangle A051731, where A051731(n, k) = 1 if k|n, 0 otherwise. - Paul D. Hanna, Jan 09 2006
Equals = A129360 * A115359 as infinite lower triangular matrices. - Gary W. Adamson, Apr 15 2007
Bivariate g.f.: Sum_{n, k >= 1} T(n, k)*x^n*y^k = Sum_{m >= 1} mu(m)*x^m*y/(1 - x^m*y). - Petros Hadjicostas, Jun 25 2019

A129501 A103994 * A115361.

Original entry on oeis.org

1, 2, 1, -1, 0, 1, 3, 2, 0, 1, -1, 0, 0, 0, 1, -2, -1, 2, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 4, 3, 0, 2, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, -2, -1, 0, 0, 2, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -3, -2, 3, -1, 0, 2, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 1

Author

Gary W. Adamson, Apr 17 2007

Keywords

Comments

Row sums = A129502: (1, 3, 0, 6, 0, 0, 0, 10, 0, 0, ...).

Examples

			First few rows of the triangle are:
   1;
   2,  1;
  -1,  0,  1;
   3,  2,  0,  1;
  -1,  0,  0,  0,  1;
  -2, -1,  2,  0,  0,  1;
  -1,  0,  0,  0,  0,  0,  1;
   4,  3,  0,  2,  0,  0,  0,  1;
   0,  0, -1,  0,  0,  0,  0,  0,  1;
  ...
		

Crossrefs

Column 1 is A317673 (Moebius transform of A129502).
Row sums are A129502.

Programs

  • Mathematica
    b[n_] := Module[{e}, Sum[e = IntegerExponent[d, 2]; If[d == 2^e, MoebiusMu[n/d] Binomial[2 + e, 2], 0], {d, Divisors[n]}]];
    T[n_, k_] := If[Divisible[n, k], b[n/k], 0];
    Table[T[n, k], {n, 1, 13}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 24 2019 *)
  • PARI
    T(n,k)={ if(n%k, 0, sumdiv(n/k, d, my(e=valuation(d, 2)); if(d==1<Andrew Howroyd, Aug 03 2018

Formula

A103994 * A115361 as infinite lower triangular matrices.
T(n,k) = A317673(n/k) for k | n, T(n,k) = 0 otherwise. - Andrew Howroyd, Aug 03 2018

Extensions

Terms a(56) and beyond from Andrew Howroyd, Aug 03 2018
Showing 1-10 of 11 results. Next