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

A362227 a(n) = Product_{k=1..w(n)} p(k)^(S(n,k)-1), where set S(n,k) = row n of A272011 and w(n) = A000120(n) is the binary weight of n.

Original entry on oeis.org

1, 2, 4, 12, 8, 24, 72, 360, 16, 48, 144, 720, 432, 2160, 10800, 75600, 32, 96, 288, 1440, 864, 4320, 21600, 151200, 2592, 12960, 64800, 453600, 324000, 2268000, 15876000, 174636000, 64, 192, 576, 2880, 1728, 8640, 43200, 302400, 5184, 25920, 129600, 907200, 648000, 4536000, 31752000, 349272000, 15552
Offset: 0

Views

Author

Michael De Vlieger, Jun 08 2023

Keywords

Comments

In other words, let S(n) contain place values of 1's in the binary expansion of n, ordered greatest to least, where S(n,1) = floor(log_2(n+1)) = A000523(n+1) and the remaining terms in S strictly decrease. This sequence reads S(n,k)+1 instead as a multiplicity of prime(k) so as to produce a number with strictly decreasing prime exponents.

Examples

			a(0) = 1 since 1 is the empty product.
a(1) = 2 since 1 = 2^0, s = {0}, hence a(1) = prime(1)^(0+1) = 2^1 = 2.
a(2) = 4 since 2 = 2^1, s = {1}, hence a(2) = 2^(1+1) = 4.
a(3) = 12 since 3 = 2^1+2^0, s = {1,0}, hence a(3) = 2^2*3^1 = 12, etc.
The table below relates first terms of this sequence greater than 1 to A272011 and A067255:
   n   A272011(n)  a(n)  A067255(a(n))
  ------------------------------------
   1   0             2   1
   2   1             4   2
   3   1,0          12   2,1
   4   2             8   3
   5   2,0          24   3,1
   6   2,1          72   3,2
   7   2,1,0       360   3,2,1
   8   3            16   4
   9   3,0          48   4,1
  10   3,1         144   4,2
  11   3,1,0       720   4,2,1
  12   3,2         432   4,3
  13   3,2,0      2160   4,3,1
  14   3,2,1     10800   4,3,2
  15   3,2,1,0   75600   4,3,2,1
  16   4            32   5
  ...
This sequence appears below, seen as an irregular triangle T(m,j) delimited by 2^m where j = 1..2^(m-1) for m > 0:
   1;
   2;
   4, 12;
   8, 24,  72, 360;
  16, 48, 144, 720, 432, 2160, 10800, 75600;
  ...
T(m,1) = 2^m.
T(m,2^(m-1)) = A006939(m) for m > 0.
		

Crossrefs

