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

A256251 First differences of A256250.

Original entry on oeis.org

1, 4, 4, 12, 4, 12, 20, 28, 4, 12, 20, 28, 36, 44, 52, 60, 4, 12, 20, 28, 36, 44, 52, 60, 68, 76, 84, 92, 100, 108, 116, 124, 4, 12, 20, 28, 36, 44, 52, 60, 68, 76, 84, 92, 100, 108, 116, 124, 132, 140, 148, 156, 164, 172, 180, 188, 196, 204, 212, 220, 228, 236, 244, 252, 4, 12, 20, 28, 36, 44, 52, 60, 68, 76, 84, 92, 100
Offset: 0

Views

Author

Omar E. Pol, Mar 20 2015

Keywords

Comments

Number of cells turned ON at n-th stage in the structure of A256250.
Apart from the initial 1, four times A006257 (Josephus problem).

Examples

			Written as an irregular triangle in which the row lengths are the terms of A011782, the sequence begins:
1;
4;
4,12;
4,12,20,28;
4,12,20,28,36,44,52,60;
4,12,20,28,36,44,52,60,68,76,84,92,100,108,116,124;
4,12,20,28,36,44,52,60,68,76,84,92,100,108,116,124,132,140,148,156,164,172,180,188,196,204,212,220,228,236,244,252;
...
Row sums give A000302.
Right border gives A173033.
		

Crossrefs

Programs

  • PARI
    a(n) = if(n, 8*(n - 2^logint(n,2)) + 4, 1)
  • Sage
    [1] + [8*(n - 2^floor(log(n,base=2))) + 4 for n in range(1,77)] # Danny Rorabaugh, Apr 20 2015
    

Formula

a(0) = 1. For n >= 1; a(n) = 4*A006257(n).
For n>0, a(n) = 8*(n - 2^floor(log_2(n))) + 4 (by the formula of Gregory Pat Scandalis in A006257). - Danny Rorabaugh, Apr 20 2015

A363674 T(n,k) is the decimal equivalent of the n-bit inverted Gray code for k; triangle T(n,k), n>=0, 0<=k<=2^n-1, read by rows.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, Jun 14 2023

Keywords

Comments

Row n is a permutation of {0, 1, ..., A000225(n)}.

Examples

			Triangle T(n,k) begins:
   0;
   1,  0;
   3,  2,  0,  1;
   7,  6,  4,  5, 1, 0,  2,  3;
  15, 14, 12, 13, 9, 8, 10, 11, 3, 2, 0, 1, 5, 4, 6, 7;
  ...
T(n,k) written in n-bit binary begins:
    ();
     1,    0;
    11,   10,   00,   01;
   111,  110,  100,  101,  001,  000,  010,  011;
  1111, 1110, 1100, 1101, 1001, 1000, 1010, 1011, 0011, 0010, 0000, ...;
  ...
		

Crossrefs

Columns k=0-2 give: A000225, A000918 (for n>=1), A028399 (for n>=2).
Row sums give A006516.

Programs

  • Maple
    T:= (n, k)-> Bits[Xor](2^n-1-k, iquo(k, 2)):
    seq(seq(T(n, k), k=0..2^n-1), n=0..6);

Formula

T(n,k) = 2^n - 1 - A003188(k) = A000225(n) - A003188(k).
Sum_{k=0..2^n-1} (-1)^k * T(n,k) = A063524(n).
T(n,0) = T(n+1,2^(n+1)-1) = A000225(n).
T(n,A000975(n)) = 0.
T(n,A097072(n)) = 1 for n >= 1.
T(n,k) = T(n-1,k) + 2^(n-1) for n >= 1 and 0 <= k < 2^(n-1).
T(n,k) = T(n-1,2^n-1-k) for n >= 1 and 2^(n-1) <= k < 2^n.
A000120(T(n,n)) = A236840(n).

A060157 Number of permutations of [n] with 3 sequences.

Original entry on oeis.org

0, 10, 58, 236, 836, 2766, 8814, 27472, 84472, 257522, 780770, 2358708, 7108908, 21392278, 64307926, 193185944, 580082144, 1741295034, 5225982282, 15682141180, 47054812180, 141181213790, 423577195838, 1270798696416, 3812530307016, 11437859356546, 34314114940594
Offset: 3

Views

Author

Barbara Haas Margolius (margolius(AT)math.csuohio.edu), Mar 12 2001

Keywords

Examples

			a(4)=10 because each of the 5 (=A000111(4)) up-down permutations and 5 down-up permutations has 3 sequences. For example, the 3 sequences of 2413 are 24, 41, and 13. - _Emeric Deutsch_, Jul 11 2009
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 261.

Crossrefs

Cf. A000111. - Emeric Deutsch, Jul 11 2009

