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

A038712 Let k be the exponent of highest power of 2 dividing n (A007814); a(n) = 2^(k+1)-1.

Original entry on oeis.org

1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 31, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 63, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 31, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 127, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 31, 1, 3, 1, 7, 1, 3, 1, 15, 1, 3, 1, 7, 1, 3, 1, 63, 1, 3
Offset: 1

Views

Author

Henry Bottomley, May 02 2000

Keywords

Comments

n XOR n-1, i.e., nim-sum of a pair of consecutive numbers.
Denominator of quotient sigma(2*n)/sigma(n). - Labos Elemer, Nov 04 2003
a(n) = the Towers of Hanoi disc moved at the n-th move, using standard moves with discs labeled (1, 3, 7, 15, ...) starting from top (smallest = 1). - Gary W. Adamson, Oct 26 2009
Equals row sums of triangle A168312. - Gary W. Adamson, Nov 22 2009
In the binary expansion of n, delete everything left of the rightmost 1 bit, and set all bits to the right of it. - Ralf Stephan, Aug 22 2013
Every finite sequence of positive integers summing to n may be termwise dominated by a subsequence of the first n values in this sequence [see Bannister et al., 2013]. - David Eppstein, Aug 31 2013
Sum of powers of 2 dividing n. - Omar E. Pol, Aug 18 2019
Given the binary expansion of (n-1) as {b[k-1], b[k-2], ..., b[2], b[1], b[0]}, then the binary expansion of a(n) is {bitand(b[k-1], b[k-2], ..., b[2], b[1], b[0]), bitand(b[k-2], ..., b[2], b[1], b[0]), ..., bitand(b[2], b[1], b[0]), bitand(b[1], b[0]), b[0], 1}. Recursively stated - 0th bit (L.S.B) of a(n), a(n)[0] = 1, a(n)[i] = bitand(a(n)[i-1], (n-1)[i-1]), where n[i] = i-th bit in the binary expansion of n. - Chinmaya Dash, Jun 27 2020

Examples

			a(6) = 3 because 110 XOR 101 = 11 base 2 = 3.
From _Omar E. Pol_, Aug 18 2019: (Start)
Illustration of initial terms:
a(n) is also the area of the n-th region of an infinite diagram of compositions (ordered partitions) of the positive integers, where the length of the n-th horizontal line segment is equal to A001511(n) and the length of the n-th vertical line segment is equal to A006519(n), as shown below (first eight regions):
-----------------------------
n    a(n)    Diagram
-----------------------------
.            _ _ _ _
1     1     |_| | | |
2     3     |_ _| | |
3     1     |_|   | |
4     7     |_ _ _| |
5     1     |_| |   |
6     3     |_ _|   |
7     1     |_|     |
8    15     |_ _ _ _|
.
The above diagram represents the eight compositions of 4: [1,1,1,1],[2,1,1],[1,2,1],[3,1],[1,1,2],[2,2],[1,3],[4].
(End)
		

Crossrefs

A038713 translated from binary, diagonals of A003987 on either side of main diagonal.
Cf. A062383. Partial sums give A080277.
Bisection of A089312. Cf. A088837.
a(n)-1 is exponent of 2 in A089893(n).
Cf. A130093.
This is Guy Steele's sequence GS(6, 2) (see A135416).
Cf. A001620, A168312, A220466, A361019 (Dirichlet inverse).

