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

A089591 "Lazy binary" representation of n. Also called redundant binary representation of n.

Original entry on oeis.org

0, 1, 10, 11, 20, 101, 110, 111, 120, 201, 210, 1011, 1020, 1101, 1110, 1111, 1120, 1201, 1210, 2011, 2020, 2101, 2110, 10111, 10120, 10201, 10210, 11011, 11020, 11101, 11110, 11111, 11120, 11201, 11210, 12011, 12020, 12101, 12110, 20111
Offset: 0

Views

Author

Jeff Erickson, Dec 29 2003

Keywords

Comments

Let a(0) = 0 and construct a(n) from a(n-1) by (i) incrementing the rightmost digit and (ii) if any digit is 2, replace the rightmost 2 with a 0 and increment the digit immediately to its left. (Note that changing "if" to "while" in this recipe gives the standard binary representation of n, A007088(n)).
Equivalently, a(2n+1) = a(n):1 and a(2n+2) = b(n):0, where b(n) is obtained from a(n) by incrementing the least significant digit and : denotes string concatenation.
If the digits of a(n) are d_k, d_{k-1}, ..., d_2, d_1, d_0, then n = Sum_{i=0..k} d_i*2^i, just as in standard binary notation. The difference is that here we are a bit lazy, and allow a few digits to be 2's. The number of 2's in a(n) appears to be A037800(n+1). - N. J. A. Sloane, Jun 03 2023
Every pair of 2's is separated by a 0 and every pair of significant 0's is separated by a 2.
a(n) has exactly floor(log_2((n+2)/3))+1 digits [cf. A033484] and their sum is exactly floor(log_2(n+1)) [A000523].
The i-th digit of a(n) is ceiling( floor( ((n+1-2^i) mod 2^(i+1))/2^(i-1) ) / 2).
A137951 gives values of terms interpreted as ternary numbers, a(n)=A007089(A137951(n)). - Reinhard Zumkeller, Feb 25 2008

Examples

			a(8) = 120 -> 121 -> 201 = a(9); a(9) = 201 -> 202 -> 210 = a(10).
		

References

  • Gerth S. Brodal, Worst-case efficient priority queues, SODA 1996.
  • Michael J. Clancy and D. E. Knuth, A programming and problem-solving seminar, Technical Report STAN-CS-77-606, Department of Computer Science, Stanford University, Palo Alto, 1977.
  • Haim Kaplan and Robert E. Tarjan, Purely functional representations of catenable sorted lists, STOC 1996.
  • Chris Okasaki, Purely Functional Data Structures, Cambridge, 1998.

Crossrefs

A158582: lazy binary different from regular binary, A089633: lazy binary and regular binary agree.

Programs

  • Maple
    A089591 := proc(n) option remember ; local nhalf ; if n <= 1 then RETURN(n) ; else nhalf := floor(n/2) ; if n mod 2 = 1 then RETURN(10*A089591(nhalf) +1) ; else RETURN(10*(A089591(nhalf-1)+1)) ; fi ; fi ; end: for n from 0 to 200 do printf("%d, ",A089591(n)) ; od ; # R. J. Mathar, Mar 11 2007
  • Mathematica
    a[n_] := a[n] = Module[{nhalf}, If[n <= 1, Return[n], nhalf = Floor[n/2]; If[Mod[n, 2]==1, Return[10*a[nhalf]+1], Return[10*(a[nhalf-1]+1)]]]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jan 19 2016, after R. J. Mathar *)

Extensions

More terms from R. J. Mathar, Mar 11 2007
Edited by Charles R Greathouse IV, Apr 30 2010
Edited by N. J. A. Sloane, Jun 03 2023

A123620 Expansion of (1 + x + x^2) / (1 - 3*x - 3*x^2).

Original entry on oeis.org

1, 4, 16, 60, 228, 864, 3276, 12420, 47088, 178524, 676836, 2566080, 9728748, 36884484, 139839696, 530172540, 2010036708, 7620627744, 28891993356, 109537863300, 415289569968, 1574482299804, 5969315609316, 22631393727360, 85802128010028, 325300565212164
Offset: 0

Views

Author

N. J. A. Sloane, Nov 20 2006

Keywords

Comments

