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

A164874 Triangle read by rows: T(1,1)=2; T(n,k)=2*T(n-1,k)+1, 1<=k

Original entry on oeis.org

2, 5, 6, 11, 13, 14, 23, 27, 29, 30, 47, 55, 59, 61, 62, 95, 111, 119, 123, 125, 126, 191, 223, 239, 247, 251, 253, 254, 383, 447, 479, 495, 503, 507, 509, 510, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1022, 1535, 1791, 1919, 1983, 2015, 2031, 2039, 2043, 2045, 2046
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 29 2009

Keywords

Comments

All terms contain exactly 1 zero in binary representation.

Examples

			Initial rows:
   1:                             2
   2:                        5        6
   3:                  11        13        14
   4:             23        27       29        30
   5:        47        55        59        61        62
   6:    95       111       119      123       125       126
also in binary representation:
                                 10
                            101       110
                      1011      1101      1110
                 10111     11011     11101     11110
           101111    110111    111011    111101    111110
      1011111   1101111   1110111   1111011   1111101   1111110 .
		

Crossrefs

Programs

  • Haskell
    a164874 n k = a164874_tabl !! (n-1) !! (k-1)
    a164874_row n = a164874_tabl !! (n-1)
    a164874_tabl = map reverse $ iterate f [2] where
       f xs@(x:_) = (2 * x + 2) : map ((+ 1) . (* 2)) xs
    -- Reinhard Zumkeller, Mar 31 2015
    
  • Mathematica
    A164874row[n_] := 2^(n + 1) - 1 - BitShiftRight[2^n, Range[n]];
    Array[A164874row, 10] (* Paolo Xausa, Jun 13 2025 *)
  • Python
    from math import isqrt
    def A164874(n): return (1<<(a:=(isqrt(n<<3)+1>>1)+1))-(1<<(a*(a-1)>>1)-n)-1 # Chai Wah Wu, May 21 2025

Formula

T(n,k) = 2^(n+1) - 2^(n-k) - 1, 1 <= k <= n.
T(n,k) = A030130(n*(n-1)/2 + k + 1);
A023416(T(n,k)) = 1, 1<=k<=n;
A059673(n) = sum of n-th row;
T(n,1) = A055010(n);
T(n,2) = A086224(n-2) for n > 1;
T(n,n-1) = A036563(n+1) for n > 1;
T(n,n) = A000918(n+1).

A066884 Square array read by upward antidiagonals where the n-th row contains the positive integers with n binary 1's.

Original entry on oeis.org

1, 3, 2, 7, 5, 4, 15, 11, 6, 8, 31, 23, 13, 9, 16, 63, 47, 27, 14, 10, 32, 127, 95, 55, 29, 19, 12, 64, 255, 191, 111, 59, 30, 21, 17, 128, 511, 383, 223, 119, 61, 39, 22, 18, 256, 1023, 767, 447, 239, 123, 62, 43, 25, 20, 512, 2047, 1535, 895, 479, 247, 125, 79, 45, 26, 24, 1024
Offset: 1

Views

Author

Jared Benjamin Ricks (jaredricks(AT)yahoo.com), Jan 21 2002

Keywords

Comments

This is a permutation of the positive integers; the inverse permutation is A067587.

Examples

			Column: 1   2   3   4   5   6
-----------------------------
Row 1:| 1   2   4   8  16  32
Row 2:| 3   5   6   9  10  12
Row 3:| 7  11  13  14  19  21
Row 4:|15  23  27  29  30  39
Row 5:|31  47  55  59  61  62
Row 6:|63  95 111 119 123 125
		

Crossrefs

Selected rows: A000079 (1), A018900 (2), A014311 (3), A014312 (4), A014313 (5), A023688 (6), A023689 (7), A023690 (8), A023691 (9), A038461 (10), A038462 (11), A038463 (12). For decimal analogs, see A011557 and A038444-A038452.
Selected columns: A000225 (1), A055010 (2).
Selected diagonals: A036563 (main), A000918 (1st upper), A153894 (2nd upper). [Franklin T. Adams-Watters, Apr 22 2009]
Cf. A067576 (the same array read by downward antidiagonals).
Antidiagonal sums give A361074.