Programs

  • C
    int a(int n) { return n ^ (n-1); } // Russ Cox, May 15 2007
    
  • Haskell
    import Data.Bits (xor)
    a038712 n = n `xor` (n - 1) :: Integer  -- Reinhard Zumkeller, Apr 23 2012
    
  • Maple
    nmax:=98: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 1 to ceil(nmax/(p+2)) do a((2*n-1)*2^p) := 2^(p+1)-1 od: od: seq(a(n), n=1..nmax); # Johannes W. Meijer, Feb 01 2013
    # second Maple program:
    a:= n-> Bits[Xor](n, n-1):
    seq(a(n), n=1..98);  # Alois P. Heinz, Feb 02 2023
  • Mathematica
    Table[Denominator[DivisorSigma[1, 2*n]/DivisorSigma[1, n]], {n, 1, 128}]
    Table[BitXor[(n + 1), n], {n, 0, 100}] (* Vladimir Joseph Stephan Orlovsky, Jul 19 2011 *)
  • PARI
    vector(66,n,bitxor(n-1,n)) \\ Joerg Arndt, Sep 01 2013; corrected by Michel Marcus, Aug 02 2018
    
  • PARI
    A038712(n) = ((1<<(1+valuation(n,2)))-1); \\ Antti Karttunen, Nov 24 2024
    
  • Python
    def A038712(n): return n^(n-1) # Chai Wah Wu, Jul 05 2022

Formula

a(n) = A110654(n-1) XOR A008619(n). - Reinhard Zumkeller, Feb 05 2007
a(n) = 2^A001511(n) - 1 = 2*A006519(n) - 1 = 2^(A007814(n)+1) - 1.
Multiplicative with a(2^e) = 2^(e+1)-1, a(p^e) = 1, p > 2. - Vladeta Jovovic, Nov 06 2001; corrected by Jianing Song, Aug 03 2018
Sum_{n>0} a(n)*x^n/(1+x^n) = Sum_{n>0} x^n/(1-x^n). Inverse Moebius transform of A048298. - Vladeta Jovovic, Jan 02 2003
From Ralf Stephan, Jun 15 2003: (Start)
G.f.: Sum_{k>=0} 2^k*x^2^k/(1 - x^2^k).
a(2*n+1) = 1, a(2*n) = 2*a(n)+1. (End)
Equals A130093 * [1, 2, 3, ...]. - Gary W. Adamson, May 13 2007
Sum_{i=1..n} (-1)^A000120(n-i)*a(i) = (-1)^(A000120(n)-1)*n. - Vladimir Shevelev, Mar 17 2009
Dirichlet g.f.: zeta(s)/(1 - 2^(1-s)). - R. J. Mathar, Mar 10 2011
a(n) = A086799(2*n) - 2*n. - Reinhard Zumkeller, Aug 07 2011
a((2*n-1)*2^p) = 2^(p+1)-1, p >= 0. - Johannes W. Meijer, Feb 01 2013
a(n) = A000225(A001511(n)). - Omar E. Pol, Aug 31 2013
a(n) = A000203(n)/A000593(n). - Ivan N. Ianakiev and Omar E. Pol, Dec 14 2017
L.g.f.: -log(Product_{k>=0} (1 - x^(2^k))) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, Mar 15 2018
a(n) = 2^(1 + (A183063(n)/A001227(n))) - 1. - Omar E. Pol, Nov 06 2018
a(n) = sigma(n)/(sigma(2*n) - 2*sigma(n)) = 3*sigma(n)/(sigma(4*n) - 4*sigma(n)) = 7*sigma(n)/(sigma(8*n) - 8*sigma(n)), where sigma(n) = A000203(n). - Peter Bala, Jun 10 2022
Sum_{k=1..n} a(k) ~ n*log_2(n) + (1/2 + (gamma - 1)/log(2))*n, where gamma is Euler's constant (A001620). - Amiram Eldar, Nov 24 2022
a(n) = Sum_{d divides n} m(d)*phi(d), where m(n) = Sum_{d divides n} (-1)^(d+1)* mobius(d). - Peter Bala, Jan 23 2024

Extensions

Definition corrected by N. J. A. Sloane, Sep 07 2015 at the suggestion of Marc LeBrun
Name corrected by Wolfdieter Lang, Aug 30 2016

A220466 a((2*n-1)*2^p) = 4^p*(n-1) + 2^(p-1)*(1+2^p), p >= 0 and n >= 1.

Original entry on oeis.org