From Johannes W. Meijer, Aug 14 2010: (Start)
A berserker sequence, see A180141. For the corner squares 16 A[5] vectors with decimal values between 3 and 384 lead to this sequence. These vectors lead for the side squares to A180142 and for the central square to A155116.
This sequence belongs to a family of sequences with GF(x) = (1+x+k*x^2)/(1-3*x+(k-4)*x^2). Berserker sequences that are members of this family are 4*A055099(n) (k=2; with leading 1 added), A123620 (k=1; this sequence), A000302 (k=0), 4*A179606 (k=-1; with leading 1 added) and A180141 (k=-2). Some other members of this family are 4*A003688 (k=3; with leading 1 added), 4*A003946 (k=4; with leading 1 added), 4*A002878 (k=5; with leading 1 added) and 4*A033484 (k=6; with leading 1 added).
(End)
a(n) is the number of length n sequences on an alphabet of 4 letters that do not contain more than 2 consecutive equal letters. For example, a(3)=60 because we count all 4^3=64 words except: aaa, bbb, ccc, ddd. - Geoffrey Critzer, Mar 12 2014

Crossrefs

Column 4 in A265584.

Programs

  • Magma
    [1] cat [Round(((2^(1-n)*(-(3-Sqrt(21))^(1+n) + (3+Sqrt(21))^(1+n))))/(3*Sqrt(21))): n in [1..50]]; // G. C. Greubel, Oct 26 2017
  • Mathematica
    nn=25;CoefficientList[Series[(1-z^(m+1))/(1-r z +(r-1)z^(m+1))/.{r->4,m->2},{z,0,nn}],z] (* Geoffrey Critzer, Mar 12 2014 *)
    CoefficientList[Series[(1 + x + x^2)/(1 - 3 x - 3 x^2), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 14 2014 *)
    LinearRecurrence[{3,3},{1,4,16},30] (* Harvey P. Dale, Jul 14 2023 *)
  • PARI
    my(x='x+O('x^50)); Vec((1+x+x^2)/(1-3*x-3*x^2)) \\ G. C. Greubel, Oct 16 2017
    

Formula

a(0)=1, a(1)=4, a(2)=16, a(n)=3*a(n-1)+3*a(n-2) for n>2. - Philippe Deléham, Sep 18 2009
a(n) = ((2^(1-n)*(-(3-sqrt(21))^(1+n) + (3+sqrt(21))^(1+n)))) / (3*sqrt(21)) for n>0. - Colin Barker, Oct 17 2017

A176449 a(n) = 9*2^n - 2.

Original entry on oeis.org

7, 16, 34, 70, 142, 286, 574, 1150, 2302, 4606, 9214, 18430, 36862, 73726, 147454, 294910, 589822, 1179646, 2359294, 4718590, 9437182, 18874366, 37748734, 75497470, 150994942, 301989886, 603979774, 1207959550, 2415919102
Offset: 0

Views

Author

Vincenzo Librandi, Apr 18 2010

Keywords

Examples

			For n = 1, a(1) = 2*(7+1) = 16;
for n = 2, a(2) = 2*(16+1) = 34;
for n = 3, a(3) = 2*(34+1) = 70.
		

Programs

Formula

a(n) = 2*(a(n-1)+1) with a(0) = 7.
a(n) = 3*a(n-1) -2*a(n-2). G.f.: (7-5*x) / ((2*x-1)*(x-1)). - R. J. Mathar, May 02 2010
a(n) = 2*A052996(n+1) for n > 0. - Bruno Berselli and Vincenzo Librandi, Aug 27 2010
a(n) = A033484(n+2) - A007283(n). - M. F. Hasler, Dec 11 2018

Extensions

Edited by M. F. Hasler, Dec 11 2018

A196305 a(n) = 15*2^n - 1.

Original entry on oeis.org

14, 29, 59, 119, 239, 479, 959, 1919, 3839, 7679, 15359, 30719, 61439, 122879, 245759, 491519, 983039, 1966079, 3932159, 7864319, 15728639, 31457279, 62914559, 125829119, 251658239, 503316479, 1006632959, 2013265919, 4026531839, 8053063679, 16106127359, 32212254719, 64424509439
Offset: 0

Views

Author

Brad Clardy, Oct 07 2011

Keywords

Comments

Primes of this sequence are in A196940.

Crossrefs

Cf. A033484, A083705, A110286 (first differences), A196940.

