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.

Previous Showing 21-30 of 73 results. Next

A171977 a(n) = 2^(k+1) where 2^k is the highest power of 2 dividing n.

Original entry on oeis.org

2, 4, 2, 8, 2, 4, 2, 16, 2, 4, 2, 8, 2, 4, 2, 32, 2, 4, 2, 8, 2, 4, 2, 16, 2, 4, 2, 8, 2, 4, 2, 64, 2, 4, 2, 8, 2, 4, 2, 16, 2, 4, 2, 8, 2, 4, 2, 32, 2, 4, 2, 8, 2, 4, 2, 16, 2, 4, 2, 8, 2, 4, 2
Offset: 1

Views

Author

Paul Curtz, Nov 19 2010

Keywords

Comments

When read as a triangle in which the n-th row has 2^n terms, every row is the last half of the next one. All the terms are powers of 2. First column = 2*A000079.
The original definition was: a(n) = (A000265(2n+1) - 1) / A000265(2n).
a(n) seems to be the denominator of Euler(2*n+1,1) but I have no proof of this.
a(n) is also gcd[C(2n,1), C(2n,3), ..., C(2n,2n-1)]. - Franz Vrabec, Oct 22 2012
a(n) is also the ratio r(2n) = s2(2n)/s1(2n) where s1(2n) is the sum of the odd unitary divisors of 2n and s2(2n) is the sum of the even unitary divisors of 2n. - Michel Lagneau, Dec 19 2013
a(n) or a(n)/2 = A006519(n) is known as the Steinhaus sequence in probability theory, proposed as a sequence of asymptotically fair premiums for the St. Petersburg game. - Peter Kern, Aug 28 2015
After the all-1's sequence this is the next sequence in lexicographical order such that the gap between a(n) and the next occurrence of a(n) is given by a(n). - Scott R. Shannon, Oct 16 2019
First 2^(k-1) - 1 terms are also the areas of the successive rectangles and squares of width 2 that are adjacent to any of the four sides of the toothpick structure of A139250 after 2^k stages, with k >= 2. For example: if k = 5 the areas after 32 stages are [2, 4, 2, 8, 2, 4, 2, 16, 2, 4, 2, 8, 2, 4, 2] respectively, the same as the first 15 terms of this sequence. - Omar E. Pol, Dec 29 2020

Crossrefs

Programs

  • Maple
    a := proc(n) local k: k:=1: while frac(n/2^k) = 0 do k := k+1 end do: k := k-1: a(n) := 2^(k+1) end: seq(a(n), n=1..63); # Johannes W. Meijer, Nov 04 2012
    seq(2^(1 + padic[ordp](n, 2)), n = 1..63); # Peter Luschny, Nov 27 2020
  • Mathematica
    Table[-BitXor[-i,i], {i, 200}] (* Peter Luschny, Jun 01 2011 *)
    a[n_] := 2^(IntegerExponent[n, 2] + 1); Array[a, 100] (* Jean-François Alcover, May 09 2017 *)
  • PARI
    A171977(n) = 2^(1+valuation(n,2)); \\ Antti Karttunen, Nov 06 2018
    
  • Python
    def A171977(n): return (n&-n)<<1 # Chai Wah Wu, Jul 13 2022

Formula

a(n) = (A000265(2*n+1)-1)/A000265(2*n).
a(n) = -(-n XOR n). XOR the bitwise operation on the two's complement representation for negative integers. - Peter Luschny, Jun 01 2011
a(n) = A038712(n)+1. - Franz Vrabec, Mar 03 2012
a(n) = 2^A001511(n). - Franz Vrabec, Oct 22 2012
a(n) = A046161(n)/A046161(n-1). - Johannes W. Meijer, Nov 04 2012
a(n) = 2^(1 + (A183063(n)/A001227(n))). - Omar E. Pol, Nov 06 2018
a(n) = 2*A006519(n). - Antti Karttunen, Nov 06 2018

Extensions

I edited this sequence, based on an email message from the author. - N. J. A. Sloane, Nov 20 2010
Definition simplified by N. J. A. Sloane, Mar 18 2012

A380845 The sum of divisors of n that have the same binary weight as n.

Original entry on oeis.org