1, 3, 2, 10, 3, 7, 4, 36, 5, 11, 6, 26, 7, 15, 8, 136, 9, 19, 10, 42, 11, 23, 12, 100, 13, 27, 14, 58, 15, 31, 16, 528, 17, 35, 18, 74, 19, 39, 20, 164, 21, 43, 22, 90, 23, 47, 24, 392, 25, 51, 26, 106, 27, 55, 28, 228, 29, 59, 30, 122, 31, 63, 32, 2080, 33, 67, 34, 138, 35
Offset: 1

Views

Author

Johannes W. Meijer, Dec 24 2012

Keywords

Comments

The a(n) appeared in the analysis of A220002, a sequence related to the Catalan numbers.
The first Maple program makes use of a program by Peter Luschny for the calculation of the a(n) values. The second Maple program shows that this sequence has a beautiful internal structure, see the first formula, while the third Maple program makes optimal use of this internal structure for the fast calculation of a(n) values for large n.
The cross references lead to sequences that have the same internal structure as this sequence.

Crossrefs

Cf. A000027 (the natural numbers), A000120 (1's-counting sequence), A000265 (remove 2's from n), A001316 (Gould's sequence), A001511 (the ruler function), A003484 (Hurwitz-Radon numbers), A003602 (a fractal sequence), A006519 (highest power of 2 dividing n), A007814 (binary carry sequence), A010060 (Thue-Morse sequence), A014577 (dragon curve), A014707 (dragon curve), A025480 (nim-values), A026741, A035263 (first Feigenbaum symbolic sequence), A037227, A038712, A048460, A048896, A051176, A053381 (smooth nowhere-zero vector fields), A055975 (Gray code related), A059134, A060789, A060819, A065916, A082392, A085296, A086799, A088837, A089265, A090739, A091512, A091519, A096268, A100892, A103391, A105321 (a fractal sequence), A109168 (a continued fraction), A117973, A129760, A151930, A153733, A160467, A162728, A181988, A182241, A191488 (a companion to Gould's sequence), A193365, A220466 (this sequence).

