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

A336725 A(n,k) is the n-th number that is a sum of k positive k-th powers; square array A(n,k), n>=1, k>=1, read by antidiagonals.

Original entry on oeis.org

1, 2, 2, 3, 5, 3, 4, 10, 8, 4, 5, 19, 17, 10, 5, 6, 36, 34, 24, 13, 6, 7, 69, 67, 49, 29, 17, 7, 8, 134, 132, 98, 64, 36, 18, 8, 9, 263, 261, 195, 129, 84, 43, 20, 9, 10, 520, 518, 388, 258, 160, 99, 55, 25, 10, 11, 1033, 1031, 773, 515, 321, 247, 114, 62, 26, 11, 12, 2058, 2056, 1542, 1028, 642, 384, 278, 129, 66, 29, 12
Offset: 1

Views

Author

Alois P. Heinz, Aug 01 2020

Keywords

Examples

			Square array A(n,k) begins:
   1,  2,  3,   4,   5,   6,    7,    8,    9,   10, ...
   2,  5, 10,  19,  36,  69,  134,  263,  520, 1033, ...
   3,  8, 17,  34,  67, 132,  261,  518, 1031, 2056, ...
   4, 10, 24,  49,  98, 195,  388,  773, 1542, 3079, ...
   5, 13, 29,  64, 129, 258,  515, 1028, 2053, 4102, ...
   6, 17, 36,  84, 160, 321,  642, 1283, 2564, 5125, ...
   7, 18, 43,  99, 247, 384,  769, 1538, 3075, 6148, ...
   8, 20, 55, 114, 278, 734,  896, 1793, 3586, 7171, ...
   9, 25, 62, 129, 309, 797, 2193, 2048, 4097, 8194, ...
  10, 26, 66, 164, 340, 860, 2320, 6568, 4608, 9217, ...
		

Crossrefs

Rows n=1-3 give: A000027, A052944, A145071.
Main diagonal gives A000337.
Cf. A336820.