1, 3, 3, 7, 5, 9, 7, 15, 12, 15, 11, 21, 13, 21, 15, 31, 17, 36, 19, 35, 28, 33, 23, 45, 25, 39, 27, 49, 29, 45, 31, 63, 36, 51, 42, 84, 37, 57, 39, 75, 41, 84, 43, 77, 60, 69, 47, 93, 56, 75, 51, 91, 53, 81, 55, 105, 57, 87, 59, 105, 61, 93, 63, 127, 70, 108
Offset: 1

Views

Author

Amiram Eldar, Feb 05 2025

Keywords

Comments

The number of these divisors is A380844(n).

Examples

			a(6) = 9 because 6 = 110_2 has binary weight 2, 2 of its divisors, 3 = 11_2 and 6, have the same binary weight, and 3 + 6 = 9.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{h = DigitCount[n, 2, 1]}, DivisorSum[n, # &, DigitCount[#, 2, 1] == h &]]; Array[a, 100]
  • PARI
    a(n) = {my(h = hammingweight(n)); sumdiv(n, d, d * (hammingweight(d) == h));}

Formula

a(n) = Sum_{d|n} d * [A000120(d) = A000120(n)], where [ ] is the Iverson bracket.
a(2^n) = 2^(n+1) - 1.
a(n) <= A000203(n) with equality if and only if n is a power of 2.
a(n) = a(A000265(n)) * (2^(A007814(n)+1)-1) = a(A000265(n)) * A038712(n), or equivalently, a(k*2^n) = a(k)*(2^(n+1)-1) for k odd and n >= 0.
In particular, since a(p) = p for an odd prime p, a(p*2^n) = p*(2^(n+1)-1) for an odd prime p and n >= 0.
a(A000396(n)) = A000668(n)^2, assuming that odd perfect numbers do no exist.

A086799 Replace all trailing 0's with 1's in binary representation of n.

Original entry on oeis.org

1, 3, 3, 7, 5, 7, 7, 15, 9, 11, 11, 15, 13, 15, 15, 31, 17, 19, 19, 23, 21, 23, 23, 31, 25, 27, 27, 31, 29, 31, 31, 63, 33, 35, 35, 39, 37, 39, 39, 47, 41, 43, 43, 47, 45, 47, 47, 63, 49, 51, 51, 55, 53, 55, 55, 63, 57, 59, 59, 63, 61, 63, 63, 127, 65, 67, 67, 71, 69, 71
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 05 2003

Keywords

Comments

a(k+1) = smallest number greater than k having in its binary representation exactly one 1 more than k has; A000120(a(n)) = A063787(n). - Reinhard Zumkeller, Jul 31 2010
a(n) is the least m >= n-1 such that the Hamming distance D(n-1,m) = 1. - Vladimir Shevelev, Apr 18 2012
The number of appearances of k equals the 2-adic valuation of k+1. - Ali Sada, Dec 20 2024

Examples

			a(20) = a('10100') = '10100' + '11' = '10111' = 23.
		

Crossrefs

Programs

  • C
    int a(int n) { return n | (n-1); } // Russ Cox, May 15 2007
    
  • Haskell
    a086799 n | even n    = (a086799 $ div n 2) * 2 + 1
              | otherwise = n
    -- Reinhard Zumkeller, Aug 07 2011
    
  • Maple
    nmax:=70: 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)*n-1 od: od: seq(a(n), n=1..nmax); # Johannes W. Meijer, Feb 01 2013
  • Mathematica
    Table[BitOr[(n + 1), n], {n, 0, 100}] (* Vladimir Joseph Stephan Orlovsky, Jul 19 2011 *)
  • PARI
    a(n)=bitor(n,n-1) \\ Charles R Greathouse IV, Apr 17 2012
    
  • Python
    def a(n): return n | (n-1)
    print([a(n) for n in range(1, 71)]) # Michael S. Branicky, Jul 13 2022

Formula