Programs

  • Haskell
    -- Following Ralf Stephan's recurrence:
    import Data.List (transpose)
    a220466 n = a006519_list !! (n-1)
    a220466_list = 1 : concat
       (transpose [zipWith (-) (map (* 4) a220466_list) a006519_list, [2..]])
    -- Reinhard Zumkeller, Aug 31 2014
  • Maple
    # First Maple program
    a := n -> 2^padic[ordp](n, 2)*(n+1)/2 : seq(a(n), n=1..69); # Peter Luschny, Dec 24 2012
    # Second Maple program
    nmax:=69: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 1 to ceil(nmax/(p+2)) do a((2*n-1)*2^p) := 4^p*(n-1)  + 2^(p-1)*(1+2^p) od: od: seq(a(n), n=1..nmax);
    # Third Maple program
    nmax:=69: for p from 0 to ceil(simplify(log[2](nmax))) do n:=2^p: n1:=1: while n <= nmax do a(n) := 4^p*(n1-1)+2^(p-1)*(1+2^p): n:=n+2^(p+1): n1:= n1+1: od: od:  seq(a(n), n=1..nmax);
  • Mathematica
    A220466 = Module[{n, p}, p = IntegerExponent[#, 2]; n = (#/2^p + 1)/2; 4^p*(n - 1) + 2^(p - 1)*(1 + 2^p)] &; Array[A220466, 50] (* JungHwan Min, Aug 22 2016 *)
  • PARI
    a(n)=if(n%2,n\2+1,4*a(n/2)-2^valuation(n/2,2)) \\ Ralf Stephan, Dec 17 2013
    

Formula

a((2*n-1)*2^p) = 4^p*(n-1) + 2^(p-1)*(1+2^p), p >= 0 and n >= 1. Observe that a(2^p) = A007582(p).
a(n) = ((n+1)/2)*(A060818(n)/A060818(n-1))
a(n) = (-1/64)*(q(n+1)/q(n))/(2*n+1) with q(n) = (-1)^(n+1)*2^(4*n-5)*(2*n)!*A060818(n-1) or q(n) = (1/8)*A220002(n-1)*1/(A098597(2*n-1)/A046161(2*n))*1/(A008991(n-1)/A008992(n-1))
Recurrence: a(2n) = 4a(n) - 2^A007814(n), a(2n+1) = n+1. - Ralf Stephan, Dec 17 2013

A088838 Numerator of the quotient sigma(3n)/sigma(n).

Original entry on oeis.org

4, 4, 13, 4, 4, 13, 4, 4, 40, 4, 4, 13, 4, 4, 13, 4, 4, 40, 4, 4, 13, 4, 4, 13, 4, 4, 121, 4, 4, 13, 4, 4, 13, 4, 4, 40, 4, 4, 13, 4, 4, 13, 4, 4, 40, 4, 4, 13, 4, 4, 13, 4, 4, 121, 4, 4, 13, 4, 4, 13, 4, 4, 40, 4, 4, 13, 4, 4, 13, 4, 4, 40, 4, 4, 13, 4, 4, 13, 4, 4, 364, 4, 4, 13, 4, 4, 13, 4, 4, 40
Offset: 1

Views

Author

Labos Elemer, Nov 04 2003

Keywords

Crossrefs

Programs

  • Maple
    A088838 := proc(n)
        numtheory[sigma](3*n)/numtheory[sigma](n) ;
        numer(%) ;
    end proc:
    seq(A088838(n),n=1..100) ; # R. J. Mathar, Nov 19 2017
    seq((3^(2+padic:-ordp(n,3))-1)/2, n=1..100); # Robert Israel, Nov 19 2017
  • Mathematica
    k=3; Table[Numerator[DivisorSigma[1, k*n]/DivisorSigma[1, n]], {n, 1, 128}]
  • PARI
    a(n) = numerator(sigma(3*n)/sigma(n)) \\ Felix Fröhlich, Nov 19 2017

Formula

From Robert Israel, Nov 19 2017: (Start)
a(n) = (3^(2+A007949(n))-1)/2.
G.f.: Sum_{k>=0} (3^(k+2)-1)*(x^(3^k)+x^(2*3^k))/(2*(1-x^(3^(k+1)))). (End)
a(n) = sigma(3*n)/(sigma(3*n) - 3*sigma(n)), where sigma(n) = A000203(n). - Peter Bala, Jun 10 2022
From Amiram Eldar, Jan 06 2023: (Start)
a(n) = numerator(A144613(n)/A000203(n)).
Sum_{k=1..n} a(k) ~ (3/log(3))*n*log(n) + (1/2 + 3*(gamma-1)/log(3))*n, where gamma is Euler's constant (A001620).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k)/A080278(k) = 4*A214369 + 1 = 3.728614... . (End)

A088839 Numerator of sigma(4n)/sigma(n).

Original entry on oeis.org

7, 5, 7, 31, 7, 5, 7, 21, 7, 5, 7, 31, 7, 5, 7, 127, 7, 5, 7, 31, 7, 5, 7, 21, 7, 5, 7, 31, 7, 5, 7, 85, 7, 5, 7, 31, 7, 5, 7, 21, 7, 5, 7, 31, 7, 5, 7, 127, 7, 5, 7, 31, 7, 5, 7, 21, 7, 5, 7, 31, 7, 5, 7, 511, 7, 5, 7, 31, 7, 5, 7, 21, 7, 5, 7, 31, 7, 5, 7, 127, 7, 5, 7, 31, 7, 5, 7, 21, 7, 5, 7, 31
Offset: 1

Views

Author

Labos Elemer, Nov 04 2003

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local m;
      m:= padic:-ordp(n,2);
      if m::odd then (2^(m+3)-1)/3 else 2^(m+3)-1 fi
    end proc:
    map(f, [$1..200]); # Robert Israel, Nov 19 2017
  • Mathematica
    k=4; Table[Numerator[DivisorSigma[1, k*n]/DivisorSigma[1, n]], {n, 1, 128}]
  • PARI
    A088839(n) = numerator(sigma(4*n)/sigma(n)); \\ Antti Karttunen, Nov 18 2017

Formula

a(n) = (8*A006519(n)-1)/(1+2*A096268(n)). - Robert Israel, Nov 19 2017
From Amiram Eldar, Jan 06 2023: (Start)
a(n) = numerator(A193553(n)/A000203(n)).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k)/A088840(k) = 3*A065442 + 1 = 5.820085... . (End)

Extensions

Typo in definition corrected by Antti Karttunen, Nov 18 2017

A088840 Denominator of sigma(4n)/sigma(n).

Original entry on oeis.org

1, 1, 1, 7, 1, 1, 1, 5, 1, 1, 1, 7, 1, 1, 1, 31, 1, 1, 1, 7, 1, 1, 1, 5, 1, 1, 1, 7, 1, 1, 1, 21, 1, 1, 1, 7, 1, 1, 1, 5, 1, 1, 1, 7, 1, 1, 1, 31, 1, 1, 1, 7, 1, 1, 1, 5, 1, 1, 1, 7, 1, 1, 1, 127, 1, 1, 1, 7, 1, 1, 1, 5, 1, 1, 1, 7, 1, 1, 1, 31, 1, 1, 1, 7, 1, 1, 1, 5, 1, 1, 1, 7, 1, 1, 1, 21, 1, 1, 1, 7, 1, 1
Offset: 1

Views

Author

Labos Elemer, Nov 04 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Denominator[DivisorSigma[1, 4*n]/DivisorSigma[1, n]], {n, 1, 128}]
    a[n_] := Module[{e = IntegerExponent[n, 2]}, (((-1)^e+2)*(2^(e+1)-1))/3]; Array[a, 100] (* Amiram Eldar, Oct 03 2023 *)
  • PARI
    A088840(n) = denominator(sigma(4*n)/sigma(n)); \\ Antti Karttunen, Nov 18 2017
    
  • PARI
    a(n) = {my(e = valuation(n, 2)); (((-1)^e+2) * (2^(e+1)-1))/3;} \\ Amiram Eldar, Oct 03 2023