Programs

  • Magma
    [15*2^n -1 : n in [0..50]];
    
  • PARI
    a(n)=15<Charles R Greathouse IV, Oct 08 2011

Formula

a(n) = 15*2^n - 1.
a(n) = A033484(n+1) + A083705(n).
From Philippe Deléham, Feb 17 2014: (Start)
a(n) = 2*a(n-1) + 1.
a(n) = 3*a(n-2) - 2*a(n-2).
a(n) = A110286(n) - 1. (End)
From Elmo R. Oliveira, Sep 14 2024: (Start)
G.f.: (14 - 13*x)/((1 - x)*(1 - 2*x)).
E.g.f.: exp(x)*(15*exp(x) - 1). (End)

A238275 a(n) = (4*7^n - 1)/3.

Original entry on oeis.org

1, 9, 65, 457, 3201, 22409, 156865, 1098057, 7686401, 53804809, 376633665, 2636435657, 18455049601, 129185347209, 904297430465, 6330082013257, 44310574092801, 310174018649609, 2171218130547265, 15198526913830857, 106389688396816001, 744727818777712009
Offset: 0

Views

Author

Philippe Deléham, Feb 21 2014

Keywords

Comments

Sum of n-th row of triangle of powers of 7: 1; 1 7 1; 1 7 49 7 1; 1 7 49 343 49 7 1; ...
Number of cubes in the crystal structure cubic carbon CCC(n+1), defined in the Baig et al. and in the Gao et al. references. - Emeric Deutsch, May 28 2018

Examples

			a(0) = 1;
a(1) = 1 + 7 + 1 = 9;
a(2) = 1 + 7 + 49 + 7 + 1 = 65;
a(3) = 1 + 7 + 49 + 343 + 49 + 7 + 1 = 457; etc.
		

Crossrefs

Cf. Similar sequences: A151575, A000012, A040000, A005408, A033484, A048473, A020989, A057651, A061801, this sequence, A238276, A138894, A090843, A199023.

Programs

Formula

G.f.: (1+x)/((1-x)*(1-7*x)).
a(n) = 7*a(n-1) + 2, a(0) = 1.
a(n) = 8*a(n-1) - 7*a(n-2), a(0) = 1, a(1) = 9.
a(n) = Sum_{k=0..n} A112468(n,k)*8^k.
E.g.f.: exp(x)*(4*exp(6*x) - 1)/3. - Stefano Spezia, Feb 12 2025

A238276 a(n) = (9*8^n - 2)/7.

Original entry on oeis.org

1, 10, 82, 658, 5266, 42130, 337042, 2696338, 21570706, 172565650, 1380525202, 11044201618, 88353612946, 706828903570, 5654631228562, 45237049828498, 361896398627986, 2895171189023890, 23161369512191122, 185290956097528978, 1482327648780231826
Offset: 0

Views

Author

Philippe Deléham, Feb 21 2014

Keywords

Comments

Sum of n-th row of triangle of powers of 8: 1; 1 8 1; 1 8 64 8 1; 1 8 64 512 64 8 1; ...

Examples

			a(0) = 1;
a(1) = 1 + 8 + 1 = 10;
a(2) = 1 + 8 + 64 + 8 + 1 = 82;
a(3) = 1 + 8 + 64 + 512 + 64 + 8 + 1 = 658; etc.
		

Crossrefs

Cf. Similar sequences: A151575, A000012, A040000, A005408, A033484, A048473, A020989, A057651, A061801, A238275, this sequence, A138894, A090843, A199023.

Programs

Formula

G.f.: (1+x)/((1-x)*(1-8*x)).
a(n) = 8*a(n-1) + 2, a(0) = 1.
a(n) = 9*a(n-1) - 8*a(n-2), a(0) = 1, a(1) = 10.
a(n) = Sum_{k=0..n} A112468(n,k)*9^k.

Extensions

Corrected by Vincenzo Librandi, Feb 23 2014

A382673 Square array A(n,k), n >= 0, k >= 0, read by antidiagonals downwards, where A(n,k) = n! * k! * [x^n * y^k] exp(x+y) / (exp(x) + exp(y) - exp(x+y))^3.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 10, 10, 1, 1, 22, 52, 22, 1, 1, 46, 208, 208, 46, 1, 1, 94, 736, 1372, 736, 94, 1, 1, 190, 2440, 7516, 7516, 2440, 190, 1, 1, 382, 7792, 37012, 60316, 37012, 7792, 382, 1, 1, 766, 24328, 170668, 418996, 418996, 170668, 24328, 766, 1, 1, 1534, 74896, 754132, 2653036, 3964684, 2653036, 754132, 74896, 1534, 1
Offset: 0

