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

A086141 Permutation of A025487 (least prime signatures) which, when values are factored, exhibit self-similarity (cf. A008687).

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 36, 30, 16, 24, 72, 60, 216, 180, 900, 210, 32, 48, 144, 120, 432, 360, 1800, 420, 1296, 1080, 5400, 1260, 27000, 6300, 44100, 2310, 64, 96, 288, 240, 864, 720, 3600, 840, 2592, 2160, 10800, 2520, 54000, 12600, 88200, 4620, 7776, 6480
Offset: 1

Views

Author

Alford Arnold, Aug 24 2003

Keywords

Examples

			Factored sequences are
1
0 2 0 3 0 3 0 5 0 3 0 5 0 5 0 7 ...
0 0 4 2 0 0 9 3 0 0 9 3 0 0 25 5 ...
0 0 0 0 8 4 4 2 0 0 0 0 27 9 9 3 ...
0 0 0 0 0 0 0 0 16 8 8 4 8 4 4 2 ...
yielding
1 2 4 6 8 12 36 30 16 24 72 60 216 180 900 210 ...
		

Crossrefs

A127904 Smallest m such that A008687(m) = n.

Original entry on oeis.org

0, 1, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825, 2147483649
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 05 2007

Keywords

Comments

A008687(a(n)) = n and A008687(m) < n for m < a(n).

Programs

  • Magma
    m:=30; R:=PowerSeriesRing(Rationals(), m); [0] cat Coefficients(R!(x*(1-2*x^2)/((1-x)*(1-2*x)))); // G. C. Greubel, Apr 30 2018
  • Mathematica
    Join[{0,1},LinearRecurrence[{3,-2},{3,5},40]] (* or *) Join[{0,1},2^Range[ 40]+1] (* Harvey P. Dale, Jan 16 2013 *)
  • PARI
    x='x+O('x^30); concat([0], Vec(x*(1-2*x^2)/((1-x)*(1-2*x)))) \\ G. C. Greubel, Apr 30 2018
    
  • PARI
    a(n) = if(n<2,n,2^(n-1)+1); \\ Altug Alkan, May 01 2018
    

Formula

For n>1, a(n) = A000051(n-1) = 2^(n-1)+1.
From Bruno Berselli, Sep 01 2011: (Start)
G.f.: x*(1-2*x^2)/((1-x)*(1-2*x)).
a(n) = 3*a(n-1) -2*a(n-2) for n=2 and n>3. (End)

A023416 Number of 0's in binary expansion of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Another version (A080791) has a(0) = 0.

Crossrefs

The basic sequences concerning the binary expansion of n are A000120, A000788, A000069, A001969, A023416, A059015, A070939, A083652. Partial sums see A059015.
With initial zero and shifted right, same as A080791.
Cf. A055641 (for base 10), A188859.