Programs

  • Maple
    A:= proc() local l, w, A; l, w, A:= proc() [] end, proc() [] end,
          proc(n, k) option remember; local b; b:=
            proc(x, y) option remember; `if`(x=0, {0}, `if`(y<1, {},
              {b(x, y-1)[], map(t-> t+l(k)[y], b(x-1, y))[]}))
            end;
            while nops(w(k)) < n do forget(b);
              l(k):= [l(k)[], (nops(l(k))+1)^k];
              w(k):= sort([select(h-> h
    				
  • Mathematica
    nmax = 12;
    pow[n_, k_] := IntegerPartitions[n, {k}, Range[n^(1/k) // Ceiling]^k];
    col[k_] := col[k] = Reap[Module[{j = k, n = 1, p}, While[n <= nmax, p = pow[j, k]; If[p =!= {}, Sow[j]; n++]; j++]]][[2, 1]];
    A[n_, k_] := col[k][[n]];
    Table[A[n-k+1, k], {n, 1, nmax}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 03 2020 *)

A127330 Begin with the empty sequence and a starting number s = 0. At step k (k >= 1) append the k consecutive numbers s to s+k-1 and change the starting number (for the next step) to 2s+2.

Original entry on oeis.org

0, 2, 3, 6, 7, 8, 14, 15, 16, 17, 30, 31, 32, 33, 34, 62, 63, 64, 65, 66, 67, 126, 127, 128, 129, 130, 131, 132, 254, 255, 256, 257, 258, 259, 260, 261, 510, 511, 512, 513, 514, 515, 516, 517, 518, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 2046
Offset: 0

Views

Author

Steven Cartier (steven.cartier(AT)rogers.com), Mar 30 2007

Keywords

Comments

From a TV show.
A129142 and A129143 are similar, slightly more natural, but for a puzzle perhaps too transparent sequences.
Can be seen as a triangle (row by step) read by rows: T(n,k) = T(n-1,k) + 2^n for k < n and T(n,n) = T(n-1,n-1) + 2^n + 1. - Reinhard Zumkeller, Nov 16 2013

Examples

			In step 1 starting number 0 is appended to the empty sequence and the next starting number is 2*0 + 2 = 2. In step 2 the two numbers 2, 3 are appended and the starting number is changed to 2*2 + 2 = 6.
		

Crossrefs

Cf. A000918 (left edge), A145071 (right edge).

Programs

  • Haskell
    a127330 n k = a127330_tabl !! n !! k
    a127330_row n = a127330_tabl !! n
    a127330_tabl = step 0 1 where
       step s k = [s .. s + k - 1] : step (2 * s + 2) (k + 1)
    -- Reinhard Zumkeller, Nov 16 2013
  • Magma
    &cat[ [2^k-2..2^k+k-3]: k in [1..11] ]; // Klaus Brockhaus, Mar 31 2007
    
  • Mathematica
    Table[ Range[2^k-2, 2^k+k-3], {k, 1, 11}] // Flatten (* Jean-François Alcover, Oct 07 2013, after Klaus Brockhaus *)
    Join[{0},Flatten[With[{nn=10},Range[#[[1]],Total[#]]&/@Thread[ {Accumulate[ 2^Range[nn]],Range[nn]}]]]] (* Harvey P. Dale, Nov 05 2017 *)
  • PARI
    {v=[]; s=0; for(k=1, 11, w=vector(k, j, j+s-1); s=2*s+2; v=concat(v, w)); for(n=1, #v, print1(v[n], ","))} \\ Klaus Brockhaus, Mar 31 2007
    

Extensions

Edited and extended by Klaus Brockhaus, Mar 31 2007
Keyword tabl added and offset changed by Reinhard Zumkeller, Nov 16 2013

A275970 a(n) = 3*2^n + n - 1.

Original entry on oeis.org

2, 6, 13, 26, 51, 100, 197, 390, 775, 1544, 3081, 6154, 12299, 24588, 49165, 98318, 196623, 393232, 786449, 1572882, 3145747, 6291476, 12582933, 25165846, 50331671, 100663320, 201326617, 402653210, 805306395, 1610612764, 3221225501, 6442450974, 12884901919, 25769803808, 51539607585, 103079215138, 206158430243, 412316860452, 824633720869
Offset: 0

Views

Author

Miquel Cerda, Aug 15 2016

Keywords

Programs

  • Mathematica
    LinearRecurrence[{4,-5,2},{2,6,13}, 25] (* or *) Table[3*2^n + n - 1, {n,0,25}] (* G. C. Greubel, Aug 18 2016 *)
  • PARI
    a(n)=3*2^n+n-1 \\ Charles R Greathouse IV, Aug 27 2016

Formula

a(n) = 2*a(n-1) - n + 2.
a(n+1) - a(n) = A181565(n)
a(n) = A007283(n) + n - 1
a(n) = A083706(n) + A000079(n)
a(n) = A145071(n+1) - A000079(n)
a(n) = A079583(n) + A005408(n)
a(n) = A068156(n+1) - A079583(n)
a(n) = (A068156(n+1) + A005408(n)) / 2
a(n) = A000225(n) + A000325(n+1) + A005408(n)
a(n) = A068156(n+1) - A000225(n) - A000325(n+1)
a(n) = A068156(n+1) - A007283(n) + n + 2.
a(n) = A000079(n) + A000225(n) + A000295(n) + A005408(n)
From G. C. Greubel, Aug 18 2016: (Start)
O.g.f.: (2 - 2*x - x^2)/( (1-2*x)*(1-x)^2 ).
E.g.f.: 3*exp(2*x) + (x-1)*exp(x).
a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-2). (End)

A283833 For t >= 0, if 2^t + t - 3 <= n <= 2^t + t - 1 then a(n) = 2^t - 1, while if 2^t + t - 1 < n < 2^(t+1) + t - 3 then a(n) = 2^(t+1) + t - 2 - n.

Original entry on oeis.org

1, 1, 1, 3, 3, 3, 2, 1, 7, 7, 7, 6, 5, 4, 3, 2, 1, 15, 15, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 31, 31, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 63, 63, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52
Offset: 0

Views

Author

N. J. A. Sloane, Mar 24 2017

Keywords

Examples

			1,1,1;
;
3,3,3;
2,1;
7,7,7;
6,5,4,3,2,1;
15,15,15;
14,13,12,11,10,9,8,7,6,5,4,3,2,1;
31,31,31;
30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,10,9,8,7,6,5,4,3,2,1;
63,63,63;
62,61,60,59,...
		

Crossrefs

Cf. A145071.

Programs

  • Maple
    A283833 := proc(n)
        local t;
        if n =0 then
            return 1;
        end if;
        for t from 0 do
            if 2^t+t-3 <= n and n<= 2^t+t-1 then
                return 2^t-1 ;
            elif 2^t+t-1 <= n and n<= 2^(t+1)+t-3 then
                return 2^(t+1)+t-2-n ;
            end if;
        end do:
    end proc: # R. J. Mathar, Mar 28 2017
  • Mathematica
    a[0] = 1; a[n_] := For[t = 0, True, t++, Which[2^t + t - 3 <= n && n <= 2^t + t - 1, Return[2^t - 1], 2^t + t - 1 <= n && n <= 2^(t + 1) + t - 3, Return[ 2^(t + 1) + t - 2 - n]]];
    Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Dec 09 2017, from Maple *)
  • PARI
    a(n) = {if (n==0, return (1)); for (t=0, oo, if (((2^t+t-3) <= n) && (n <= 2^t+t-1), return (2^t-1)); if (((2^t+t-1) <= n) && (n <= 2^(t+1)+t-3), return (2^(t+1)+t-2-n)););} \\ Michel Marcus, Aug 21 2017

A308737 Triangle of scaled 1-tiered binomial coefficients, T(n,k) = 2^(n+1)*(n-k,k)_1 (n >= 0, 0 <= k <= n), where (N,M)_1 is the 1-tiered binomial coefficient.

Original entry on oeis.org

1, 1, 3, 1, 8, 7, 1, 17, 31, 15, 1, 34, 96, 94, 31, 1, 67, 258, 382, 253, 63, 1, 132, 645, 1280, 1275, 636, 127, 1, 261, 1545, 3845, 5115, 3831, 1531, 255, 1, 518, 3598, 10766, 17920, 17906, 10738, 3578, 511, 1, 1031, 8212, 28700, 57358, 71666, 57316, 28652, 8185, 1023
Offset: 0

Views

Author

Michel Marcus, Jun 21 2019

Keywords

Examples

			From _Petros Hadjicostas_, Jul 07 2020: (Start)
Square array for (N,M)_1 of 1-tiered binomial coefficients (N, M >= 0):
  1/2,   3/4,    7/8,     15/16,   31/32,     63/64,   127/128, ...
  1/4,    1,    31/16,    47/16,  253/64,    159/32,  1531/256, ...
  1/8,  17/16,    3,     191/32, 1275/128,  3831/256,  5369/256, ...
  1/16, 17/16, 129/32,     10,   5115/256,  8953/256, 14329/256, ...
  1/32, 67/64, 645/128, 3845/256,   35,    35833/512, 129003/1024, ...
  ... (End)
Triangle (n-k,k)_1 of 1-tiered binomial coefficients (n >= 0 and k = 0..n):
  1/2,
  1/4,    3/4,
  1/8,     1,    7/8,
  1/16,  17/16, 31/16, 15/16,
  1/32,  17/16,   3,   47/16, 31/32,
  ...
Scaled triangle T(n,k) after multiplying each row by 2^(n+1):
  1,
  1,  3,
  1,  8,  7,
  1, 17, 31, 15,
  1, 34, 96, 94, 31,
  ...
		

Crossrefs

Cf. A007318 (Pascal triangle: 0-tiered binomial coefficient), A038208, A145071 (column k = 1).

Programs

  • Mathematica
    rows = 10;
    cc = CoefficientList[# + O[y]^rows, y]& /@ CoefficientList[(1-x)/((1-x-y)* (2-x-y)) + O[x]^rows, x];
    T[n_, m_, 1] := cc[[n-m+1, m+1]];
    Table[2^(n+1) Table[T[n, m, 1], {m, 0, n}], {n, 0, rows-1}] (* Jean-François Alcover, Jun 21 2019 *)
  • PARI
    T(n,m) = if ((n==0) && (m==0), 1/2, binomial(n+m-1, m-1) - (binomial(n+m,n)/2 - binomial(n+m-1,n-1))/2^(n+m));
    TT(n, k) = T(n-k, k);
    tabls(nn) = for (n=0, nn, for (k=0, n, print1(2^(n+1)*TT(n, k), ", ")));

Formula

Scaled coefficients satisfy T(n,0) = 1 for n >= 0 and T(n,k) = T(n-1,k) + T(n-1,k-1) + 2^n*C(n-1,k-1) for n >= k+1 >= 1. - Charlie Neder, Jun 21 2019 [Corrected by Petros Hadjicostas, Jul 06 2020]
From Petros Hadjicostas, Jul 07 2020: (Start)
(N,M)_1 + (M,N)_1 = (N,M)_0 = binomial(N+M, N) for N, M >= 0.
(n-k,k)_1 + (k, n-k)_1 = binomial(n,k) for n >= k >= 0.
T(n,k) + T(n,n-k) = 2^(n+1)*binomial(n,k) = 2*A038208(n,k) for n >= k >= 0.
T(n,k) = 2^(n + 1)*binomial(n-1, k-1) + 2*binomial(n-1,k) - binomial(n,k) for n >= k >= 0 and (n,k) <> (0,0) with T(0,0) = 1.
G.f. for T(n,k): (1 - 2*x)/((1 - 2*x*(1 + y))*(1 - x*(1 + y))). (End)

Extensions

Name edited by Petros Hadjicostas, Jul 07 2020

A227396 Triangle A074909(n) with the first column equal to 1 followed by -A000027(n) instead of A000012.

Original entry on oeis.org

1, -1, 2, -2, 3, 3, -3, 4, 6, 4, -4, 5, 10, 10, 5, -5, 6, 15, 20, 15, 6, -6, 7, 21, 35, 35, 21, 7, -7, 8, 28, 56, 70, 56, 28, 8, -8, 9, 36, 84, 126, 126, 84, 36, 9, -9, 10, 45, 120, 210, 252, 210, 120, 45, 10, -10
Offset: 0

Views

Author

Paul Curtz, Sep 20 2013

Keywords

Comments

Triangle leading to A164555(n)/A027642(n).
Starting from B(0)=1, the Bernoulli numbers B(n) with B(1)=1/2 are such that
1*B(0) = 1
-1*B(0) +2*B(1)= 0 --> B(1)=1/2
-2*B(0) +3*B(1) +3*B(2) = 0 --> B(2)=1/6
-3*B(0) +4*B(1) +6*B(2) +4*B(3) = 0 --> B(3)=0
-4*B(0) +5*B(1) +10*B(2) +10*B(3) +5*B(4) = 0 --> B(4)=-1/30 etc.
Row sum of A: A130103(n+1).
Row sum's absolute values of A: A145071(n).

Examples

			a(n) triangle is A:
1
-1 2
-2 3  3
-3 4  6  4
-4 5 10 10  5
-5 6 15 20 15  6
-6 7 21 35 35 21 7  etc.
		

Formula

T(n,k) = A074909(n,k) for n>0 and k>0, T(0,0)=1, T(n,0)=-n for n>0.
Showing 1-6 of 6 results.