Programs

  • Mathematica
    a = {}; Do[ a = Append[a, Last[ Take[ Take[ Select[ Range[2^12], Count[ IntegerDigits[ #, 2], 1] == j - i + 1 & ], j], i]]], {j, 1, 11}, {i, 1, j}]; a

Extensions

Corrected and extended by Henry Bottomley, Jan 27 2002

A190620 Odd numbers with a single zero in their binary expansion.

Original entry on oeis.org

5, 11, 13, 23, 27, 29, 47, 55, 59, 61, 95, 111, 119, 123, 125, 191, 223, 239, 247, 251, 253, 383, 447, 479, 495, 503, 507, 509, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1535, 1791, 1919, 1983, 2015, 2031, 2039, 2043, 2045, 3071, 3583, 3839, 3967, 4031
Offset: 1

Views

Author

Reinhard Zumkeller, May 14 2011

Keywords

Comments

Odd numbers such that the binary weight is one less than the number of significant digits. Except for the initial 0, A129868 is a subsequence of this sequence. - Alonso del Arte, May 14 2011
From Bernard Schott, Oct 20 2022: (Start)
A036563 \ {-2, -1, 1} is a subsequence, since for m >= 3, A036563(m) = 2^m - 3 has 11..1101 with (m-2) starting 1's for binary expansion.
A083329 \ {1, 2} is a subsequence, since for m >= 2, A083329(m) = 3*2^(m-1) - 1 has 1011..11 with (m-1) trailing 1's for binary expansion.
A129868 \ {0} is a subsequence, since for m >= 1, A129868(m) = 2*4^m - 2^m - 1 is a binary cyclops number that has 11..11011..11 with m starting 1's and m trailing 1's for binary expansion.
The 0-bit position in binary expansion of a(n) is at rank A004736(n) + 1 from the right.
For k >= 2, there are (k-1) terms between 2^k and 2^(k+1), or equivalently (k-1) terms with (k+1) bits.
{2*a(n), n>0} form a subsequence of A353654 (numbers with one trailing 0 bit and one other 0 bit). (End)

Crossrefs

A036563 \ {-2, -1, 1}, A083329 \ {1, 2}, A129868 are subsequences.
Odd numbers with k zeros in their binary expansion: A000225 (k=0), A357773 (k=2).

Programs

  • Haskell
    import Data.List (elemIndices)
    a190620 n = a190620_list !! (n-1)
    a190620_list = filter odd $ elemIndices 1 a023416_list
    -- A more efficient version, inspired by the Maple program in A190619:
    a190620_list' = g 8 2 where
       g m 2 = (m - 3) : g (2*m) (m `div` 2)
       g m k = (m - k - 1) : g m (k `div` 2)
    
  • Maple
    isA := proc(n) convert(n, base, 2): %[1] = nops(%) - add(%) end:
    select(isA, [$1..4031]); # Peter Luschny, Oct 27 2022
    # Alternatively, using a formula of Bernard Schott and A123578:
    A190620 := proc(n) A123578(n); 4*2^% - 2^(1 - n + (% + %^2)/2) - 1 end:
    seq(A190620(n), n = 1..50); # Peter Luschny, Oct 28 2022
  • Mathematica
    Select[Range[1,5001,2],DigitCount[#,2,0]==1&] (* Harvey P. Dale, Jul 12 2018 *)
  • Python
    from itertools import count, islice
    def agen():
        for d in count(3):
            b = 1 << d
            for i in range(2, d):
                yield b - (b >> i) - 1
    print(list(islice(agen(), 50))) # Michael S. Branicky, Oct 13 2022
    
  • Python
    from math import isqrt, comb
    def A190620(n): return (1<<(a:=(isqrt(n<<3)+1>>1)+1)+1)-(1<Chai Wah Wu, Dec 18 2024

Formula

A190619(n) = A007088(a(n));
A023416(a(n)) = 1.
From Bernard Schott, Oct 21 2022: (Start)
a((n-1)*(n-2)/2 - (i-1)) = 2^n - 2^i - 1 for n >= 3 and 1 <= i <= n-2 (after Robert Israel in A357773).
a(n) = A000225(A002024(n)+2) - A000079(A004736(n)).
a(n) = 4*2^k(n) - 2^(1 - n + (k(n) + k(n)^2)/2) - 1, where k is the Kruskal-Macaulay function A123578.
A070939(a(n)) = A002024(n) + 2. (End)

A086784 Number of non-trailing zeros in binary representation of n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 03 2003

Keywords

Comments

a(n) is also the number of parts smaller than 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

Examples

			a(34) = 3; indeed the binary representation of 34 is 100010, having 3 non-trailing zeros. - _Emeric Deutsch_ Jul 24 2017
		

Crossrefs

Cf. A007088.

Programs

  • Maple
    a := proc (n) local b, c: b := proc (n) if `mod`(n, 2) = 0 then 1+b((1/2)*n) else 0 end if end proc: c := proc (n) if n = 0 then 2 elif n = 1 then 0 elif `mod`(n, 2) = 0 then 1+c((1/2)*n) else c((1/2)*n-1/2) end if end proc: if n = 0 then 0 else c(n)-b(n) end if end proc: seq(a(n), n = 0 .. 101); # b and c are the Maple programs for A007814 and A023416, respectively. - Emeric Deutsch Jul 24 2017
  • Mathematica
    A086784[n_] := If[n == 0, 0, DigitCount[n, 2, 0] - IntegerExponent[n, 2]];
    Array[A086784, 100, 0] (* Paolo Xausa, Oct 01 2024 *)
  • PARI
    a(n)=if(n==0,0,exponent(n)+1-hammingweight(n)-valuation(n,2)); \\ Antoine Mathys, Nov 20 2024
  • Python
    def A086784(n): return bin(n>>(~n & n-1).bit_length())[2:].count('0') if n else 0 # Chai Wah Wu, Oct 14 2022
    

Formula

a(n) = A023416(n) - A007814(n) for n>0.
a(2^n) = a(A000079(n)) = 0; a(2^n - 1) = a(A000225(n)) = 0;
a(2^n + 1) = a(A000051(n)) = n - 1;
a(3*2^n - 1) = a(A055010(n)) = 1 for n>0;
a(2^n - 3) = a(A036563(n)) = 1, for n>2;
a((4^n - 1)/3) = a(A002450(n)) = n.
a(n) = if n mod 4 = 1 then a(floor(n/4)) + A007814(floor(n/2)) else a(floor(n/2)); a(0) = a(1) = 0.

A119725 Triangular array read by rows: T(n,1) = T(n,n) = 1, T(n,k) = 3*T(n-1,k-1) + 2*T(n-1,k).

Original entry on oeis.org

1, 1, 1, 1, 5, 1, 1, 13, 17, 1, 1, 29, 73, 53, 1, 1, 61, 233, 325, 161, 1, 1, 125, 649, 1349, 1297, 485, 1, 1, 253, 1673, 4645, 6641, 4861, 1457, 1, 1, 509, 4105, 14309, 27217, 29645, 17497, 4373, 1, 1, 1021, 9737, 40933, 97361, 140941, 123929, 61237, 13121, 1
Offset: 1

Views

Author

Zerinvary Lajos, Jun 14 2006

Keywords

Comments

Second column is like A036563.
Second diagonal is A048473.

Examples

			Triangle begins:
  1;
  1,    1;
  1,    5,    1;
  1,   13,   17,     1;
  1,   29,   73,    53,     1;
  1,   61,  233,   325,   161,      1;
  1,  125,  649,  1349,  1297,    485,      1;
  1,  253, 1673,  4645,  6641,   4861,   1457,     1;
  1,  509, 4105, 14309, 27217,  29645,  17497,  4373,     1;
  1, 1021, 9737, 40933, 97361, 140941, 123929, 61237, 13121, 1;
		

Crossrefs

Programs

  • Magma
    function T(n,k)
      if k eq 1 or k eq n then return 1;
      else return 3*T(n-1,k-1) + 2*T(n-1,k);
      end if;
      return T;
    end function;
    [T(n,k): k in [1..n], n in [1..12]]; // G. C. Greubel, Nov 18 2019
    
  • Maple
    T:= proc(n, k) option remember;
          if k=1 and k=n then 1
        else 3*T(n-1, k-1) + 2*T(n-1, k)
          fi
        end:
    seq(seq(T(n, k), k=1..n), n=1..12); # G. C. Greubel, Nov 18 2019
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==1 || k==n, 1, 3*T[n-1, k-1] + 2*T[n-1, k]]; Table[T[n,k], {n,10}, {k,n}]//Flatten (* G. C. Greubel, Nov 18 2019 *)
  • PARI
    T(n,k) = if(k==1 || k==n, 1, 3*T(n-1,k-1) + 2*T(n-1,k)); \\ G. C. Greubel, Nov 18 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==1 or k==n): return 1
        else: return 3*T(n-1, k-1) + 2*T(n-1, k)
    [[T(n, k) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Nov 18 2019

Extensions

Edited by Don Reble, Jul 24 2006

A131112 T(n,k) = 4*binomial(n,k) - 3*I(n,k), where I is the identity matrix; triangle T read by rows (n >= 0 and 0 <= k <= n).

Original entry on oeis.org

1, 4, 1, 4, 8, 1, 4, 12, 12, 1, 4, 16, 24, 16, 1, 4, 20, 40, 40, 20, 1, 4, 24, 60, 80, 60, 24, 1, 4, 28, 84, 140, 140, 84, 28, 1, 4, 32, 112, 224, 280, 224, 112, 32, 1, 4, 36, 144, 336, 504, 504, 336, 144, 36, 1
Offset: 0

Views

Author

Gary W. Adamson, Jun 15 2007

Keywords

Examples

			Triangle T(n,k) (with rows n >= 0 and columns k = 0..n) begins:
  1;
  4,  1;
  4,  8,  1;
  4, 12, 12,  1;
  4, 16, 24, 16,  1;
  4, 20, 40, 40, 20, 1;
  ...
		

Crossrefs

Programs

  • GAP
    T:= function(n,k)
        if k=n then return 1;
        else return 4*Binomial(n,k);
        fi;  end;
    Flat(List([0..10], n-> List([0..n], k-> T(n,k) ))); # G. C. Greubel, Nov 18 2019
  • Magma
    [k eq n select 1 else 4*Binomial(n,k): k in [0..n], n in [0..10]]; // G. C. Greubel, Nov 18 2019
    
  • Maple
    seq(seq(`if`(k=n, 1, 4*binomial(n,k)), k=0..n), n=0..10); # G. C. Greubel, Nov 18 2019
  • Mathematica
    Table[If[k==n, 1, 4*Binomial[n, k]], {n,0,10}, {k,0,n}]//Flatten (* G. C. Greubel, Nov 18 2019 *)
  • PARI
    T(n,k) = if(k==n, 1, 4*binomial(n,k)); \\ G. C. Greubel, Nov 18 2019
    
  • Sage
    def T(n, k):
        if (k==n): return 1
        else: return 4*binomial(n, k)
    [[T(n, k) for k in (0..n)] for n in (0..10)]
    # G. C. Greubel, Nov 18 2019
    

Formula

T(n,k) = 4*A007318(n,k) - 3*I(n,k), where A007318 = Pascal's triangle and I = Identity matrix.
n-th row sum = A036563(n+2) = 2^(n+2) - 3.
Bivariate o.g.f.: Sum_{n,k>=0} T(n,k)*x^n*y^k = (1 + 3*x - x*y)/((1 - x*y)*(1 - x - x*y)). - Petros Hadjicostas, Feb 20 2021

A176487 Triangle read by rows: T(n,k) = binomial(n,k) + A008292(n+1,k+1) - 1.

Original entry on oeis.org

1, 1, 1, 1, 5, 1, 1, 13, 13, 1, 1, 29, 71, 29, 1, 1, 61, 311, 311, 61, 1, 1, 125, 1205, 2435, 1205, 125, 1, 1, 253, 4313, 15653, 15653, 4313, 253, 1, 1, 509, 14635, 88289, 156259, 88289, 14635, 509, 1, 1, 1021, 47875, 455275, 1310479, 1310479, 455275, 47875, 1021, 1
Offset: 0

Views

Author

Roger L. Bagula, Apr 19 2010

Keywords

Examples

			Triangle begins as:
  1;
  1,    1;
  1,    5,     1;
  1,   13,    13,      1;
  1,   29,    71,     29,       1;
  1,   61,   311,    311,      61,       1;
  1,  125,  1205,   2435,    1205,     125,      1;
  1,  253,  4313,  15653,   15653,    4313,    253,     1;
  1,  509, 14635,  88289,  156259,   88289,  14635,   509,    1;
  1, 1021, 47875, 455275, 1310479, 1310479, 455275, 47875, 1021,   1;
		

Crossrefs

Programs

  • Magma
    A176487:= func< n, k | Binomial(n, k) + EulerianNumber(n+1, k) - 1 >;
    [A176487(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Dec 31 2024
    
  • Maple
    A176487 := proc(n,k)
        binomial(n,k)+A008292(n+1,k+1)-1 ;
    end proc: # R. J. Mathar, Jun 16 2015
  • Mathematica
    Needs["Combinatorica`"];
    T[n_, k_, 0]:= Binomial[n, k];
    T[n_, k_, 1]:= Eulerian[1 + n, k];
    T[n_, k_, q_]:= T[n,k,q] = T[n,k,q-1] + T[n,k,q-2] - 1;
    Table[T[n,k,2], {n,0,12}, {k,0,n}]//Flatten
  • SageMath
    # from sage.all import * # (use for Python)
    from sage.combinat.combinat import eulerian_number
    def A176487(n,k): return binomial(n,k) +eulerian_number(n+1,k) -1
    print(flatten([[A176487(n,k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Dec 31 2024

Formula

T(n, k) = A007318(n,k) + A008292(n+1,k+1) - 1, 0 <= k <= n.
Sum_{k=0..n} T(n, k) = 2^n - n + A033312(n+1) (row sums).
T(n, k) = 2*A141689(n+1,k+1) - 1. - R. J. Mathar, Jan 19 2011
From G. C. Greubel, Dec 31 2024: (Start)
T(n, n-k) = T(n, k).
T(n, 1) = A036563(n+1).
Sum_{k=0..n} (-1)^k * T(n,k) = ((-1)^(n/2)*A000182(n/2 + 1) - 1)*(1 + (-1)^n)/2 + [n=0]. (End)

A283508 Binary representation of the x-axis, from the origin to the right edge, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 643", based on the 5-celled von Neumann neighborhood.

Original entry on oeis.org

1, 10, 101, 1011, 10111, 101111, 1011111, 10111111, 101111111, 1011111111, 10111111111, 101111111111, 1011111111111, 10111111111111, 101111111111111, 1011111111111111, 10111111111111111, 101111111111111111, 1011111111111111111, 10111111111111111111
Offset: 0

Views

Author

Robert Price, Mar 09 2017

Keywords

Comments

Initialized with a single black (ON) cell at stage zero.
As far as the b-files reach (125 terms) this is the same as A267623. - R. J. Mathar, Mar 17 2017

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Programs

  • Mathematica
    CAStep[rule_, a_] := Map[rule[[10 - #]] &, ListConvolve[{{0, 2, 0},{2, 1, 2}, {0, 2, 0}}, a, 2],{2}];
    code = 643; stages = 128;
    rule = IntegerDigits[code, 2, 10];
    g = 2 * stages + 1; (* Maximum size of grid *)
    a = PadLeft[{{1}}, {g, g}, 0,Floor[{g, g}/2]]; (* Initial ON cell on grid *)
    ca = a;
    ca = Table[ca = CAStep[rule, ca], {n, 1, stages + 1}];
    PrependTo[ca, a];
    (* Trim full grid to reflect growth by one cell at each stage *)
    k = (Length[ca[[1]]] + 1)/2;
    ca = Table[Table[Part[ca[[n]] [[j]],Range[k + 1 - n, k - 1 + n]], {j, k + 1 - n, k - 1 + n}], {n, 1, k}];
    Table[FromDigits[Part[ca[[i]] [[i]], Range[i, 2 * i - 1]], 10], {i, 1, stages - 1}]

Formula

Conjectures from Colin Barker, Mar 10 2017: (Start)
G.f.: (1 - x + x^2) / ((1 - x)*(1 - 10*x)).
a(n) = (91*10^n - 10) / 90 for n>0.
a(n) = 11*a(n-1) - 10*a(n-2) for n>2.
(End)
Equivalent conjecture: a(n) = A267623(n). - R. J. Mathar, Mar 17 2017

A362030 Irregular triangle read by rows where row n contains the balanced binary words of length 2n interpreted as binary numbers.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 10, 12, 7, 11, 13, 14, 19, 21, 22, 25, 26, 28, 35, 37, 38, 41, 42, 44, 49, 50, 52, 56, 15, 23, 27, 29, 30, 39, 43, 45, 46, 51, 53, 54, 57, 58, 60, 71, 75, 77, 78, 83, 85, 86, 89, 90, 92, 99, 101, 102, 105, 106, 108, 113, 114, 116, 120, 135
Offset: 1

Views

Author

Louis Conover, Apr 05 2023

Keywords

Comments

Within a row, strings are ordered lexicographically, which means the resulting values are ordered numerically.
This is from an idea of David Lovler, which he calls "zigzags". It is a rearrangement of A072601. A072603 lists all the numbers that are not in this sequence. A000984 gives the number of coin flip sequences of length 2,4,6, etc.
Not a permutation of the integers. E.g. 8 never occurs. When there are more 0's than 1's, adding 0's doesn't bring it to balance. - Kevin Ryde, Aug 31 2023

Examples

			The first few terms written as binary words with leading 0's: 01, 10, 0011, 0101, 0110, 1001, 1010, 1100, 000111, 001011, 001101, 001110, ... (cf. A368804).
Triangle T(n,k) begins:
   1,  2;
   3,  5,  6,  9, 10, 12;
   7, 11, 13, 14, 19, 21, 22, 25, 26, 28, 35, 37, 38, ...;
  15, 23, 27, 29, 30, 39, 43, 45, 46, 51, 53, 54, 57, ...;
  ...
		

Crossrefs

Columns k=1-2 give: A000225, A083329.
Row sums give A131568.
Main diagonal gives A036563(n+1).
Cf. A000984 (row lengths), A072601, A072603, A368804 (binary).

Programs

  • Maple
    T:= n-> sort(map(Bits[Join], combinat[permute]([0$n, 1$n])))[]:
    seq(T(n), n=1..4);  # Alois P. Heinz, Apr 13 2023
  • Mathematica
    T[n_] := Sort[FromDigits[#, 2] & /@ Permutations[Join[ConstantArray[0, n], ConstantArray[1, n]]]]; Flatten[Table[T[n], {n, 1, 4}]][[1 ;; 64]] (* Robert P. P. McKone, Aug 29 2023 *)

A224195 Ordered sequence of numbers of form (2^n - 1)*2^m + 1 where n >= 1, m >= 1.

Original entry on oeis.org

3, 5, 7, 9, 13, 15, 17, 25, 29, 31, 33, 49, 57, 61, 63, 65, 97, 113, 121, 125, 127, 129, 193, 225, 241, 249, 253, 255, 257, 385, 449, 481, 497, 505, 509, 511, 513, 769, 897, 961, 993, 1009, 1017, 1021, 1023, 1025, 1537, 1793, 1921, 1985, 2017, 2033, 2041, 2045, 2047
Offset: 1

Views

Author

Brad Clardy, Apr 01 2013

Keywords

Comments

The table is constructed so that row labels are 2^n - 1, and column labels are 2^n. The body of the table is the row*col + 1. A MAGMA program is provided that generates the numbers in a table format. The sequence is read along the antidiagonals starting from the top left corner.
All of these numbers have the following property:
let m be a member of A(n),
if a sequence B(n) = all i such that i XOR (m - 1) = i - (m - 1), then
the differences between successive members of B(n) is a repeating series
of 1's with the last difference in the pattern m. The number of ones in
the pattern is 2^j - 1, where j is the column index.
As an example consider A(4) which is 9,
the sequence B(n) where i XOR 8 = i - 8 starts as:
8, 9, 10, 11, 12, 13, 14, 15, 24... (A115419)
with successive differences of:
1, 1, 1, 1, 1, 1, 1, 9.
The main diagonal is the 6th cyclotomic polynomial evaluated at powers of two (A020515).
The formula for diagonals above the main diagonal
2^(2*n+1) - 2^(n + (a+1)/2) + 1 n>=(a+1)/2 a=odd number above diagonal
2^(2*n) - 2^(n + (b/2)) + 1 n>=(b/2)+1 b=even number above diagonal
The formulas for diagonals below the main diagonal
2^(2*n+1) - 2^(n + 1 -(a+1)/2) + 1 n>=(a+1)/2 a=odd number below diagonal
2^(2*n) - 2^(n - (b/2)) + 1 n>=(b/2)+1 b=even number below diagonal
Primes of this sequence are in A152449.

Examples

			Using the lexicographic ordering of A057555 the sequence is:
A(n) = Table(i,j) with (i,j)=(1,1),(1,2),(2,1),(1,3),(2,2),(3,1)...
  +1  |    2    4     8    16    32     64    128    256     512    1024 ...
  ----|-----------------------------------------------------------------
  1   |    3    5     9    17    33     65    129    257     513    1025
  3   |    7   13    25    49    97    193    385    769    1537    3073
  7   |   15   29    57   113   225    449    897   1793    3585    7169
  15  |   31   61   121   241   481    961   1921   3841    7681   15361
  31  |   63  125   249   497   993   1985   3969   7937   15873   31745
  63  |  127  253   505  1009  2017   4033   8065  16129   32257   64513
  127 |  255  509  1017  2033  4065   8129  16257  32513   65025  130049
  255 |  511 1021  2041  4081  8161  16321  32641  65281  130561  261121
  511 | 1023 2045  4089  8177 16353  32705  65409 130817  261633  523265
  1023| 2047 4093  8185 16369 32737  65473 130945 261889  523777 1047553
  ...
		

Crossrefs

Cf. A081118, A152449 (primes), A057555 (lexicographic ordering), A115419 (example).
Rows: A000051(i=1), A181565(2), A083686(3), A195744(4), A206371(5), A196657(6).
Cols: A000225(j=1), A036563(2), A048490(3), A176303 (7 offset of 8).
Diagonals: A020515 (main), A092440, A060867 (above), A134169 (below).

Programs

  • Magma
    //program generates values in a table form
    for i:=1 to 10 do
        m:=2^i - 1;
        m,[ m*2^n +1 : n in [1..10]];
    end for;
    //program generates sequence in lexicographic ordering of A057555, read
    //along antidiagonals from top. Primes in the sequence are marked with *.
    for i:=2 to 18 do
        for j:=1 to i-1 do
           m:=2^j -1;
           k:=m*2^(i-j) + 1;
           if IsPrime(k) then k,"*";
              else k;
           end if;;
        end for;
    end for;
  • Mathematica
    Table[(2^j-1)*2^(i-j+1) + 1, {i, 10}, {j, i}] (* Paolo Xausa, Apr 02 2024 *)

Formula

a(n) = (2^(A057555(2*n-1)) - 1)*2^(A057555(2*n)) + 1 for n>=1. [corrected by Jason Yuen, Feb 22 2025]
a(n) = A081118(n)+2; a(n)=(2^i-1)*2^j+1, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Apr 04 2013
Previous Showing 21-30 of 72 results. Next