Programs

  • Maple
    n3 := n->11/2-n-2^(n+1)+1/2*3^n; seq(n3(i),i=3..30);
  • Mathematica
    Table[11/2-n-2^(n+1)+3^n/2,{n,3,30}]
  • PARI
    a(n) = { (3^n + 11)/2 - 2^(n + 1) - n } \\ Harry J. Smith, Jul 02 2009

Formula

a(n) = 11/2 - n - 2^(n+1) + (1/2)*3^n.
G.f.: 2*x^4*(5-6*x)/((1-x)^2*(1-2*x)*(1-3*x)). - Colin Barker, Feb 17 2012

A160588 Interleaving of A053645 and A000027.

Original entry on oeis.org

0, 1, 0, 2, 1, 3, 0, 4, 1, 5, 2, 6, 3, 7, 0, 8, 1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23, 8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31, 0, 32, 1, 33, 2, 34, 3, 35, 4, 36, 5, 37, 6, 38, 7, 39, 8, 40, 9, 41, 10, 42, 11
Offset: 0

Views

Author

Reinhard Zumkeller, May 20 2009

Keywords

Comments

a(2*n) = A053645(n+1); a(2*n+1) = A001477(n) = n;
for n>1: a(A028399(n)) = A000225(n-2), a(A000918(n)) = 0.

Programs

  • Haskell
    import Data.List (transpose)
    a160588 n = a160588_list !! n
    a160588_list = concat $ transpose [a053645_list, a000027_list]
    -- Reinhard Zumkeller, Dec 12 2012

Formula

a(n)=f(n,2) with f(n,m) = if n

Extensions

Definition corrected by Reinhard Zumkeller, Dec 12 2012

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

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)

A120672 a(n) = 2 * A285917(n) for n >=2, a(0) = a(1) = 0.

Original entry on oeis.org

0, 0, 2, 12, 22, 60, 104, 252, 438, 1020, 1792, 4092, 7264, 16380, 29332, 65532, 118198, 262140, 475664, 1048572, 1912392, 4194300, 7683172, 16777212, 30850272, 67108860, 123817124, 268435452, 496754308, 1073741820, 1992366124, 4294967292, 7988854198
Offset: 0

Author

Thomas Wieder, Jun 24 2006

Keywords

Comments

Previous name was: Consider a set A containing at least n-1 elements of sort "a" and a set B containing at least n-1 elements of sort "b". From set A we take i elements, from set B we take (n-i) elements such that i + (n-i) = n. Then we distribute these n elements in two urns L (left) and R (right). The order of selection among the two sorts counts. Equivalently we can say: Then we form two sequences L and R from these n elements. The position of the sort of the elements within the sequences counts. Furthermore, the occupations of the urns are permuted. In other words, the order of the sequences L and R is swapped from L|R to R|L.
A028399(n) = 2*2^n - 4 with n=1,2,3,... is an upper limit for a(n) because Sum_{i=1..n-1} 2*n!/(i!*(n-i)!) = 2*2^n - 4. a(n) follows from all distinct ordered 2-tuples of positive integers whose elements sum to n. See the first Maple program below.

Examples

			For n=3 we have a(n=3)=12 configurations [L|R] and [R|L]: [aaa|b], [b|aaa], [baa|a], [a|baa], [aba|a], [a|aba], [aab|a], [a|aab] and [bbb|a], [a|bbb], [abb|b], [b|abb], [bab|b], [b|bab], [bba|b], [b|bba].
		

Crossrefs

