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

A048483 Array read by antidiagonals: T(k,n) = (k+1)2^n - k.

Original entry on oeis.org

1, 2, 1, 4, 3, 1, 8, 7, 4, 1, 16, 15, 10, 5, 1, 32, 31, 22, 13, 6, 1, 64, 63, 46, 29, 16, 7, 1, 128, 127, 94, 61, 36, 19, 8, 1, 256, 255, 190, 125, 76, 43, 22, 9, 1, 512, 511, 382, 253, 156, 91, 50, 25, 10, 1, 1024, 1023, 766, 509, 316, 187
Offset: 0

Views

Author

Keywords

Comments

n-th difference of (T(k,n),T(k,n-1),...,T(k,0)) is k+1, for n=1,2,3,...; k=0,1,2,...

Examples

			1 2 4 8 16 32 ...
1 3 7 15 31 63 ...
1 4 10 22 46 94 ...
1 5 13 29 61 125 ...
1 6 16 36 76 156 ...
		

Crossrefs

Rows are A000079 (k=0), A000225 (k=1), A033484 (k=2), A036563 (k=3), A048487 (k=4), A048488 (k=5), A048489 (k=6), A048490 (k=7), A048491 (k=8).
Main diagonal is A048493. Cf. A048494.

Formula

G.f.: (1-x+kx)/[(1-x)(1-2x)]. E.g.f.: (k+1)*exp(2x) - k*exp(x).
Recurrences: T(k, n) = 2T(k, n-1)+k = T(k-1, n)+2^n-1, T(k, 0) = 1.

Extensions

Edited by Ralf Stephan, Feb 05 2004

A357773 Odd numbers with two zeros in their binary expansion.

Original entry on oeis.org

9, 19, 21, 25, 39, 43, 45, 51, 53, 57, 79, 87, 91, 93, 103, 107, 109, 115, 117, 121, 159, 175, 183, 187, 189, 207, 215, 219, 221, 231, 235, 237, 243, 245, 249, 319, 351, 367, 375, 379, 381, 415, 431, 439, 443, 445, 463, 471, 475, 477, 487, 491, 493, 499, 501
Offset: 1

Views

Author

Bernard Schott, Oct 12 2022

Keywords

Comments

A048490 \ {1} is a subsequence, since for m >= 1, A048490(m) = 8*2^m - 7 has 11..11001 with m starting 1 for binary expansion.
A153894 \ {4} is a subsequence, since for m >= 1, A153894(m) = 5*2^m - 1 has 10011..11 with m trailing 1 for binary expansion.
A220236 is a subsequence, since for m >= 1, A220236(m) = 2^(2*m + 2) - 2^(m + 1) - 2^m - 1 has 11..110011..11 with m starting 1 and m trailing 1 for binary expansion.
For k > 2, there are (k-1)*(k-2)/2 terms between 2^k and 2^(k+1), or equivalently (k-1)*(k-2)/2 terms with k+1 bits.
Binary expansion of a(n) is A357774(n).
{4*a(n), n>0} form a subsequence of A353654 (numbers with two trailing 0 bits and two other 0 bits).

Crossrefs

Odd numbers with k zeros in their binary expansion: A000225 (k=0), A190620 (k=1).
Subsequences: A048490 \ {1}, A153894 \ {4}, A220236.