a(n) = n + 2^A007814(n) - 1.
a(n) is odd; a(n) = n iff n is odd.
a(a(n)) = a(n); A007814(a(n)) = a(n); A000265(a(n)) = a(n).
A023416(a(n)) = A023416(n) - A007814(n) = A086784(n).
A000120(a(n)) = A000120(n) + A007814(n).
a(2^n) = a(A000079(n)) = 2*2^n - 1 = A000051(n+1).
a(n) = if n is odd then n else a(n/2)*2 + 1.
a(n) = A006519(n) + n - 1. - Reinhard Zumkeller, Feb 02 2007
a(n) = n OR n-1 (bitwise OR of consecutive numbers). - Russ Cox, May 15 2007
a(2*n) = A038712(n) + 2*n. - Reinhard Zumkeller, Aug 07 2011
a((2*n-1)*2^p) = 2^(p+1)*n-1, p >= 0. - Johannes W. Meijer, Feb 01 2013
Sum_{k=1..n} a(k) ~ n^2/2 + (1/(2*log(2)))*n*log(n) + (3/4 + (gamma-1)/(2*log(2)))*n, where gamma is Euler's constant (A001620). - Amiram Eldar, Nov 24 2022

A082662 Numbers k such that the odd part of k is less than sqrt(2k).

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 144, 160, 176, 192, 208, 224, 240, 256, 272, 288, 304, 320, 336, 352, 368, 384, 400, 416, 432, 448, 464, 480, 496, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800
Offset: 1

Views

Author

Naohiro Nomoto, May 18 2003

Keywords

Comments

Theorem: The following eight definitions are equivalent.
(P1) Numbers k such that the odd part of k (A000265(k)) is < sqrt(2k).
(P1) is the new definition, repeated here for convenience. Note that this is not the same as saying A000265(k) < A172471(k), since A172471(k) = floor(sqrt(2*k)).
(P2) Numbers k such that the odd divisors of k are < sqrt(2k).
(P2) and (P1) are obviously equivalent.
(P3) The numbers 1, S_0, S_1, S_2, ..., where
S_m = { 2^(m+1)*(2^m+i) : i = 0 .. 3*2^m - 1 }.
So S_0 = {2,4,6}, S_1 = {8,12,16,20,24,28}, S_2 = {32,40,48,...,120}, S_3 = {128,144,...,496}, ...
The proof that (P3) and (P1) are the same sequence is not difficult and will be added later. (P3) is equivalent to a formula stated without proof (it may have been only an empirical observation) in the original version of this entry.
(P4) Numbers k such that the odd part of k is <= A003056(k).
That is, the odd part of k is <= floor((sqrt(1+8*n)-1)/2). It is more difficult to show this is equivalent to (P1), but it is true.
(P5) Numbers k such that the odd divisors of k are <= A003056(k).
(P5) and (P4) are obviously equivalent.
(P6) Numbers k such that A001227(k) = A082647(k).
(P6) was the original definition. In words, it says that the number of odd divisors of k is equal to the number of ways to write k as a sum of an odd number of consecutive positive integers, or equivalently as a sum of d consecutive positive integers for some d dividing k. To show that (P6) is equivalent to (P1) one makes use of the Hirschhorn-Hirschhorn article.
(P7) Numbers k such that the odd part of k is <= the sum of divisors of the even part.
(P7) was contributed by Jaycob Coleman, Jun 21 2014. To show (P7) is equivalent to (P1), write k as 2^m*s where s is odd. Equality holds if and only if k is an even perfect number.
(P8) Numbers k such that A000265(k) <= A000203(A006519(k)) or also such that A000265(k) <= A038712(k).
(P8) was contributed by Michel Marcus, Aug 14 2014. It is a restatement of (P7).
(End of theorem)
A further equivalent property, (P9), follows at once from (P4). This was conjectured by Omar E. Pol, Apr 18 2017
(P9) These are the numbers k such that the sequence of successive widths in the symmetric representation of sigma(k) is unimodal.
Yet another equivalent property:
(P10) Numbers k >= 1 such if k = i + (i+1) + (i+2) + ... + (i+j-1) for some i >= 1 and j >= 1 then j is odd [Caballero, 2019]. - Michel Marcus, Jan 16 2020
This is a subsequence of A005153. - Jaycob Coleman, Jun 21 2014
The complement of this sequence is A281005. - Omar E. Pol, Apr 18 2017
Subsequence of A174973. - Omar E. Pol, Feb 01 2021

Crossrefs