Programs

  • Haskell
    a023416 0 = 1
    a023416 1 = 0
    a023416 n = a023416 n' + 1 - m where (n', m) = divMod n 2
    a023416_list = 1 : c [0] where c (z:zs) = z : c (zs ++ [z+1,z])
    -- Reinhard Zumkeller, Feb 19 2012, Jun 16 2011, Mar 07 2011
    
  • Maple
    A023416 := proc(n)
        if n = 0 then
            1;
        else
            add(1-e,e=convert(n,base,2)) ;
        end if;
    end proc: # R. J. Mathar, Jul 21 2012
  • Mathematica
    Table[ Count[ IntegerDigits[n, 2], 0], {n, 0, 100} ]
    DigitCount[Range[0,110],2,0] (* Harvey P. Dale, Jan 10 2013 *)
  • PARI
    a(n)=if(n==0,1,n=binary(n); sum(i=1, #n, !n[i])) \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    a(n)=if(n==0,1,#binary(n)-hammingweight(n)) \\ Charles R Greathouse IV, Nov 20 2012
    
  • PARI
    a(n) = if(n == 0, 1, 1+logint(n,2) - hammingweight(n))  \\ Gheorghe Coserea, Sep 01 2015
    
  • Python
    def A023416(n): return n.bit_length()-n.bit_count() if n else 1 # Chai Wah Wu, Mar 13 2023

Formula

a(n) = 1, if n = 0; 0, if n = 1; a(n/2)+1 if n even; a((n-1)/2) if n odd.
a(n) = 1 - (n mod 2) + a(floor(n/2)). - Marc LeBrun, Jul 12 2001
G.f.: 1 + 1/(1-x) * Sum_{k>=0} x^(2^(k+1))/(1+x^2^k). - Ralf Stephan, Apr 15 2002
a(n) = A070939(n) - A000120(n).
a(n) = A008687(n+1) - 1.
a(n) = A000120(A035327(n)).
From Hieronymus Fischer, Jun 12 2012: (Start)
a(n) = m + 1 + Sum_{j=1..m+1} (floor(n/2^j) - floor(n/2^j + 1/2)), where m=floor(log_2(n)).
General formulas for the number of digits <= d in the base p representation n, where 0 <= d < p.
a(n) = m + 1 + Sum_{j=1..m+1} (floor(n/p^j) - floor(n/p^j + (p-d-1)/p)), where m=floor(log_p(n)).
G.f.: 1 + (1/(1-x))*Sum_{j>=0} ((1-x^(d*p^j))*x^p^j + (1-x^p^j)*x^p^(j+1)/(1-x^p^(j+1))). (End)
Product_{n>=1} ((2*n)/(2*n+1))^((-1)^a(n)) = sqrt(2)/2 (A010503) (see Allouche & Shallit link). - Michel Marcus, Aug 31 2014
Sum_{n>=1} a(n)/(n*(n+1)) = 2 - 2*log(2) (A188859) (Allouche and Shallit, 1990). - Amiram Eldar, Jun 01 2021

A083318 a(0) = 1; for n>0, a(n) = 2^n + 1.

Original entry on oeis.org

1, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825, 2147483649
Offset: 0

Views

Author

Paul Barry, Apr 25 2003

Keywords

Comments

Inverse binomial transform of A005056.
Also, A000533 interpreted as binary numbers, written in base 10. Numbers whose representation in base 2 is has n+1 digits and the digit "1" is the initial and final digit and if n>1 then the internal digits are "0" (see example). - Omar E. Pol, Feb 24 2008
a(n) equals the number of ternary sequences of length n such that no two consecutive terms differ by 1. - David Nacin, May 31 2017

Examples

			From _Omar E. Pol_, Feb 24 2008: (Start)
------------------------------
n .... a(n) .. a(n) in base 2
------------------------------
0 ..... 1 ..... 1
1 ..... 3 ..... 11
2 ..... 5 ..... 101
3 ..... 9 ..... 1001
4 .... 17 ..... 10001
5 .... 33 ..... 100001
6 .... 65 ..... 1000001
7 ... 129 ..... 10000001
8 ... 257 ..... 100000001
9 ... 513 ..... 1000000001
(End)
G.f. = 1 + 3*x + 5*x^2 + 9*x^3 + 17*x^4 + 33*x^5 + 65*x^6 + 129*x^7 + ... - _Michael Somos_, Jun 04 2016
		

Crossrefs

Except for the leading term, the same as A000051.

Programs

  • GAP
    Concatenation([1], List([1..40], n-> 2^n +1)); # G. C. Greubel, Nov 20 2019
  • Magma
    [2^n+1-0^n : n in [0..40]]; // Vincenzo Librandi, Sep 01 2011
    
  • Maple
    seq(`if`(n=0, 1, 2^n + 1), n=0..40); # G. C. Greubel, Nov 20 2019
  • Mathematica
    Join[{1},2^Range[40]+1] (* Harvey P. Dale, May 17 2013 *)
  • PARI
    {a(n) = if( n<1, n==0, 2^n + 1)}; /* Michael Somos, Jun 04 2016 */
    
  • Sage
    [1]+[2^n +1 for n in (1..40)] # G. C. Greubel, Nov 20 2019
    

Formula

a(n) = 2^n + 1^n - 0^n.
G.f.: (1-2*x^2)/((1-x)*(1-2x)).
E.g.f.: exp(2*x) + exp(x) - exp(0).
a(n) = Sum_{k=0..n} 0^(k*(n-k))*2^(n-k). - Paul Barry, Feb 09 2005
a(n) = Min{m: A008687(m) = n+1}. - Reinhard Zumkeller, Jul 25 2006
Row sums of triangle A132749; = binomial transform of [1, 2, 0, 2, 0, 2, 0, 2, ...]. - Gary W. Adamson, Aug 28 2007
A020650(a(n)) = 1. - Yosu Yurramendi, Jun 01 2016

Extensions

Edited by N. J. A. Sloane, Sep 28 2007

A228369 Triangle read by rows in which row n lists the compositions (ordered partitions) of n in lexicographic order.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Aug 28 2013

Keywords

Comments

The representation of the compositions (for fixed n) is as lists of parts, the order between individual compositions (for the same n) is lexicographic. - Joerg Arndt, Sep 02 2013
The equivalent sequence for partitions is A026791.
Row n has length A001792(n-1).
Row sums give A001787, n >= 1.
The m-th composition has length A008687(m+1), m >= 1. - Andrey Zabolotskiy, Jul 19 2017

Examples

			Illustration of initial terms:
-----------------------------------
n  j       Diagram   Composition j
-----------------------------------
.               _
1  1           |_|   1;
.             _ _
2  1         | |_|   1, 1,
2  2         |_ _|   2;
.           _ _ _
3  1       | | |_|   1, 1, 1,
3  2       | |_ _|   1, 2,
3  3       |   |_|   2, 1,
3  4       |_ _ _|   3;
.         _ _ _ _
4  1     | | | |_|   1, 1, 1, 1,
4  2     | | |_ _|   1, 1, 2,
4  3     | |   |_|   1, 2, 1,
4  4     | |_ _ _|   1, 3,
4  5     |   | |_|   2, 1, 1,
4  6     |   |_ _|   2, 2,
4  7     |     |_|   3, 1,
4  8     |_ _ _ _|   4;
.
Triangle begins:
[1];
[1,1],[2];
[1,1,1],[1,2],[2,1],[3];
[1,1,1,1],[1,1,2],[1,2,1],[1,3],[2,1,1],[2,2],[3,1],[4];
[1,1,1,1,1],[1,1,1,2],[1,1,2,1],[1,1,3],[1,2,1,1],[1,2,2],[1,3,1],[1,4],[2,1,1,1],[2,1,2],[2,2,1],[2,3],[3,1,1],[3,2],[4,1],[5];
...
		

Crossrefs

Programs

  • Haskell
    a228369 n = a228369_list !! (n - 1)
    a228369_list = concatMap a228369_row [1..]
    a228369_row 0 = []
    a228369_row n
      | 2^k == 2 * n + 2 = [k - 1]
      | otherwise        = a228369_row (n `div` 2^k) ++ [k] where
        k = a007814 (n + 1) + 1
    -- Peter Kagey, Jun 27 2016
    
  • Mathematica
    Table[Sort[Join@@Permutations/@IntegerPartitions[n],OrderedQ[PadRight[{#1,#2}]]&],{n,5}] (* Gus Wiseman, Dec 14 2017 *)
  • PARI
    gen_comp(n)=
    {  /* Generate compositions of n as lists of parts (order is lex): */
        my(ct = 0);
        my(m, z, pt);
        \\ init:
        my( a = vector(n, j, 1) );
        m = n;
        while ( 1,
            ct += 1;
            pt = vector(m, j, a[j]);
            /* for A228369  print composition: */
            for (j=1, m, print1(pt[j],", ") );
    \\        /* for A228525 print reversed (order is colex): */
    \\        forstep (j=m, 1, -1, print1(pt[j],", ") );
            if ( m<=1,  return(ct) );  \\ current is last
            a[m-1] += 1;
            z = a[m] - 2;
            a[m] = 1;
            m += z;
        );
        return(ct);
    }
    for(n=1, 12, gen_comp(n) );
    \\ Joerg Arndt, Sep 02 2013
    
  • Python
    a = [[[]], [[1]]]
    for s in range(2, 9):
        a.append([])
        for k in range(1, s+1):
            for ss in a[s-k]:
                a[-1].append([k]+ss)
    print(a)
    # Andrey Zabolotskiy, Jul 19 2017

A135416 a(n) = A036987(n)*(n+1)/2.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, based on a message from Guy Steele and Don Knuth, Mar 01 2008

Keywords

Comments

Guy Steele defines a family of 36 integer sequences, denoted here by GS(i,j) for 1 <= i, j <= 6, as follows. a[1]=1; a[2n] = i-th term of {0,1,a[n],a[n]+1,2a[n],2a[n]+1}; a[2n+1] = j-th term of {0,1,a[n],a[n]+1,2a[n],2a[n]+1}. The present sequence is GS(1,5).
The full list of 36 sequences:
GS(1,1) = A000007
GS(1,2) = A000035
GS(1,3) = A036987
GS(1,4) = A007814
GS(1,5) = A135416 (the present sequence)
GS(1,6) = A135481
GS(2,1) = A135528
GS(2,2) = A000012
GS(2,3) = A000012
GS(2,4) = A091090
GS(2,5) = A135517
GS(2,6) = A135521
GS(3,1) = A036987
GS(3,2) = A000012
GS(3,3) = A000012
GS(3,4) = A000120
GS(3,5) = A048896
GS(3,6) = A038573
GS(4,1) = A135523
GS(4,2) = A001511
GS(4,3) = A008687
GS(4,4) = A070939
GS(4,5) = A135529
GS(4,6) = A135533
GS(5,1) = A048298
GS(5,2) = A006519
GS(5,3) = A080100
GS(5,4) = A087808
GS(5,5) = A053644
GS(5,6) = A000027
GS(6,1) = A135534
GS(6,2) = A038712
GS(6,3) = A135540
GS(6,4) = A135542
GS(6,5) = A054429
GS(6,6) = A003817
(with a(0)=1): Moebius transform of A038712.

Crossrefs

Equals A048298(n+1)/2. Cf. A036987, A182660.

Programs

  • Maple
    GS:=proc(i,j,M) local a,n; a:=array(1..2*M+1); a[1]:=1;
    for n from 1 to M do
    a[2*n] :=[0,1,a[n],a[n]+1,2*a[n],2*a[n]+1][i];
    a[2*n+1]:=[0,1,a[n],a[n]+1,2*a[n],2*a[n]+1][j];
    od: a:=convert(a,list); RETURN(a); end;
    GS(1,5,200):
  • Mathematica
    i = 1; j = 5; Clear[a]; a[1] = 1; a[n_?EvenQ] := a[n] = {0, 1, a[n/2], a[n/2]+1, 2*a[n/2], 2*a[n/2]+1}[[i]]; a[n_?OddQ] := a[n] = {0, 1, a[(n-1)/2], a[(n-1)/2]+1, 2*a[(n-1)/2], 2*a[(n-1)/2]+1}[[j]]; Array[a, 105] (* Jean-François Alcover, Sep 12 2013 *)
  • PARI
    A048298(n) = if(!n,0,if(!bitand(n,n-1),n,0));
    A135416(n) = (A048298(n+1)/2); \\ Antti Karttunen, Jul 22 2018
    
  • Python
    def A135416(n): return int(not(n&(n+1)))*(n+1)>>1 # Chai Wah Wu, Jul 06 2022

Formula

G.f.: sum{k>=1, 2^(k-1)*x^(2^k-1) }.
Recurrence: a(2n+1) = 2a(n), a(2n) = 0, starting a(1) = 1.

Extensions

Formulae and comments by Ralf Stephan, Jun 20 2014

A004754 Numbers n whose binary expansion starts 10.

Original entry on oeis.org

2, 4, 5, 8, 9, 10, 11, 16, 17, 18, 19, 20, 21, 22, 23, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 128, 129, 130, 131
Offset: 1

Views

Author

Keywords

Comments

A000120(a(n)) = A000120(n); A023416(a(n-1)) = A008687(n) for n > 1. - Reinhard Zumkeller, Dec 04 2015

Examples

			10 in binary is 1010, so 10 is in sequence.
		

Crossrefs

Cf. A123001 (binary version), A004755 (11), A004756 (100), A004757 (101), A004758 (110), A004759 (111).
Apart from initial terms, same as A004761.

Programs

  • Haskell
    import Data.List (transpose)
    a004754 n = a004754_list !! (n-1)
    a004754_list = 2 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004754_list
    -- Reinhard Zumkeller, Dec 04 2015
    
  • Mathematica
    w = {1, 0}; Select[Range[2, 131], If[# < 2^(Length@ w - 1), True, Take[IntegerDigits[#, 2], Length@ w] == w] &] (* Michael De Vlieger, Aug 08 2016 *)
  • PARI
    a(n)=n+2^floor(log(n)/log(2))
    
  • PARI
    is(n)=n>1 && !binary(n)[2] \\ Charles R Greathouse IV, Sep 23 2012
    
  • Python
    def A004754(n): return n+(1<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + [n==0].
a(n) = n + 2^floor(log_2(n)) = n + A053644(n).
a(2^m+k) = 2^(m+1) + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003

A125106 Enumeration of partitions by binary representation: each 1 is a part; the part size is 1 more than the number of 0's in the rest of the number.

Original entry on oeis.org

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

Views

Author

Alford Arnold, Dec 10 2006

Keywords

Comments

Another way to describe this: starting with the binary representation and a counter set at one, count the 0's from right to left. Write a term equal to the counter for each "1" encountered.
A101211 is a similar sequence, with A005811 elements per row which maps natural numbers to compositions (ordered partitions).
There are two ways to consider this as a table: taking each partition as a row, or taking the partitions generated by 2^(n-1) through 2^n-1 as a row.
Taking the n-th row as multiple partitions, it consists of those partitions with the first hook size (largest part plus number of parts minus 1) equal to n. The number of integers in this n-th row is A001792(n-1), and the row sum is A049611.
Taking each partition as a separate row, the row lengths are A000120, and the row sums are A161511.
Heinz numbers of the rows are A005940. - Gus Wiseman, Jan 17 2023

Examples

			Row 4:
1000 [4]
1001 [3,1]
1010 [3,2]
1011 [2,1,1]
1100 [3,3]
1101 [2,2,1]
1110 [2,2,2]
1111 [1,1,1,1]
		

Crossrefs

Each partition as row: A000120 (row widths), A161511 (row sums), A243499 (row products).
Lasts are A001511.
Firsts are A008687.

Programs

  • Maple
    b:= proc(n) local c, l, m; l:=[][]; m:= n; c:=1;
          while m>0 do if irem(m, 2, 'm')=0 then c:= c+1
             else l:= c, l fi
          od; l
        end:
    T:= n-> seq(b(i), i=2^(n-1)..2^n-1):
    seq(T(n), n=1..7);  # Alois P. Heinz, Sep 25 2015
  • Mathematica
    f[k_] := (bits = IntegerDigits[k, 2]; zerosCount = Reverse[ Accumulate[ 1-Reverse[bits] ] ] + 1; Select[ Transpose[ {bits, zerosCount} ], First[#] == 1 & ][[All, 2]]); row[n_] := Table[ f[k], {k, 2^(n-1), 2^n-1}]; Flatten[ Table[ row[n], {n, 1, 5}]] (* Jean-François Alcover, Jan 24 2012 *)
    scc[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Table[Reverse[scc[n]-Range[Length[scc[n]]]+1],{n,0,20}] (* Gus Wiseman, Jan 17 2023 *)

Formula

Partition 2n is partition n with every part size increased by 1; partition 2n+1 is partition n with an additional part of size 1.
T(n,k) = A272020(n,k) - A000120(n) + k. - Gus Wiseman, Jan 17 2023

Extensions

Edited by Franklin T. Adams-Watters, Jun 11 2009

A242628 Irregular table enumerating partitions; n-th row has partitions in previous row with each part incremented, followed by partitions in previous row with an additional part of size 1.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This can be calculated using the binary expansion of n; see the PARI program.
The n-th row consists of all partitions with hook size (maximum + number of parts - 1) equal to n.
The partitions in row n of this sequence are the conjugates of the partitions in row n of A125106 taken in reverse order.
Row n is also the reversed partial sums plus one of the n-th composition in standard order (A066099) minus one. - Gus Wiseman, Nov 07 2022

Examples

			The table starts:
  1;
  2; 1,1;
  3; 2,2; 2,1; 1,1,1;
  4; 3,3; 3,2; 2,2,2; 3,1 2,2,1 2,1,1 1,1,1,1;
  ...
		

Crossrefs

Cf. A241596 (another version of this list of partitions), A125106, A240837, A112531, A241597 (compositions).
For other schemes to list integer partitions, please see for example A227739, A112798, A241918, A114994.
First element in each row is A008687.
Last element in each row is A065120.
Heinz numbers of rows are A253565.
Another version is A358134.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, [[1]],
          [map(x-> map(y-> y+1, x), b(n-1))[],
           map(x-> [x[], 1], b(n-1))[]])
        end:
    T:= n-> map(x-> x[], b(n))[]:
    seq(T(n), n=1..7);  # Alois P. Heinz, Sep 25 2015
  • Mathematica
    T[1] = {{1}};
    T[n_] := T[n] = Join[T[n-1]+1, Append[#, 1]& /@ T[n-1]];
    Array[T, 7] // Flatten (* Jean-François Alcover, Jan 25 2021 *)
  • PARI
    apart(n) = local(r=[1]); while(n>1,if(n%2==0,for(k=1,#r,r[k]++),r=concat(r,[1]));n\=2);r \\ Generates n-th partition.

A290251 a(n) is the number of parts in the integer partition having viabin number n.

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, Jul 24 2017

Keywords

Comments

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.
From Omar E. Pol, Jul 24 2017: (Start)
Consider that this is also an irregular triangle read by rows T(n,k), n>=0, k>=1, in which the row lengths are the elements of A011782 (see example).
Conjectures:
1) It appears that if k > 1 and k is a power of 2 then column k lists the positive integers (A000027).
2) It appears that column k lists the nonnegative integers (A001477) starting from the first elements of the column k.
3) It appears that if n > 0 then row n lists the first 2^(n-1) elements of A063787 in reverse order. (End)

Examples

			a(9) = 3. Indeed, the binary form of 9 is 1001; with an additional 0 at the end, it leads to the path ENNEN, where E=(1,0), N=(0,1); this path is the southeast border of the Ferrers board of the integer partition [2,1,1], having 3 parts.
From _Omar E. Pol_, Jul 24 2017: (Start)
Written as an irregular triangle the sequence begins:
  0;
  1;
  2,1;
  3,2,2,1;
  4,3,3,2,3,2,2,1;
  5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1;
  6,5,5,4,5,4,4,3,5,4,4,3,4,3,3,2,5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1;
  ...(End)
		

Crossrefs

Programs

  • Maple
    a := proc (n) if n < 2 then n elif `mod`(n, 2) = 0 then 1+a((1/2)*n) else a((1/2)*n-1/2) end if end proc: seq(a(n), n = 0 .. 150);
  • Mathematica
    a[n_] := a[n] = Which[n < 2, n, EvenQ[n], 1+a[n/2], True, a[(n-1)/2]];
    Table[a[n], {n, 0, 105}] (* Jean-François Alcover, Aug 06 2024 *)
  • PARI
    A290251(n) = ((n>0)+#binary(n)-hammingweight(n)); \\ Antti Karttunen, Oct 06 2023

Formula

a(1) = 1; a(2n) = 1 + a(n); a(2n+1) = a(n).
a(n) = 1 + number of 0's in the binary form of n = 1 + A023416(n) for n>0.
a(n) = A008687(n+1) for n>0.
a(n) = 1 + A070939(n) - A000120(n) = A070939(n) - A048881(n+1). - Omar E. Pol, Jul 24 2017
a(n) = A001222(A163511(n)) = A001222(A366275(n)). - Antti Karttunen, Oct 06 2023

Extensions

Data section extended up to n=105 by Antti Karttunen, Oct 06 2023
Showing 1-10 of 16 results. Next