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

A121173 Sequence S with property that for n in S, a(n) = a(1) + a(2) +...+ a(n-1) and for n not in S, a(n) = n+1.

Original entry on oeis.org

2, 2, 4, 8, 6, 22, 8, 52, 10, 114, 12, 240, 14, 494, 16, 1004, 18, 2026, 20, 4072, 22, 8166, 24, 16356, 26, 32738, 28, 65504, 30, 131038, 32, 262108, 34, 524250, 36, 1048536, 38, 2097110, 40, 4194260, 42, 8388562, 44, 16777168, 46, 33554382
Offset: 1

Views

Author

Max Alekseyev, Aug 15 2006

Keywords

Comments

a(1)=1 cannot happen, so the sequence S starts with a(1)=2.
Note that a(n)=a(1)+a(2)+...+a(n-1) can hold even if n is not in S. The smallest example is n=3.
All terms are even. - Reinhard Zumkeller, Nov 06 2013

Crossrefs

Programs

  • Haskell
    a121173 n = a121173_list !! (n-1)
    a121173_list = f 1 [] where
       f x ys = y : f (x + 1) (y : ys) where
         y = if x `elem` ys then sum ys else x + 1
    -- Reinhard Zumkeller, Nov 06 2013
    
  • Mathematica
    s={2};Do[If[MemberQ[s,n],m=Total[s],m=n+1];AppendTo[s,m],{n,2,46}];s (* James C. McMahon, Oct 13 2024 *)
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        S, s, an = {2}, 2, 2
        for n in count(2):
            yield an
            an = s if n in S else n+1
            s += an
            S.add(an)
    print(list(islice(agen(), 50))) # Michael S. Branicky, Oct 13 2024

Formula

a(2*n) = A145654(n+1). - Reinhard Zumkeller, Nov 06 2013
a(2*n+1) = 2*n+2.
From Colin Barker, Jan 30 2016: (Start)
a(n) = 2*(2^(n/2+1)-2)-n for n even.
a(n) = n+1 for n odd.
a(n) = -a(n-1)+3*a(n-2)+3*a(n-3)-2*a(n-4)-2*a(n-5) for n>5.
G.f.: 2*x*(1+2*x) / ((1-x)*(1+x)^2*(1-2*x^2)). (End)
E.g.f.: (x - 4)*cosh(x) + 4*cosh(sqrt(2)*x) + (1 - x)*sinh(x). - Stefano Spezia, Oct 14 2024

A350770 Triangle read by rows: T(n, k) = 2^(n-k-1) + 2^k - 2, 0 <= k <= n-1.

Original entry on oeis.org

0, 1, 1, 3, 2, 3, 7, 4, 4, 7, 15, 8, 6, 8, 15, 31, 16, 10, 10, 16, 31, 63, 32, 18, 14, 18, 32, 63, 127, 64, 34, 22, 22, 34, 64, 127, 255, 128, 66, 38, 30, 38, 66, 128, 255, 511, 256, 130, 70, 46, 46, 70, 130, 256, 511, 1023, 512, 258, 134, 78, 62, 78, 134, 258, 512, 1023, 2047, 1024, 514, 262, 142, 94, 94, 142, 262, 514, 1024, 2047
Offset: 1

Views

Author

Keywords

Comments

T(n, k) is the number of player-reduced static games within an n-player two-strategy game scenario in which one player (the "standpoint") faces a specific combination of other players' individual strategies without the possibility of anti-coordination between them -- the total number of such combinations is 2^(n-1). The value of k represents the number of other players who (are expected to) agree on one of the two strategies in S, while the other n-k-1 choose the other strategy; the standpoint player is not included.
The sum of the products of T(n, k) and binomial(n-1,k) for 0 <= k <= n-1 equals 2*A001047(n-1). For instance, for n = 3, T(3, k) returns 3, 2, and 3 and binomial(3-1,k) returns 1, 2, and 1 for k = 0, 1, and 2, respectively. Then 3*1 + 2*2 + 3*1 = 2*A001047(3-1) = 2*5 = 10. Similarly, for n = 4, the result yields 7*1 + 4*3 + 4*3 + 7*1 = 2*A001047(4-1) = 2*19 = 38.

Examples

			Triangle begins:
     0;
     1,    1;
     3,    2,   3;
     7,    4,   4,   7;
    15,    8,   6,   8,  15;
    31,   16,  10,  10,  16, 31;
    63,   32,  18,  14,  18, 32, 63;
   127,   64,  34,  22,  22, 34, 64, 127;
   255,  128,  66,  38,  30, 38, 66, 128, 255;
   511,  256, 130,  70,  46, 46, 70, 130, 256, 511;
  1023,  512, 258, 134,  78, 62, 78, 134, 258, 512, 1023;
  2047, 1024, 514, 262, 142, 94, 94, 142, 262, 514, 1024, 2047;
  ...
		

Crossrefs

Column k=0 gives A000225(n-1).
Row sums give A145654.
Cf. A001047.

Programs

  • Maple
    T := n -> seq(2^(n - k - 1) + 2^k - 2, k = 0 .. n - 1);
    seq(T(n), n=1..12);
  • PARI
    T(n, k) = 2^(n-k-1) + 2^k - 2 \\ Andrew Howroyd, May 06 2023

Formula

T(n, k) = 2^(n-k-1) + 2^k - 2.

A271698 Triangle read by rows, T(n,k) = Sum_{j=0..n} C(-j,-n)*E1(j,k), E1 the Eulerian numbers A173018, for n>=0 and 0<=k<=n.

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 0, 2, 1, 0, 0, 2, 8, 1, 0, 0, 2, 28, 22, 1, 0, 0, 2, 72, 182, 52, 1, 0, 0, 2, 164, 974, 864, 114, 1, 0, 0, 2, 352, 4174, 8444, 3474, 240, 1, 0, 0, 2, 732, 15782, 61464, 57194, 12660, 494, 1, 0, 0, 2, 1496, 55286, 373940, 660842, 332528, 43358, 1004, 1, 0
Offset: 0

Views

Author

Peter Luschny, Apr 12 2016

Keywords

Examples

			Triangle starts:
1,
1, 0,
0, 1, 0,
0, 2, 1, 0,
0, 2, 8, 1, 0,
0, 2, 28, 22, 1, 0,
0, 2, 72, 182, 52, 1, 0,
0, 2, 164, 974, 864, 114, 1, 0
		

Crossrefs

A000255 (row sums), compare A028296 for alternating rows sums, A145654 and A005803 (diag. n,n-2).
Cf. A173018.

Programs

  • Maple
    A271698 := (n,k) -> add(binomial(-j,-n)*combinat:-eulerian1(j,k), j=0..n):
    seq(seq(A271698(n, k), k=0..n), n=0..10);
  • Mathematica
    <
    				
Showing 1-3 of 3 results.