Programs

  • Mathematica
    Array[Times @@ MapIndexed[Prime[First[#2]]^(#1 + 1) &, Length[#] - Position[#, 1][[All, 1]] ] &[IntegerDigits[#, 2]] &, 48, 0]

Formula

This sequence, sorted, is A087980.
a(2^k) = 2^(k+1).
a(2^k-1) = A006939(k-1).

A048793 List giving all subsets of natural numbers arranged in standard statistical (or Yates) order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

For n>0: first occurrence of n in row 2^(n-1), and when the table is seen as a flattened list at position n*2^(n-1)+1, cf. A005183. - Reinhard Zumkeller, Nov 16 2013
Row n lists the positions of 1's in the reversed binary expansion of n. Compare to triangles A112798 and A213925. - Gus Wiseman, Jul 22 2019

Examples

			From _Gus Wiseman_, Jul 22 2019: (Start)
Triangle begins:
  {}
  1
  2
  1  2
  3
  1  3
  2  3
  1  2  3
  4
  1  4
  2  4
  1  2  4
  3  4
  1  3  4
  2  3  4
  1  2  3  4
  5
  1  5
  2  5
  1  2  5
  3  5
(End)
		

References

  • S. Hedayat, N. J. A. Sloane and J. Stufken, Orthogonal Arrays, Springer-Verlag, NY, 1999, p. 249.

Crossrefs

Cf. A048794.
Row lengths are A000120.
First column is A001511.
Heinz numbers of rows are A019565.
Row sums are A029931.
Reversing rows gives A272020.
Subtracting 1 from each term gives A133457; subtracting 1 and reversing rows gives A272011.
Indices of relatively prime rows are A291166 (see also A326674); arithmetic progressions are A295235; rows with integer average are A326669 (see also A326699/A326700); pairwise coprime rows are A326675.

Programs

  • C
    #include 
    #include 
    #define USAGE "Usage: 'A048793 num' where num is the largest number to use creating sets.\n"
    #define MAX_NUM 10
    #define MAX_ROW 1024
    int main(int argc, char *argv[]) {
      unsigned short a[MAX_ROW][MAX_NUM]; signed short old_row, new_row, i, j, end;
      if (argc < 2) { fprintf(stderr, USAGE); return EXIT_FAILURE; }
      end = atoi(argv[1]); end = (end > MAX_NUM) ? MAX_NUM: end;
      for (i = 0; i < MAX_ROW; i++) for ( j = 0; j < MAX_NUM; j++) a[i][j] = 0;
      a[1][0] = 1; new_row = 2;
      for (i = 2; i <= end; i++) {
        a[new_row++ ][0] = i;
        for (old_row = 1; a[old_row][0] != i; old_row++) {
          for (j = 0; a[old_row][j] != 0; j++) { a[new_row][j] = a[old_row][j]; }
          a[new_row++ ][j] = i;
        }
      }
      fprintf(stdout, "Values: 0");
      for (i = 1; a[i][0] != 0; i++) for (j = 0; a[i][j] != 0; j++) fprintf(stdout, ",%d", a[i][j]);
      fprintf(stdout, "\n"); return EXIT_SUCCESS
    }
    
  • Haskell
    a048793 n k = a048793_tabf !! n !! k
    a048793_row n = a048793_tabf !! n
    a048793_tabf = [0] : [1] : f [[1]] where
       f xss = yss ++ f (xss ++ yss) where
         yss = [y] : map (++ [y]) xss
         y = last (last xss) + 1
    -- Reinhard Zumkeller, Nov 16 2013
  • Maple
    T:= proc(n) local i, l, m; l:= NULL; m:= n;
          if n=0 then return 0 fi; for i while m>0 do
          if irem(m, 2, 'm')=1 then l:=l, i fi od; l
        end:
    seq(T(n), n=0..50);  # Alois P. Heinz, Sep 06 2014
  • Mathematica
    s[0] = {{}}; s[n_] := s[n] = Join[s[n - 1], Append[#, n]& /@ s[n - 1]]; Join[{0}, Flatten[s[6]]] (* Jean-François Alcover, May 24 2012 *)
    Table[Join@@Position[Reverse[IntegerDigits[n,2]],1],{n,30}] (* Gus Wiseman, Jul 22 2019 *)

Formula

Constructed recursively: subsets that include n are obtained by appending n to all earlier subsets.

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Apr 11 2000

A272020 Irregular triangle read by rows: strictly decreasing sequences of positive numbers given in lexicographic order.

Original entry on oeis.org

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

Views

Author

Peter Kagey, Apr 17 2016

Keywords

Comments

Length of n-th row given by A000120(n);
Min of n-th row given by A001511(n);
Sum of n-th row given by A029931(n);
Product of n-th row given by A096111(n);
Max of n-th row given by A113473(n);
Numerator of sum of reciprocals of n-th row given by A116416(n);
Denominator of sum of reciprocals of n-th row given by A116417(n);
LCM of n-th row given by A271410(n).
The first appearance of n is at A001787(n - 1).
n-th row begins at index A000788(n - 1) for n > 0.
Also the reversed positions of 1's in the reversed binary expansion of n. Also the reversed partial sums of the n-th composition in standard order (row n of A066099). Reversing rows gives A048793. - Gus Wiseman, Jan 17 2023

Examples

			Row n is given by the exponents in the binary expansion of 2*n. For example, row 5 = [3, 1] because 2*5 = 2^3 + 2^1.
Row 0: []
Row 1: [1]
Row 2: [2]
Row 3: [2, 1]
Row 4: [3]
Row 5: [3, 1]
Row 6: [3, 2]
Row 7: [3, 2, 1]
		

Crossrefs

Cf. A048793 gives the rows in reverse order.
Cf. A272011.
Lasts are A001511.
Heinz numbers of the rows are A019565.
Firsts are A029837 or A070939 or A113473.
Row sums are A029931.
A066099 lists standard comps, partial sums A358134, weighted sum A359042.

Programs

  • Maple
    T:= proc(n) local i, l, m; l:= NULL; m:= n;
          if n=0 then return [][] fi; for i while m>0 do
          if irem(m, 2, 'm')=1 then l:=i, l fi od; l
        end:
    seq(T(n), n=0..35);  # Alois P. Heinz, Nov 27 2024
  • Mathematica
    Table[Reverse[Join@@Position[Reverse[IntegerDigits[n,2]],1]],{n,0,100}] (* Gus Wiseman, Jan 17 2023 *)

A133457 Irregular triangle read by rows: row n gives exponents in expression for n as a sum of powers of 2.

Original entry on oeis.org

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

Views

Author

Masahiko Shin, Nov 27 2007

Keywords

Comments

This sequence contains every increasing finite sequence. For example, the finite sequence {0,2,3,5} arises from n = 45.
Essentially A030308(n,k)*k, then entries removed where A030308(n,k)=0. - R. J. Mathar, Nov 30 2007
In the corresponding irregular triangle {a(n)+1}, the m-th row gives all positive integer roots m_i of polynomial {m,k}. - see link [Shevelev]; see also A264613. - Vladimir Shevelev, Dec 13 2015

Examples

			1 = 2^0.
2 = 2^1.
3 = 2^0 + 2^1.
4 = 2^2.
5 = 2^0 + 2^2.
etc. and reading the exponents gives the rows of the triangle.
		

Crossrefs

Cf. A073642 (row sums), A272011 (rows reversed).

Programs

  • Haskell
    a133457 n k = a133457_tabf !! (n-1) !! n
    a133457_row n = a133457_tabf !! (n-1)
    a133457_tabf = map (fst . unzip . filter ((> 0) . snd) . zip [0..]) $
                       tail a030308_tabf
    -- Reinhard Zumkeller, Oct 28 2013, Feb 06 2013
  • Maple
    A133457 := proc(n) local a,bdigs,i ; a := [] ; bdigs := convert(n,base,2) ; for i from 1 to nops(bdigs) do if op(i,bdigs) <> 0 then a := [op(a),i-1] ; fi ; od: a ; end: seq(op(A133457(n)),n=1..80) ; # R. J. Mathar, Nov 30 2007
  • Mathematica
    Array[Join @@ Position[#, 1] - 1 &@ Reverse@ IntegerDigits[#, 2] &, 41] // Flatten (* Michael De Vlieger, Oct 08 2017 *)

Formula

a(n) = A048793(n) - 1.

Extensions

More terms from R. J. Mathar, Nov 30 2007

A174605 Partial sums of A011371.

Original entry on oeis.org

0, 0, 1, 2, 5, 8, 12, 16, 23, 30, 38, 46, 56, 66, 77, 88, 103, 118, 134, 150, 168, 186, 205, 224, 246, 268, 291, 314, 339, 364, 390, 416, 447, 478, 510, 542, 576, 610, 645, 680, 718, 756, 795, 834, 875, 916, 958, 1000, 1046, 1092, 1139, 1186, 1235, 1284, 1334
Offset: 0

Views

Author

Jonathan Vos Post, Mar 23 2010

Keywords

Comments

Exponent of 2 in the superfactorials, i.e., a(n) = A007814(A000178(n)). - Ralf Stephan, Jan 03 2014

Crossrefs

Cf. A000120, A011371 (first differences).
Cf. A000178 (superfactorials), A007814 (2-adic valuation), A272011 (binary exponents).
Cf. A249152 (hyperfactorial valuation), A187059 (binomial valuation), A173345 (superfactorial 10-valuation).

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<1, 0,
          a(n-1)+n-add(i, i=Bits[Split](n)))
        end:
    seq(a(n), n=0..54);  # Alois P. Heinz, Oct 30 2021
  • Mathematica
    Accumulate[Table[n-DigitCount[n,2,1],{n,0,130}]] (* Harvey P. Dale, Feb 26 2015 *)
    a[n_] := IntegerExponent[BarnesG[n + 2], 2]; Array[a, 100, 0] (* Amiram Eldar, Aug 08 2024 *)
  • PARI
    a(n) = n++; my(v=binary(n),t=#v-1); for(i=1,#v, if(v[i],v[i]=t++,t--)); (n^2 - fromdigits(v,2))>>1; \\ Kevin Ryde, Oct 29 2021
    
  • Python
    def A174605(n): return (n*(n+1)>>1)-(n+1)*n.bit_count()-(sum((m:=1<>j)-(r if n<<1>=m*(r:=k<<1|1) else 0)) for j in range(1,n.bit_length()+1))>>1)  # Chai Wah Wu, Nov 12 2024

Formula

a(n) = Sum_{i=0..n} A011371(i).
From Kevin Ryde, Oct 29 2021: (Start)
a(n) = n*(n+1)/2 - A000788(n).
a(n) ~ (n^2)/2 + O(n*log_2(n)). [Lagarias and Mehta, theorem 4.2 with p=2]
a(n) = ( (n+1)^2 - Sum_{i=1..k} (e[i]+2*i-1) * 2^e[i] )/2, where binary expansion n+1 = 2^e[1] + ... + 2^e[k] with descending exponents e[1] > e[2] > ... > e[k] (A272011).
(End)

A262557 Numbers with digits in strictly decreasing order, sorted lexicographically.

Original entry on oeis.org

0, 1, 10, 2, 20, 21, 210, 3, 30, 31, 310, 32, 320, 321, 3210, 4, 40, 41, 410, 42, 420, 421, 4210, 43, 430, 431, 4310, 432, 4320, 4321, 43210, 5, 50, 51, 510, 52, 520, 521, 5210, 53, 530, 531, 5310, 532, 5320, 5321, 53210, 54, 540, 541, 5410, 542, 5420, 5421
Offset: 1

Views

Author

N. J. A. Sloane, Oct 14 2015

Keywords

Comments

Original name: "Countdown sequences, allowing gaps."
Only digits 0 through 9 are used. The last term is 9876543210.
Equals A009995, sorted lexicographically. - Reinhard Zumkeller, Oct 14 2015
There are 2^k terms starting with digit k >= 0, they start at index 2^k. The countdown sequences, i.e., digits of the n-th term, are given in rows of A272011. - M. F. Hasler, Dec 11 2019

References

  • Donald S. McDonald, Email message to N. J. A. Sloane, Oct 14 2015.

Crossrefs

Programs

  • Haskell
    a262557 n = a262557_list !! (n-1)
    a262557_list = 0 : f [[0]] where
       f xss = if x < 9 then (map (read . concatMap show) zss) ++ f zss else []
               where zss = (map (z :) $ map tail xss) ++ (map (z :) xss)
                     z = x + 1; x = head $ head xss
    -- Reinhard Zumkeller, Oct 14 2015
    
  • Mathematica
    A262557[n_] := FromDigits[BitLength[n] - Flatten[Position[IntegerDigits[n, 2], 1]]]; Array[A262557, 100] (* or *)
    A262557full = Rest[Map[FromDigits, LexicographicSort[Subsets[Range[9, 0, -1]]]]] (*  Paolo Xausa, Feb 13 2024 *)
  • PARI
    is_A262557 = is_A009995
    apply( A262557(n)=fromdigits(Vecrev(vecextract([0..exponent(n+!n)],n))), [1..99])
    # A262557=concat(apply(x(i)=concat(vector(i%10+1,j,if(j>1,x(i*10+j-2),i))),[0..9])) \\ M. F. Hasler, Dec 11 2019
    
  • Python
    from itertools import combinations
    afull = list(map(int, sorted("".join(c) for i in range(1, 11) for c in combinations("9876543210", i)))) # Michael S. Branicky, Feb 13 2024

Formula

a(n) = A009995(A263328(n)); a(A263327(n)) = A009995(n). - Reinhard Zumkeller, Oct 15 2015

Extensions

New name from M. F. Hasler, Dec 11 2019

A083741 a(n) = L(n) + a(L(n)), where L(n) = n - 2^floor(log_2(n)) (A053645).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 4, 0, 1, 2, 4, 4, 6, 8, 11, 0, 1, 2, 4, 4, 6, 8, 11, 8, 10, 12, 15, 16, 19, 22, 26, 0, 1, 2, 4, 4, 6, 8, 11, 8, 10, 12, 15, 16, 19, 22, 26, 16, 18, 20, 23, 24, 27, 30, 34, 32, 35, 38, 42, 44, 48, 52, 57, 0, 1, 2, 4, 4, 6, 8, 11, 8, 10, 12, 15, 16, 19, 22, 26, 16, 18, 20
Offset: 0

Views

Author

Ralf Stephan, May 05 2003

Keywords

Comments

a(2^j)=0. Local extrema are a(2^j-1) = 2^j-j-1 (A000295).

Crossrefs

Programs

  • Mathematica
    f[l_]:=Join[l,l-1+Range[Length[l]]]; Nest[f,{0},7] (* Ray Chandler, Jun 01 2010 *)
  • PARI
    a(n)=if(n<2,0,if(n%2==0,2*a(n/2),if(n%4==1,2*a((n-1)/4)+a((n+1)/ 2),-2*a((n-3)/4)+3*a((n-3)/2+1)+1)))
    
  • PARI
    a(n) = my(v=binary(n),c=-1); for(i=1,#v, if(v[i],v[i]=c++)); fromdigits(v,2); \\ Kevin Ryde, Apr 16 2024

Formula

a(0)=0, a(1)=0, a(2n)=2a(n), a(4n+1)=2a(n)+a(2n+1), a(4n+3)=-2a(n)+3a(2n+1)+1.
a(n) = Sum_{i=0..k} i*2^e[i] where the binary expansion of n is n = Sum_{i=0..k} 2^e[i] with decreasing exponents e[0] > ... > e[k] (A272011). - Kevin Ryde, Apr 16 2024

Extensions

Extended by Ray Chandler, Mar 04 2010

A119733 Offsets of the terms of the nodes of the reverse Collatz function.

Original entry on oeis.org

0, 1, 2, 5, 4, 7, 10, 19, 8, 11, 14, 23, 20, 29, 38, 65, 16, 19, 22, 31, 28, 37, 46, 73, 40, 49, 58, 85, 76, 103, 130, 211, 32, 35, 38, 47, 44, 53, 62, 89, 56, 65, 74, 101, 92, 119, 146, 227, 80, 89, 98, 125, 116, 143, 170, 251, 152, 179, 206, 287, 260, 341, 422, 665, 64, 67
Offset: 0

Views

Author

William Entriken, Jun 14 2006

Keywords

Comments

Create a binary tree starting with x. To follow 0 from the root, apply f(x)=2x. To follow 1, apply g(x)=(2x-1)/3. For example, starting with x, the string 010 {also known as f(g(f(x)))}, you would get (8x-2)/3. These expressions represent the reverse Collatz function and will provide numbers whose Collatz path may include x. These expressions will all be of the form (2^a*x-b)/3^c. This sequence concerns b. What makes b interesting is that if you draw the tree, each level of the tree will have the same sequence of values for b. The root of the tree x, can be written as (2^0*x-0)/3^0, which has the first value for b. Each subsequent level contains twice as many values of b.
This sequence is 0 followed by a permutation of A213539, and therefore consists of 0 plus the elements of A116640 multiplied by 2^k, where k >= 0. E.g., 1, 5, 7, 19 becomes 0, 2^0*1, 2^1*1, 2^0*5, 2^2*1, 2^0*7, 2^1*5, 2^0*19, ... - Joe Slater, Dec 19 2016
When this sequence is arranged as an irregular triangle the sum of each row a(2^k)...a(2^(k+1)-1) equals A081039(2^k). The cumulative sum from a(0) to a(2^k-1) equals A002697(k). - Joe Slater, Apr 12 2018

Examples

			a(1) = 1 = 2 * 0 + 3^0 since 0 written in binary contains no 1's.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) `if`(n=0, 0, `if`(irem(n, 2, 'r')=0, 0,
          3^add(i, i=convert(r, base, 2)))+2*a(r))
        end:
    seq(a(n), n=0..127);  # Alois P. Heinz, Aug 13 2017
  • Mathematica
    a[0] := 0; a[n_?OddQ] := 2a[(n - 1)/2] + 3^Plus@@IntegerDigits[(n - 1)/2, 2]; a[n_?EvenQ] := 2a[n/2]; Table[a[n], {n, 0, 65}] (* Alonso del Arte, Apr 21 2011 *)
  • PARI
    a(n) = my(ret=0); if(n, for(i=0,logint(n,2), if(bittest(n,i), ret=3*ret+1<Kevin Ryde, Oct 22 2021
  • Perl
    # call with n to get 2^n values
    $depth=shift; sub funct { my ($i, $b, $c) = @_; if ($i < $depth) { funct($i+1, $b*2, $c); funct($i+1, 2*$b+$c, $c*3); } else { print "$b, "; } } funct(0, 0, 1); print " ";
    
  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def a(n): return 0 if n==0 else 2*a((n - 1)//2) + 3**bin((n - 1)//2).count('1') if n%2 else 2*a(n//2)
    print([a(n) for n in range(131)]) # Indranil Ghosh, Aug 13 2017
    

Formula

a(0) = 0, a(2*n + 1) = 2*a(n) + 3^wt(n) = 2*a(n) + A048883(n), a(2*n) = 2*a(n), where wt(n) = A000120(n) = the number 1's in the binary representation of n.
a(k) = [z^k] 1 + (1/(1-z)) * Sum_{s=0..n-1} 2^s*z^(2^s)*(1 - z^(2^s)) * Product_{r=s+1..n-1} (1 + 3*z^(2^r)), for 0 < k <= 2^n-1. - Wolfgang Hintze, Jul 28 2017
a(n) = Sum_{i=0..k} 2^e[i] * 3^i where binary expansion n = 2^e[0] + 2^e[1] + ... + 2^e[k] with descending e[0] > e[1] > ... > e[k] (A272011). [Martín Chabrera lemma 6.1, adapting index i] - Kevin Ryde, Oct 22 2021

A343835 Irregular table T(n, k), n > 0, k = 1..A069010(n), read by rows; the n-th row contains the shortest partition of n whose values belong to A023758 and can be added without carriers in binary, in descending order.

Original entry on oeis.org

1, 2, 3, 4, 4, 1, 6, 7, 8, 8, 1, 8, 2, 8, 3, 12, 12, 1, 14, 15, 16, 16, 1, 16, 2, 16, 3, 16, 4, 16, 4, 1, 16, 6, 16, 7, 24, 24, 1, 24, 2, 24, 3, 28, 28, 1, 30, 31, 32, 32, 1, 32, 2, 32, 3, 32, 4, 32, 4, 1, 32, 6, 32, 7, 32, 8, 32, 8, 1, 32, 8, 2, 32, 8, 3
Offset: 1

Views

Author

Rémy Sigrist, May 01 2021

Keywords

Comments

In other words, the n-th row gives the numerical values of the runs of 1's in the binary expansion of n.

Examples

			Table begins:
     1:   [1]
     2:   [2]
     3:   [3]
     4:   [4]
     5:   [4, 1]
     6:   [6]
     7:   [7]
     8:   [8]
     9:   [8, 1]
    10:   [8, 2]
    11:   [8, 3]
    12:   [12]
    13:   [12, 1]
    14:   [14]
    15:   [15]
Table begins in binary:
       1:   [1]
      10:   [10]
      11:   [11]
     100:   [100]
     101:   [100, 1]
     110:   [110]
     111:   [111]
    1000:   [1000]
    1001:   [1000, 1]
    1010:   [1000, 10]
    1011:   [1000, 11]
    1100:   [1100]
    1101:   [1100, 1]
    1110:   [1110]
    1111:   [1111]
		

Crossrefs

Programs

  • PARI
    row(n) = { my (rr=[]); while (n, my (z=valuation(n, 2), o=valuation(n/2^z+1, 2), r=(2^o-1)*2^z); n-=r; rr = concat(r, rr);); rr }

Formula

T(n, 1) = A342126(n).
T(n, A069010(n)) = A342410(n).
Sum_{k = 1..A069010(n)} T(n, k) = n.

A330038 a(1) = 1, a(n) = [n/2] + a([n/2]) + a([(n+1)/2]) for n > 1, where [x] = floor(x).

Original entry on oeis.org

1, 3, 5, 8, 10, 13, 16, 20, 22, 25, 28, 32, 35, 39, 43, 48, 50, 53, 56, 60, 63, 67, 71, 76, 79, 83, 87, 92, 96, 101, 106, 112, 114, 117, 120, 124, 127, 131, 135, 140, 143, 147, 151, 156, 160, 165, 170, 176, 179, 183, 187, 192, 196, 201, 206, 212, 216, 221, 226, 232
Offset: 1

Views

Author

Stefano Spezia, Nov 28 2019

Keywords

Comments

a(n) is a sharp lower bound of the greatest whole number k such that there is a hypergraph (V, H) with |V| = k having no isolated vertices and containing no partitions of size greater than n (see Brian & Larson link, i.e. Definition 3.1, Lemma 4.2 and Proof of Theorem 4.6).
Partial sums of A063787. - Robert Israel, Nov 28 2019

Crossrefs

Cf. A004526, A063787 (first differences), A000788, A272011.

Programs

  • Magma
    I:=[1]; [n le 1 select I[n] else Floor(n/2)+Self(Floor(n/2))+Self(Floor((n+1)/2)): n in [1..60]];
    
  • Maple
    f:= proc(n) option remember;
    floor(n/2) + procname(floor(n/2)) + procname(floor((n+1)/2))
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Nov 28 2019
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Floor[n/2] + a[Floor[n/2]] + a[Floor[(n + 1)/2]];  Array[a, 60] (* Amiram Eldar, Nov 28 2019 *)
  • PARI
    a(n) = my(v=binary(n),t=#v); for(i=1,#v, if(v[i],v[i]=t++,t--);); fromdigits(v,2)>>1; \\ Kevin Ryde, Dec 16 2021
    
  • Python
    # Kevin Ryde's first formula
    def a(n): return sum(bin(i).count("1") for i in range(n)) + n
    print([a(n) for n in range(1, 61)]) # Michael S. Branicky, Dec 16 2021
    
  • Python
    # Kevin Ryde's second formula
    def a(n):
        b = list(map(int, bin(n)[2:]))
        e = [i for i, bi in enumerate(b[::-1]) if bi][::-1]
        return sum((ei + 2*i)*2**ei for i, ei in enumerate(e, 1))//2
    print([a(n) for n in range(1, 61)]) # Michael S. Branicky, Dec 16 2021

Formula

G.f. g(z) satisfies g(z) = z^2/((1+z)(1-z)^2) + (1+z)^2 g(z^2)/z. - Robert Israel, Nov 28 2019
From Kevin Ryde, Dec 16 2021: (Start)
a(n) = A000788(n-1) + n.
a(n) = (1/2) * Sum_{i=1..k} (e[i]+2*i) * 2^e[i], where binary expansion n = 2^e[1] + ... + 2^e[k] with descending exponents e[1] > e[2] > ... > e[k] (A272011).
(End)
Showing 1-10 of 15 results. Next