Programs

  • Maple
    A120672 := proc(n::integer) local i,k, cmpstnlst,cmpstn,NumberOfParts,liste, NumberOfDifferentParts,Result; k:=2; Result := 0; cmpstnlst := composition(n,k); NumberOfParts := 0; NumberOfDifferentParts := 0; for i from 1 to nops(cmpstnlst) do cmpstn := cmpstnlst[i]; NumberOfParts := nops(cmpstn); if NumberOfParts > 0 then liste := convert(cmpstn,multiset); else liste := NULL; fi; if liste <> NULL then NumberOfDifferentParts := nops(liste); else NumberOfDifferentParts := 0; fi; Result := Result + n!/mul(op(j,cmpstn)!, j=1..NumberOfParts)*(NumberOfParts!/ mul(op(2,op(j,liste))!, j=1..NumberOfDifferentParts)); od; print(Result); end proc;
    A120672 := proc(n) local i,Term,Result; Result:=0; for i from 1 to n-1 do Term:=n!/(i!*(n-i)!); if i <> n-i then Term:=2*Term; fi; Result:=Result+Term; end do; print(Result); end proc;
  • Mathematica
    a[n_] := If[n == 0, 0, 2^(n+1) - 4 - Sum[Binomial[n, Quotient[k, 2]]* (-1)^(n-k), {k, 0, n}]];
    Table[a[n], {n, 0, 32}] (* Jean-François Alcover, Apr 02 2024, after R. J. Mathar's formula *)

Formula

For the number a(n) of such [L|R] configurations we have a(n) = n!*Sum_{i=1..n-1} delta2(i,n-i)/(i!*(n-i)!) where delta2(n,n-i) = 2 if i <> (n-i) and 1 if i = (n-i).
a(n) = A028399(n) - A126869(n), n > 0. - R. J. Mathar, Aug 07 2008

Extensions

Simpler name referring to A285917 from Joerg Arndt, Jun 25 2019

A120928 Number of "ups" and "downs" in the permutations of [n] if either a previous counted "up" ("down") or a "void" precedes an "up" ("down") which then will be counted also.

Original entry on oeis.org

2, 8, 44, 280, 2040, 16800, 154560, 1572480, 17539200, 212889600, 2794176000, 39437798400, 595718323200, 9589612032000, 163895187456000, 2964061900800000, 56554301067264000, 1135354270482432000, 23923536413736960000, 527939735774330880000
Offset: 2

Author

Thomas Wieder, Jul 16 2006

Keywords

Comments

An "up" ("down") is a neighboring pair of elements e_i, e_j of [n] with e_i < e_j (e_i > e_j). A "void" is a missing preceding pair, i.e., the start of [n]. We discuss two examples for [n=4]. In the permutation [3, 1, 2, 4] "void" precedes the pair 3,1 and consequently a "down" is counted. No "up" which has been counted precedes the "ups" 1,2 and 2,4 so they are not counted. In [3, 4, 1, 2] the "up" 3,4 is counted and so is the next "up" 1,2 but the down 4,1 has no preceding "down" registered and is therefore not counted.

Examples

			[1, 2, 3, 4], "ups"=3, "downs"=0;
[1, 2, 4, 3], "ups"=2, "downs"=0;
[1, 3, 2, 4], "ups"=2, "downs"=0;
[1, 3, 4, 2], "ups"=2, "downs"=0;
[1, 4, 2, 3], "ups"=2, "downs"=0;
[1, 4, 3, 2], "ups"=1, "downs"=0;
[2, 1, 3, 4], "ups"=0, "downs"=1;
[2, 1, 4, 3], "ups"=0, "downs"=2;
[2, 3, 1, 4], "ups"=2, "downs"=0;
[2, 3, 4, 1], "ups"=2, "downs"=0;
[2, 4, 1, 3], "ups"=2, "downs"=0;
[2, 4, 3, 1], "ups"=1, "downs"=0;
[3, 1, 2, 4], "ups"=0, "downs"=1;
[3, 1, 4, 2], "ups"=0, "downs"=2;
[3, 2, 1, 4], "ups"=0, "downs"=2;
[3, 2, 4, 1], "ups"=0, "downs"=2;
[3, 4, 1, 2], "ups"=2, "downs"=0;
[3, 4, 2, 1], "ups"=1, "downs"=0;
[4, 1, 2, 3], "ups"=0, "downs"=1;
[4, 1, 3, 2], "ups"=0, "downs"=2;
[4, 2, 1, 3], "ups"=0, "downs"=2;
[4, 2, 3, 1], "ups"=0, "downs"=2;
[4, 3, 1, 2], "ups"=0, "downs"=2;
[4, 3, 2, 1], "ups"=0, "downs"=3.
		

Crossrefs

Programs

  • Maple
    a:= n-> ceil(n!*(3*n-1)/6):
    seq(a(n), n=2..30); # Alois P. Heinz, Apr 21 2012

Formula

E.g.f.: -(6+6*x^2-4*x^3+x^4)/(-3+12*x-18*x^2+12*x^3-3*x^4). - Thomas Wieder, May 02 2009
a(2) = 2, a(n) = n! * (3*n - 1) / 6 for n > 2. - Jon E. Schoenfield, Apr 18 2010

Extensions

4 more terms from R. J. Mathar, Aug 25 2008
More terms from Alois P. Heinz, Apr 21 2012

A256139 First differences of A256138.

Original entry on oeis.org

1, 4, 4, 12, 4, 12, 20, 28, 4, 12, 20, 36, 36, 28, 52, 60, 4, 12, 20, 36, 36, 36, 68, 100, 68, 28, 52, 92, 108, 76, 124, 124, 4, 12, 20, 36, 36, 36, 68, 100, 68, 36, 68, 116, 148, 132, 164, 228, 132, 28, 52, 92, 108, 108, 172, 268, 236, 108, 124, 220, 276, 196, 276, 252
Offset: 0

Author

Omar E. Pol, Mar 20 2015

Keywords

Comments

Number of cells turned ON at n-th stage in the structure of A256138.
First differs from A169708 at a(11).

Examples

			Written as an irregular triangle in which the row lengths are the terms of A011782 the sequence begins:
1;
4;
4,12;
4,12,20,28;
4,12,20,36,36,28,52,60;
4,12,20,36,36,36,68,100,68,28,52,92,108,76,124,124;
4,12,20,36,36,36,68,100,68,36,68,116,148,132,164,228,132,28,52,92,108,108,172,268,236,108,124,220,276,196,276,252;
...
It appears that the right border gives A173033.
		

Formula

a(n) = 2*A151724(n+1)/3, n >= 1.

A306352 a(n) is the least k >= 0 such that all the positive divisors of n have a distinct value under the mapping d -> d AND k (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 2, 7, 10, 13, 2, 15, 4, 5, 6, 15, 16, 31, 2, 29, 6, 7, 2, 31, 12, 9, 10, 11, 4, 15, 2, 31, 42, 49, 6, 63, 4, 7, 6, 63, 8, 15, 2, 14, 14, 5, 2, 63, 18, 29, 18, 21, 4, 31, 6, 23, 18, 9, 2, 31, 4, 5, 14, 63, 76, 127, 2, 115, 6, 15, 2, 127, 8, 13
Offset: 1

Author

Rémy Sigrist, Feb 09 2019

Keywords

Comments

This sequence has similarities with A167234.
Will every nonnegative integer appear in the sequence?

Examples

			For n = 15:
- the divisors of 15 are: 1, 3, 5 and 15,
- their values under the mapping d -> d AND k for k = 0..6 are:
  k\d|  1  3  5  15
  ---+-------------
    0|  0  0  0  0
    1|  1  1  1  1
    2|  0  2  0  2
    3|  1  3  1  3
    4|  0  0  4  4
    5|  1  1  5  5
    6|  0  2  4  6
- the first row with 4 distinct values corresponds to k = 6,
- hence a(15) = 6.
		

Programs

  • PARI
    a(n) = my (d=divisors(n)); for (m=0, oo, if (#Set(apply(v -> bitand(v, m), d))==#d, return (m)))

Formula

a(2^k) = 2^k - 1 for any k >= 0.
a(n) = 2 iff n belongs to A002145.
a(n) <= A218388(n).
a(n) AND A218388(n) = a(n).
A000120(a(n)) = 1 iff n is a prime number.
Apparently:
- a(3^k) belongs to A131130 for any k > 0,
- a(5^k) belongs to A028399 for any k >= 0.

A267615 a(n) = 2^n + 11.

Original entry on oeis.org

12, 13, 15, 19, 27, 43, 75, 139, 267, 523, 1035, 2059, 4107, 8203, 16395, 32779, 65547, 131083, 262155, 524299, 1048587, 2097163, 4194315, 8388619, 16777227, 33554443, 67108875, 134217739, 268435467, 536870923, 1073741835, 2147483659, 4294967307, 8589934603, 17179869195, 34359738379
Offset: 0

Author

Ilya Gutkovskiy, Jan 18 2016

Keywords

Comments

Recurrence relation b(n) = 3*b(n - 1) - 2*b(n - 2) for n>1, b(0) = k, b(1) = k + 1, gives the closed form b(n) = 2^n + k - 1.

Crossrefs

Cf. sequences with closed form 2^n + k - 1: A168616 (k=-4), A028399 (k=-3), A036563 (k=-2), A000918 (k=-1), A000225 (k=0), A000079 (k=1), A000051 (k=2), A052548 (k=3), A062709 (k=4), A140504 (k=5), A168614 (k=6), A153972 (k=7), A168415 (k=8), A242475 (k=9), A188165 (k=10), A246139 (k=11), this sequence (k=12).
Cf. A156940.

Programs

  • Magma
    [2^n+11: n in [0..30]]; // Vincenzo Librandi, Jan 19 2016
  • Mathematica
    Table[2^n + 11, {n, 0, 35}]
    LinearRecurrence[{3, -2}, {12, 13}, 40] (* Vincenzo Librandi, Jan 19 2016 *)
  • PARI
    a(n) = 2^n + 11; \\ Altug Alkan, Jan 18 2016
    

Formula

G.f.: (12 - 23*x)/(1 - 3*x + 2*x^2).
a(n) = 3*a(n - 1) - 2*a(n - 2) for n>1, a(0)=12, a(1)=13.
a(n) = A000079(n) + A010850(n).
Sum_{n>=0} 1/a(n) = 0.367971714327125...
Lim_{n->oo} a(n + 1)/a(n) = 2.
E.g.f.: exp(2*x) + 11*exp(x). - Elmo R. Oliveira, Nov 08 2023
Previous Showing 21-30 of 31 results. Next