Programs

  • Maple
    seq(seq(seq(2^n-1-2^i-2^j,j=i-1..1,-1),i=n-2..1,-1),n=4..10); # Robert Israel, Oct 13 2022
  • Mathematica
    Select[Range[1, 500, 2], DigitCount[#, 2, 0] == 2 &] (* Amiram Eldar, Oct 12 2022 *)
  • PARI
    isok(k) = (k%2) && (#binary(k) == hammingweight(k)+2); \\ Michel Marcus, Oct 13 2022
    
  • PARI
    list(lim)=my(v=List()); for(n=4,logint(lim\=1,2)+1, my(N=2^n-1); forstep(a=n-2,2,-1, my(A=N-1<lim, break(2)); listput(v,t)))); Vec(v) \\ Charles R Greathouse IV, Oct 21 2022
  • Python
    def a(n):
        m = 0
        while m*(m+1)*(m+2)//6 <= n: m += 1
        m -= 1 # m = A056556(n-1)
        k, r, j = m + 4, n - m*(m+1)*(m+2)//6, 0
        while r >= 0: r -= (m+1-j); j += 1
        j += 1
        return 2**k - 2**(k-j) - 2**(-r) - 1
    print([a(n) for n in range(60)]) # Michael S. Branicky, Oct 12 2022
    
  • Python
    # faster version for generating initial segment of sequence
    from itertools import combinations, count, islice
    def agen():
        for d in count(4):
            b, c = 2**d - 1, 2**(d-1)
            for i, j in combinations(range(1, d-1), 2):
                yield b - (c >> i) - (c >> j)
    print(list(islice(agen(), 60))) # Michael S. Branicky, Oct 13 2022
    
  • Python
    from math import comb, isqrt
    from sympy import integer_nthroot
    def A357773(n):
        a = (m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2,3))+3
        b = isqrt((j:=comb(a-1,3)-n+1)<<3)+3>>1
        c = j-comb((r:=isqrt(w:=j<<1))+(w>r*(r+1)),2)
        return (1<Chai Wah Wu, Dec 17 2024
    

Formula

A023416(a(n)) = 2.
a((n-1)*(n-2)*(n-3)/6 - (i-1)*(i-2)/2 - (j-1)) = 2^n - 2^i - 2^j - 1 for 1 <= j < i <= n-2. - Robert Israel, Oct 13 2022

Extensions

a(11) and beyond from Michael S. Branicky, Oct 12 2022

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

A062001 Table by antidiagonals of n-Stohr sequences: T(n,k) is least positive integer not the sum of at most n distinct terms in the n-th row from T(n,1) through to T(n,k-1).

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 4, 2, 1, 5, 7, 4, 2, 1, 6, 10, 8, 4, 2, 1, 7, 13, 15, 8, 4, 2, 1, 8, 16, 22, 16, 8, 4, 2, 1, 9, 19, 29, 31, 16, 8, 4, 2, 1, 10, 22, 36, 46, 32, 16, 8, 4, 2, 1, 11, 25, 43, 61, 63, 32, 16, 8, 4, 2, 1, 12, 28, 50, 76, 94, 64, 32, 16, 8, 4, 2, 1, 13, 31, 57, 91, 125, 127, 64, 32, 16, 8, 4, 2, 1
Offset: 1

Views

Author

Henry Bottomley, May 29 2001

Keywords

Examples

			Array begins as:
  1, 2, 3, 4,  5,  6,  7,   8,   9, ... A000027;
  1, 2, 4, 7, 10, 13, 16,  19,  22, ... A033627;
  1, 2, 4, 8, 15, 22, 29,  36,  43, ... A026474;
  1, 2, 4, 8, 16, 31, 46,  61,  76, ... A051039;
  1, 2, 4, 8, 16, 32, 63,  94, 125, ... A051040;
  1, 2, 4, 8, 16, 32, 64, 127, 190, ... ;
  1, 2, 4, 8, 16, 32, 64, 128, 255, ... ;
  1, 2, 4, 8, 16, 32, 64, 128, 256, ... ;
  1, 2, 4, 8, 16, 32, 64, 128, 256, ... ;
Antidiagonal triangle begins as:
   1;
   2,  1;
   3,  2,  1;
   4,  4,  2,  1;
   5,  7,  4,  2,   1;
   6, 10,  8,  4,   2,   1;
   7, 13, 15,  8,   4,   2,  1;
   8, 16, 22, 16,   8,   4,  2,  1;
   9, 19, 29, 31,  16,   8,  4,  2,  1;
  10, 22, 36, 46,  32,  16,  8,  4,  2, 1;
  11, 25, 43, 61,  63,  32, 16,  8,  4, 2, 1;
  12, 28, 50, 76,  94,  64, 32, 16,  8, 4, 2, 1;
  13, 31, 57, 91, 125, 127, 64, 32, 16, 8, 4, 2, 1;
		

Crossrefs

Diagonals include A000079, A000225, A033484, A036563, A048487.
A048483 can be seen as half this table.

Programs

  • Mathematica
    T[n_, k_]:= If[kG. C. Greubel, May 03 2022 *)
  • SageMath
    def A062001(n,k):
        if (kA062001(n,k) for k in (1..n)] for n in (1..15)]) # G. C. Greubel, May 03 2022

Formula

If k <= n+1 then A(n, k) = 2^(k-1), while if k > n+1, A(n, k) = (2^n - 1)*(k - n) + 1 (array).
T(n, k) = A(k, n-k+1) (antidiagonals).
T(2*n-1, n) = A000079(n-1), n >= 1.
T(2*n, n) = A000079(n), n >= 1.
T(2*n+1, n) = A000225(n+1), n >= 1.
T(2*n+2, n) = A033484(n), n >= 1.
T(2*n+3, n) = A036563(n+3), n >= 1.
T(2*n+4, n) = A048487(n), n >= 1.
From G. C. Greubel, May 03 2022: (Start)
T(n, k) = (2^k - 1)*(n-2*k+1) + 1 for k < n/2, otherwise 2^(n-k).
T(2*n+5, n) = A048488(n), n >= 1.
T(2*n+6, n) = A048489(n), n >= 1.
T(2*n+7, n) = A048490(n), n >= 1.
T(2*n+8, n) = A048491(n), n >= 1.
T(2*n+9, n) = A139634(n), n >= 1.
T(2*n+10, n) = A139635(n), n >= 1.
T(2*n+11, n) = A139697(n), n >= 1. (End)

A246168 a(n) = 2^n - 10.

Original entry on oeis.org

-9, -8, -6, -2, 6, 22, 54, 118, 246, 502, 1014, 2038, 4086, 8182, 16374, 32758, 65526, 131062, 262134, 524278, 1048566, 2097142, 4194294, 8388598, 16777206, 33554422, 67108854, 134217718, 268435446, 536870902, 1073741814, 2147483638
Offset: 0

Views

Author

Vincenzo Librandi, Aug 18 2014

Keywords

Crossrefs

Sequences of the form 2^n-k: A000079 (k=0), A000225 (k=1), A000918 (k=2), A036563 (k=3), A028399 (k=4), A168616 (k=5), A131130 (k=6), A048490 (k=7), A159741 (k=8), A185346 (k=9), this sequence (k=10).

Programs

  • Magma
    [2^n-10: n in [0..40]];
    
  • Mathematica
    Table[2^n - 10, {n, 0, 35}] (* or *) CoefficientList[Series[(-9 + 19 x)/(1 - 3 x + 2 x^2), {x, 0, 35}], x]
    LinearRecurrence[{3,-2},{-9,-8},50] (* Harvey P. Dale, Jan 11 2024 *)
  • PARI
    vector(50, n, 2^(n-1)-10) \\ Derek Orr, Aug 18 2014

Formula

G.f.: (-9+19*x)/(1-3*x+2*x^2).
a(n) = 3*a(n-1) - 2*a(n-2).
a(n) = A000079(n) - 10.
From Elmo R. Oliveira, Dec 21 2023: (Start)
a(n) = 2*a(n-1) + 10 for n>0.
E.g.f.: exp(x)*(exp(x) - 10). (End)
Showing 1-5 of 5 results.