Formula

From Amiram Eldar, Oct 03 2023: (Start)
Multiplicative with a(2^e) = (((-1)^e+2)*(2^(e+1)-1))/3 = A213243(e+1), and a(p^e) = 1 for an odd prime p.
a(n) = A213243(A007814(n+1)).
Dirichlet g.f.: ((8^s + 4^s + 2^(s+1))/(8^s + 4^s - 2^(s+2) - 4)) * zeta(s).
Sum_{k=1..n} a(k) = (2*n/(3*log(2))) * (log(n) + gamma - 1 + 7*log(2)/12), where gamma is Euler's constant (A001620). (End)

Extensions

Typo in definition corrected by Antti Karttunen, Nov 18 2017

A088842 Denominator of the quotient sigma(7n)/sigma(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 57, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 57, 1, 1, 1, 1, 1, 1, 8
Offset: 1

Views

Author

Labos Elemer, Nov 04 2003

Keywords

Comments

Sum of powers of 7 dividing n. - Amiram Eldar, Nov 27 2022

Crossrefs

Cf. A000203 (sigma), A001620, A088841 (numerators), A283078 (sigma(7n)).

Programs

  • Mathematica
    Table[Denominator[DivisorSigma[1, 7*n]/DivisorSigma[1, n]], {n, 1, 128}] (* corrected by Ilya Gutkovskiy, Dec 15 2020 *)
    a[n_] := (7^(IntegerExponent[n, 7] + 1) - 1)/6; Array[a, 100] (* Amiram Eldar, Nov 27 2022 *)
  • PARI
    a(n) = denominator(sigma(7*n)/sigma(n)); \\ Michel Marcus, Dec 15 2020
    
  • PARI
    a(n) = (7^(valuation(n, 7) + 1) - 1)/6; \\ Amiram Eldar, Nov 27 2022

Formula

G.f.: Sum_{k>=0} 7^k * x^(7^k) / (1 - x^(7^k)). - Ilya Gutkovskiy, Dec 15 2020
From Amiram Eldar, Nov 27 2022: (Start)
Multiplicative with a(7^e) = (7^(e+1)-1)/6, and a(p^e) = 1 for p != 7.
Dirichlet g.f.: zeta(s) / (1 - 7^(1 - s)).
Sum_{k=1..n} a(k) ~ n*log_7(n) + (1/2 + (gamma - 1)/log(7))*n, where gamma is Euler's constant (A001620). (End)

A088841 Numerator of the quotient sigma(7*n)/sigma(n).

Original entry on oeis.org

8, 8, 8, 8, 8, 8, 57, 8, 8, 8, 8, 8, 8, 57, 8, 8, 8, 8, 8, 8, 57, 8, 8, 8, 8, 8, 8, 57, 8, 8, 8, 8, 8, 8, 57, 8, 8, 8, 8, 8, 8, 57, 8, 8, 8, 8, 8, 8, 400, 8, 8, 8, 8, 8, 8, 57, 8, 8, 8, 8, 8, 8, 57, 8, 8, 8, 8, 8, 8, 57, 8, 8, 8, 8, 8, 8, 57, 8, 8, 8, 8, 8, 8, 57, 8, 8, 8, 8, 8, 8, 57, 8, 8, 8, 8, 8, 8
Offset: 1

Views

Author

Labos Elemer, Nov 04 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Numerator[DivisorSigma[1, 7*n]/DivisorSigma[1, n]], {n, 1, 128}]
  • PARI
    a(n) = numerator(sigma(7*n)/sigma(n)); \\ Amiram Eldar, Mar 22 2024