Programs

  • Mathematica
    cnt[n_] := DivisorSum[n, Boole[OddQ[#] && #>Sqrt[2n]]&]; Select[Range[800], cnt[#]==0&] (* Jean-François Alcover, Feb 16 2017 *)
  • PARI
    isok(n) = my(q = sqrt(2*n)); (sumdiv(n, d, (d%2) && (d < q)) == sumdiv(n, d, d%2)); \\ Michel Marcus, Jul 04 2014

Formula

G.f. = 1 + (1/(1-x)^2) * Sum_{m >= 0} (2^(m+1)*x^(3*2^m-2) * ( x^(3*2^m)*(2^(m+2)*(x-1)-x) - 2^m*(x-1) + x ) ). (This follows from (P3).) :w
- N. J. A. Sloane, Feb 02 2021
a(n+1) = a(n) + A053644(A000196(2*a(n))). - Peter Munn, Oct 03 2023

Extensions

Edited by N. J. A. Sloane, Jan 28 2021: Replaced original indirect definition by simple direct definition; rearranged comments; provided proofs (not yet included here) that the various definitions are equivalent

A323173 Sum of divisors computed for conjugated prime factorization: a(n) = A000203(A122111(n)).

Original entry on oeis.org

1, 3, 7, 4, 15, 12, 31, 6, 13, 28, 63, 18, 127, 60, 39, 8, 255, 24, 511, 42, 91, 124, 1023, 24, 40, 252, 31, 90, 2047, 72, 4095, 12, 195, 508, 120, 32, 8191, 1020, 403, 56, 16383, 168, 32767, 186, 93, 2044, 65535, 36, 121, 78, 819, 378, 131071, 48, 280, 120, 1651, 4092, 262143, 96, 524287, 8188, 217, 14, 600, 360, 1048575, 762, 3315, 234
Offset: 1

Views

Author

Antti Karttunen, Jan 10 2019

Keywords

Crossrefs

Programs

  • Mathematica
    A122111[n_] := Product[Prime[Sum[If[j < i, 0, 1], {j, #}]], {i, Max[#]}]&[ Flatten[Table[Table[PrimePi[f[[1]]], {f[[2]]}], {f, FactorInteger[n]}]]];
    a[n_] := With[{k = A122111[n]}, DivisorSigma[1, k]];
    Array[a, 70] (* Jean-François Alcover, Sep 23 2020 *)
  • 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)};
    A122111(n) = if(1==n,n,prime(bigomega(n))*A122111(A064989(n)));
    A323173(n) = sigma(A122111(n));

Formula

a(n) = A000203(A122111(n)).
a(n) = 2*A122111(n) - A323174(n).
a(n) = A322819(n) * A038712(A122111(n)).

A324186 Sum of odd divisors permuted by A163511: a(n) = A000593(A163511(n)).

Original entry on oeis.org

1, 1, 1, 4, 1, 13, 4, 6, 1, 40, 13, 31, 4, 24, 6, 8, 1, 121, 40, 156, 13, 124, 31, 57, 4, 78, 24, 48, 6, 32, 8, 12, 1, 364, 121, 781, 40, 624, 156, 400, 13, 403, 124, 342, 31, 228, 57, 133, 4, 240, 78, 248, 24, 192, 48, 96, 6, 104, 32, 72, 8, 48, 12, 14, 1, 1093, 364, 3906, 121, 3124, 781, 2801, 40, 2028, 624, 2400, 156, 1600, 400, 1464, 13, 1240, 403
Offset: 0

Views

Author

Antti Karttunen, Feb 17 2019

Keywords

Crossrefs

Programs

Formula

a(n) = A000593(A163511(n)).
For n > 0, a(n) = A324056(A054429(n)).

A344878 a(n) is the least common multiple of numbers (2^(1+e2))-1 and those in the set (p_i^e_i)-1, when the odd part of n = Product (p_i^e_i), and e2 is the 2-adic valuation of n.

Original entry on oeis.org

1, 3, 2, 7, 4, 6, 6, 15, 8, 12, 10, 14, 12, 6, 4, 31, 16, 24, 18, 28, 6, 30, 22, 30, 24, 12, 26, 42, 28, 12, 30, 63, 10, 48, 12, 56, 36, 18, 12, 60, 40, 6, 42, 70, 8, 66, 46, 62, 48, 24, 16, 84, 52, 78, 20, 30, 18, 84, 58, 28, 60, 30, 24, 127, 12, 30, 66, 112, 22, 12, 70, 120, 72, 36, 24, 126, 30, 12, 78, 124, 80, 120
Offset: 1

Views

Author

Antti Karttunen, Jun 03 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := If[n == 1, 1, Module[{p, e}, LCM @@ Table[{p, e} = pe;
         (p^(e + If[p == 2, 1, 0])) - 1, {pe, FactorInteger[n]}]]];
    Array[a, 100] (* Jean-François Alcover, Jun 12 2021 *)
  • PARI
    A344878(n) = if(1==n,n, my(f=factor(n)~); lcm(vector(#f, i, (f[1, i]^(f[2, i]+(2==f[1, i]))-1))));
    
  • Python
    from math import lcm
    from sympy import factorint
    def A344878(n): return lcm(*(p**(e+int(p==2))-1 for p, e in factorint(n).items())) # Chai Wah Wu, Jun 15 2022

Formula

If n = Product (p_i^e_i), then a(n) = LCM of values (p_i^(e_i+[p==2]))-1, where [ ] is the Iverson bracket.
a(n) = lcm(A038712(n), a(A000265(n))).
a(n) = A344875(n) / A344879(n).

A228367 n-th element of the ruler function plus the highest power of 2 dividing n.

Original entry on oeis.org

2, 4, 2, 7, 2, 4, 2, 12, 2, 4, 2, 7, 2, 4, 2, 21, 2, 4, 2, 7, 2, 4, 2, 12, 2, 4, 2, 7, 2, 4, 2, 38, 2, 4, 2, 7, 2, 4, 2, 12, 2, 4, 2, 7, 2, 4, 2, 21, 2, 4, 2, 7, 2, 4, 2, 12, 2, 4, 2, 7, 2, 4, 2, 71, 2, 4, 2, 7, 2, 4, 2, 12, 2, 4, 2, 7, 2, 4, 2, 21, 2, 4, 2, 7
Offset: 1

Views

Author

Omar E. Pol, Aug 22 2013

Keywords

Comments

a(n) is also the length of the n-th pair of orthogonal line segments in a diagram of compositions, see example.
a(n) is also the largest part plus the number of parts of the n-th region of the mentioned diagram (if the axes both "x" and "y" are included in the diagram).
a(n) is also the number of toothpicks added at n-th stage to the structure of A228366. Essentially the first differences of A228366.
The equivalent sequence for partitions is A207779.

Examples

			Illustration of initial terms (n = 1..16) using a diagram of compositions in which A001511(n) is the length of the horizontal line segment in row n and A006519(n) is the length of the vertical line segment ending in row n. Hence a(n) is the length of the n-th pair of orthogonal line segments. Also counting both the x-axis and the y-axis we have that A001511(n) is also the largest part of the n-th region of the diagram and A006519(n) is also the number of parts of the n-th region of the diagram, see below.
---------------------------------------------------------
.                Diagram of
n   A001511(n)  compositions   A006519(n)    a(n)
---------------------------------------------------------
1       1        _| | | | |        1          2
2       2        _ _| | | |        2          4
3       1        _|   | | |        1          2
4       3        _ _ _| | |        4          7
5       1        _| |   | |        1          2
6       2        _ _|   | |        2          4
7       1        _|     | |        1          2
8       4        _ _ _ _| |        8         12
9       1        _| | |   |        1          2
10      2        _ _| |   |        2          4
11      1        _|   |   |        1          2
12      3        _ _ _|   |        4          7
13      1        _| |     |        1          2
14      2        _ _|     |        2          4
15      1        _|       |        1          2
16      5        _ _ _ _ _|       16         21
...
If written as an irregular triangle the sequence begins:
  2;
  4;
  2, 7;
  2, 4, 2, 12;
  2, 4, 2, 7, 2, 4, 2, 21;
  2, 4, 2, 7, 2, 4, 2, 12, 2, 4, 2, 7, 2, 4, 2, 38;
  ...
Row lengths is A011782. Right border gives A005126.
Counting both the x-axis and the y-axis we have that A038712(n) is the area (or the number of cells) of the n-th region of the diagram. Note that adding only the x-axis to the diagram we have a tree. - _Omar E. Pol_, Nov 07 2018
		

Crossrefs

Programs

Formula

a(n) = A001511(n) + A006519(n).

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)

A182105 Number of elements merged by bottom-up merge sort.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 4, 1, 1, 2, 1, 1, 2, 4, 8, 1, 1, 2, 1, 1, 2, 4, 1, 1, 2, 1, 1, 2, 4, 8, 16, 1, 1, 2, 1, 1, 2, 4, 1, 1, 2, 1, 1, 2, 4, 8, 1, 1, 2, 1, 1, 2, 4, 1, 1, 2, 1, 1, 2, 4, 8, 16, 32, 1, 1, 2, 1, 1, 2, 4, 1, 1, 2, 1, 1, 2, 4, 8, 1, 1, 2, 1, 1, 2, 4, 1, 1, 2, 1, 1, 2, 4, 8, 16, 1, 1, 2, 1, 1, 2, 4, 1, 1, 2, 1, 1, 2, 4, 8
Offset: 1

Views

Author

Dhruv Matani, Apr 12 2012

Keywords

Comments

Also triangle read by rows in which row j lists the first A001511(j) powers of 2, j >= 1, hence records give A000079. Right border gives A006519. Row sums give A038712. The equivalent sequence for partitions is A211009. See example. - Omar E. Pol, Sep 03 2013
It appears that A045412 gives the indices of the terms which are greater than 1. - Carl Joshua Quines, Apr 07 2017

Examples

			Using construction (b), the initial values n, u_n, v_n are:
  1, 1, 1
  2, 2, 1
  3, 2, 2
  4, 3, 1
  5, 4, 1
  6, 4, 2
  7, 4, 4
  8, 5, 1
  9, 6, 1
  10, 6, 2
  11, 7, 1
  12, 8, 1
  13, 8, 2
  14, 8, 4
  15, 8, 8
  16, 9, 1
  17, 10, 1
  18, 10, 2
  19, 11, 1
  20, 12, 1
  ...
From _Omar E. Pol_, Sep 03 2013: (Start)
Illustration of initial terms (first 2^5-1 terms):
Written as an irregular triangle: T(j,k) is also the length of the k-th column in the j-th region of the diagram, as shown below. Note that the j-th row of the diagram is equivalent to the j-th composition (in colexicographic order) of 5 (cf. A228525):
------------------------------------
.          Diagram      Triangle
------------------------------------
.  j / k: 1 2 3 4 5  /  1 2 3 4 5
------------------------------------
.         _ _ _ _ _
.  1     |_| | | | |    1;
.  2     |_ _| | | |    1,2;
.  3     |_|   | | |    1;
.  4     |_ _ _| | |    1,2,4;
.  5     |_| |   | |    1;
.  6     |_ _|   | |    1,2;
.  7     |_|     | |    1;
.  8     |_ _ _ _| |    1,2,4,8;
.  9     |_| | |   |    1;
. 10     |_ _| |   |    1,2;
. 11     |_|   |   |    1;
. 12     |_ _ _|   |    1,2,4;
. 13     |_| |     |    1;
. 14     |_ _|     |    1,2;
. 15     |_|       |    1;
. 16     |_ _ _ _ _|    1,2,4,8,16;
...
(End)
		

References

  • Donald E. Knuth, The Art of Computer Programming, Vol. 4, Pre-Fascicle 6A, Section 7.2.2.2, Eq. (97).
  • Donald E. Knuth, The Art of Computer Programming, Addison-Wesley (2015) Vol. 4, Fascicle 6, Satisfiability, p. 80, Eq. (130).

Crossrefs

Cf. A046699, A215020 (a version involving Fibonacci numbers).

Programs

Formula

The following two constructions are given by Knuth:
(a) a(1) = 1; thereafter a(n+1) = 2a(n) if a(n) has already occurred an even number of times, otherwise a(n+1) = 1.
(b) Set (u_1, v_1) = (1, 1), thereafter (u_{n+1}, v_{n+1}) = ( A ? B : C)
where
A = u_n & -u_n = v_n (where the AND refers to the binary expansions),
B = (u_n + 1, 1) (the result if A is true),
C = (u_n, 2v_n) (the result if A is false).
Then v_n = A182105, u_n = A046699 minus first term.
a(n) = 2^(A082850(n)-1). - Laurent Orseau, Jun 18 2019

Extensions

Edited by N. J. A. Sloane, Aug 02 2012
Previous Showing 21-30 of 73 results. Next