Views

Author

Seiichi Manyama, Apr 03 2025

Keywords

Examples

			Square array begins:
  1,  1,    1,     1,      1,       1, ...
  1,  4,   10,    22,     46,      94, ...
  1, 10,   52,   208,    736,    2440, ...
  1, 22,  208,  1372,   7516,   37012, ...
  1, 46,  736,  7516,  60316,  418996, ...
  1, 94, 2440, 37012, 418996, 3964684, ...
  ...
		

Crossrefs

Columns k=0..2 give A000012, A033484, A382675.
Main diagonal gives A382676.
Cf. A382735.

Programs

  • PARI
    a(n, k) = sum(j=0, min(n, k), j!^2*binomial(j+2, 2)*stirling(n+1, j+1, 2)*stirling(k+1, j+1, 2));

Formula

E.g.f.: exp(x+y) / (exp(x) + exp(y) - exp(x+y))^3.
A(n,k) = A(k,n).
A(n,k) = Sum_{j=0..min(n,k)} (j!)^2 * binomial(j+2,2) * Stirling2(n+1,j+1) * Stirling2(k+1,j+1).

A075779 Triangle T(n,k) = f(n,k,n-1), n >= 2, 1 <= k <= n-1, where f is given below.

Original entry on oeis.org

2, 6, 6, 12, 16, 12, 20, 35, 35, 20, 30, 66, 84, 66, 30, 42, 112, 175, 175, 112, 42, 56, 176, 328, 400, 328, 176, 56, 72, 261, 567, 819, 819, 567, 261, 72, 90, 370, 920, 1540, 1820, 1540, 920, 370, 90, 110, 506, 1419, 2706, 3696, 3696, 2706, 1419, 506, 110, 132, 672
Offset: 2

Views

Author

N. J. A. Sloane, Oct 17 2002

Keywords

Comments

Row sums give sequence A033484(n)*(n+2). Essentially same triangle as A051597(n,k)*(n+2). - Philippe Deléham, Oct 01 2003

Examples

			2; 6,6; 12,16,12; 20,35,35,20; ...
		

Crossrefs

Cf. A014410 and A007318 for f(n, k, n), A075779 and A075798 for f(n, k, n-1) and A075780 and A075837 for f(n, k, n-2).

Programs

  • Maple
    f := proc(n,p,k) convert( binomial(n,k)*hypergeom([1-k,-p,p-n],[1-n,1],1), `StandardFunctions`); end;
  • Mathematica
    t[n_, k_] := n*HypergeometricPFQ[{-k, 2-n, k-n}, {1, 1-n}, 1]; Table[t[n, k], {n, 2, 12}, {k, 1, n-1}] // Flatten (* Jean-François Alcover, Jan 14 2014 *)

Formula

f(n, p, k) = binomial(n, k)*hypergeom([1-k, -p, p-n], [1-n, 1], 1).

A082560 a(1)=1, a(n)=2*a(n-1) if n is odd, or a(n)=a(n/2)+1 if n is even.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 10, 4, 8, 7, 14, 6, 12, 11, 22, 5, 10, 9, 18, 8, 16, 15, 30, 7, 14, 13, 26, 12, 24, 23, 46, 6, 12, 11, 22, 10, 20, 19, 38, 9, 18, 17, 34, 16, 32, 31, 62, 8, 16, 15, 30, 14, 28, 27, 54, 13, 26, 25, 50, 24, 48, 47, 94, 7, 14, 13, 26, 12, 24, 23, 46, 11, 22, 21, 42, 20
Offset: 1

Views

Author

Benoit Cloitre, May 04 2003

Keywords

Comments

b(1)=1, b(n)=2*b(n/2) if n is even, or b(n)=b(n-1)+1 if n is odd produces the sequence of natural numbers.
Seen as a triangle read by rows: T(1,1) = 1; T(n+1,2*k-1) = T(n,k)+1 and T(n+1,2*k) = 2*T(n,k)+2, 1 <= k <= 2^n. - Reinhard Zumkeller, May 13 2015