Formula

From Amiram Eldar, Mar 22 2024: (Start)
a(n) = numerator(A283078(n)/A000203(n)).
a(n) = (7^(A214411(n)+2)-1)/6 = (49*A268354(n)-1)/6.
Sum_{k=1..n} a(k) ~ (7/log(7))*n*log(n) + (9/2 + 7*(gamma-1)/log(7))*n, where gamma is Euler's constant (A001620).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k)/A088842(k) = 1 + 36 * Sum_{k>=1} 1/(7^k-1) = 7.87276224676... . (End)

A100892 a(n) = (2*n-1) XOR (2*n+1), bitwise.

Original entry on oeis.org

2, 6, 2, 14, 2, 6, 2, 30, 2, 6, 2, 14, 2, 6, 2, 62, 2, 6, 2, 14, 2, 6, 2, 30, 2, 6, 2, 14, 2, 6, 2, 126, 2, 6, 2, 14, 2, 6, 2, 30, 2, 6, 2, 14, 2, 6, 2, 62, 2, 6, 2, 14, 2, 6, 2, 30, 2, 6, 2, 14, 2, 6, 2, 254, 2, 6, 2, 14, 2, 6, 2, 30, 2, 6, 2, 14, 2, 6, 2, 62, 2, 6, 2, 14, 2, 6, 2, 30, 2, 6, 2, 14, 2
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 10 2005

Keywords

Crossrefs

Programs

  • Haskell
    a100892 n = (2 * n - 1) `xor` (2 * n + 1)
    a100892_list = zipWith xor (tail a005408_list) a005408_list
    -- Reinhard Zumkeller, Sep 03 2013
    
  • Mathematica
    a[n_]:=BitXor[2*n-1,2*n+1]; a/@Range[100] (* Ivan N. Ianakiev, Jul 04 2019 *)
  • PARI
    a(n)=4*2^valuation(n,2)-2; \\ Ralf Stephan, Aug 21 2013
    
  • Python
    def A100892(n): return ((~n& n-1)<<2)+2 # Chai Wah Wu, Jul 07 2022

Formula

a(n) = 2 * ((n-1) XOR n) = 2*A038712(n).
a(n) = 4*2^A007814(n) - 2.
Recurrence: a(2n) = 2a(n) + 2, a(2n+1) = 2. - Ralf Stephan, Aug 21 2013
a(n) = A088837(n) - 1. - Filip Zaludek, Dec 10 2016
a(n) = A074400(n)/A000593(n) = 2*A000203(n)/A000593(n). - Ivan N. Ianakiev, Jul 04 2019
Showing 1-8 of 8 results.