Examples

			.  1:                                 1
.  2:                 2                                4
.  3:        3               6                5                10
.  4:    4       8       7       14       6       12       11       22
.  5:  5  10   9  18   8  16  15   30   7  14  13   26  12   24  23   46
		

Crossrefs

Cf. A000079 (row lengths), A033484 (right edges), A166060 (row sums), A232642 (duplicates removed).

Programs

  • Haskell
    a082560 n k = a082560_tabf !! (n-1) !! (k-1)
    a082560_row n = a082560_tabf !! (n-1)
    a082560_tabf = iterate (concatMap (\x -> [x + 1, 2 * x + 2])) [1]
    a082560_list = concat a082560_tabf
    -- Reinhard Zumkeller, May 13 2015
  • PARI
    a(n)=if(n<2,1,if(n%2,2*a(n-1),1+a(n/2)))
    

Formula

if n is in A010737 : a(n)=n-1

A121692 Triangle read by rows: T(n,k) is the number of deco polyominoes of height n and vertical height (i.e., number of rows) k (1 <= k <= n). A deco polyomino is a directed column-convex polyomino in which the height, measured along the diagonal, is attained only in the last column.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 10, 12, 1, 1, 22, 57, 39, 1, 1, 46, 216, 293, 163, 1, 1, 94, 741, 1651, 1664, 888, 1, 1, 190, 2412, 8181, 12458, 11143, 5934, 1, 1, 382, 7617, 37739, 81255, 102558, 87066, 46261, 1, 1, 766, 23616, 166573, 489753, 823597, 941572, 773772, 409149, 1
Offset: 1

Views

Author

Emeric Deutsch, Aug 17 2006

Keywords

Comments

Row sums are the factorials (A000142).
T(n,1) = 1,
T(n,2) = 3*2^(n-2) - 2 = A033484(n-2) for n >= 2.
T(n,3) = A121693(n).
Sum_{k=1..n} k*T(n,k) = A121694(n).

Examples

			T(2,1)=1 and T(2,2)=1 because the deco polyominoes of height 2 are the horizontal and vertical dominoes, having, respectively, 1 and 2 rows.
Triangle starts:
  1;
  1,  1;
  1,  4,   1;
  1, 10,  12,   1;
  1, 22,  57,  39,   1;
  1, 46, 216, 293, 163, 1;
  ...
		

Crossrefs

T(2n,n) gives A374794.

Programs

  • Maple
    T:=proc(n,k) option remember; if k=1 then 1 elif k=n then 1 elif k>n then 0 else k*T(n-1,k)+2*T(n-1,k-1)+add(T(n-1,j),j=1..k-2) fi: end: for n from 1 to 11 do seq(T(n,k),k=1..n) od; # yields sequence in triangular form
    with(linalg): a:=proc(i,j) if i=j then i elif i>j then 1 else 0 fi end: p:=proc(Q) local n,A,b,w,QQ: n:=degree(Q): A:=matrix(n,n,a): b:=j->coeff(Q,t,j): w:=matrix(n,1,b): QQ:=multiply(A,w): sort(expand(add(QQ[k,1]*t^k,k=1..n)+t*Q)): end: P[1]:=t: for n from 2 to 11 do P[n]:=p(P[n-1]) od: for n from 1 to 11 do seq(coeff(P[n],t,j),j=1..n) od; # yields sequence in triangular form
  • Mathematica
    T[n_, k_] := T[n, k] = Which[k == 1, 1, k == n, 1, k > n, 0, True, k*T[n - 1, k] + 2*T[n - 1, k - 1] + Sum[T[n - 1, j], {j, 1, k - 2}]];
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jul 20 2024 *)

Formula

Rec. relation: T(n,1) = 1; T(n,n) = 1; T(n,k) = k*T(n-1,k) + 2*T(n-1,k-1) + Sum_{j =1..k-2} T(n-1,j) for k <= n; T(n,k) = 0 for k > n.
Rec. relation for the row generating polynomials P[n](t): P[1] = t, P[n] = tP[n-1] + (t+t^2+...+t^(n-1))#P[n-1] for n >= 2. Here # stands for the "max-multiplication" of polynomials, a distributive operation, following the rule t^a # t^b = t^max(a,b).
The second Maple program is based on these polynomials.
Previous Showing 31-40 of 72 results. Next