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 11-20 of 28 results. Next

A152833 a(0) = -3; a(n) = n-a(n-1).

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    lst={};a=3;Do[a=n-a;AppendTo[lst,a],{n,0,6!}];lst
    RecurrenceTable[{a[0]==-3,a[n]==n-a[n-1]},a,{n,80}] (* Harvey P. Dale, May 16 2016 *)

Formula

a(n) = (2n+1-13*(-1)^n)/4. G.f.: -(3-7x+3x^2)/((1+x)(1-x)^2). - R. J. Mathar, Jan 08 2009

Extensions

Indices added to definition, offset corrected by R. J. Mathar, Jan 08 2009

A152835 a(0) = -22; a(n) = n-a(n-1).

Original entry on oeis.org

-22, 23, -21, 24, -20, 25, -19, 26, -18, 27, -17, 28, -16, 29, -15, 30, -14, 31, -13, 32, -12, 33, -11, 34, -10, 35, -9, 36, -8, 37, -7, 38, -6, 39, -5, 40, -4, 41, -3, 42, -2, 43, -1, 44, 0, 45, 1, 46, 2, 47, 3, 48, 4, 49, 5, 50, 6, 51, 7, 52, 8, 53, 9, 54, 10, 55, 11, 56, 12
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [(1-89*(-1)^n+2*n)/4 : n in [0..100]]; // Wesley Ivan Hurt, Oct 28 2014
  • Maple
    A152835:=n->(1-89*(-1)^n+2*n)/4: seq(A152835(n), n=0..100); # Wesley Ivan Hurt, Oct 28 2014
  • Mathematica
    lst={};a=-22;Do[a=n-a;AppendTo[lst,a],{n,0,6!}];lst
  • PARI
    Vec(-(22*x^2-45*x+22)/((x-1)^2*(x+1)) + O(x^100)) \\ Colin Barker, Oct 28 2014
    

Formula

a(n) = a(n-1)+a(n-2)-a(n-3). G.f.: -(22*x^2-45*x+22) / ((x-1)^2*(x+1)). - Colin Barker, Oct 28 2014

Extensions

Indices added to definition, offset corrected - R. J. Mathar, Jan 08 2009
Name and Mathematica code corrected by Colin Barker, Oct 28 2014

A152836 a(0)=-1; a(n)=n^a(n-1)-a(n-1)^n.

Original entry on oeis.org

-1, 2, 0, 1, 3, -118
Offset: 0

Views

Author

Keywords

Comments

Sequence is finite because followup terms are fractions. - R. J. Mathar, Jun 19 2021

Crossrefs

Programs

  • Mathematica
    lst={};a=1;Do[a=n^a-a^n;AppendTo[lst,a],{n,0,5}];lst
    nxt[{n_,a_}]:={n+1,(n+1)^a-a^(n+1)}; NestList[nxt,{0,-1},5][[All,2]] (* Harvey P. Dale, Jun 06 2022 *)

Extensions

Definition corrected by N. J. A. Sloane, Jan 11 2009
Offset corrected. R. J. Mathar, Jun 19 2021

A152837 a(0)=-1; a(n)=Floor[n^a(n-1)-a(n-1)^n].

Original entry on oeis.org

-1, 2, 0, 1, 3, -118, -2699554153024, 1044826807337428519663920677057429215016680080584103502827667086054551857192770337767423
Offset: 0

Views

Author

Keywords

Examples

			a(1) = 1^(-1)-(-1)^1 = 2. - R. J. Mathar, Jan 08 2009
		

Crossrefs

Programs

  • Mathematica
    lst={};a=1;Do[a=n^a-a^n;AppendTo[lst,Floor[a]],{n,0,7}];lst

Extensions

Indices added to definition, offset corrected - R. J. Mathar, Jan 08 2009

A209350 Number of initially rising meander words, where each letter of the cyclic n-ary alphabet occurs twice.

Original entry on oeis.org

1, 0, 1, 5, 9, 11, 16, 19, 25, 29, 36, 41, 49, 55, 64, 71, 81, 89, 100, 109, 121, 131, 144, 155, 169, 181, 196, 209, 225, 239, 256, 271, 289, 305, 324, 341, 361, 379, 400, 419, 441, 461, 484, 505, 529, 551, 576, 599, 625, 649, 676, 701, 729, 755, 784, 811, 841
Offset: 0

Views

Author

Alois P. Heinz, Mar 06 2012

Keywords

Comments

In a meander word letters of neighboring positions have to be neighbors in the alphabet, where in a cyclic alphabet the first and the last letters are considered neighbors too. The words are not considered cyclic here.
A word is initially rising if it is empty or if it begins with the first letter of the alphabet that can only be followed by the second letter in this word position.
a(n) is also the number of (2*n-1)-step walks on n-dimensional cubic lattice from (1,0,...,0) to (2,2,...,2) with positive unit steps in all dimensions such that the indices of dimensions used in consecutive steps differ by 1 or are in the set {1,n}.

Examples

			a(0) = 1: the empty word.
a(1) = 0 = |{ }|.
a(2) = 1 = |{abab}|.
a(3) = 5 = |{abacbc, abcabc, abcacb, abcbac, abcbca}|.
a(4) = 9 = |{ababcdcd, abadcbcd, abadcdcb, abcbadcd, abcbcdad, abcdabcd, abcdadcb, abcdcbad, abcdcdab}|.
		

Crossrefs

Row n=2 of A209349.
First differences for n>2 give: A084964(n+1), A097065(n+3).
Cf. A245578.

Programs

  • Maple
    a:= n-> `if`(n<3, (n-1)^2, (n/2+1)^2 -(n mod 2)*5/4):
    seq(a(n), n=0..60);
  • Mathematica
    LinearRecurrence[{2,0,-2,1},{1,0,1,5,9,11,16},60] (* Harvey P. Dale, Jan 02 2020 *)

Formula

G.f.: -(3*x^6-5*x^5-2*x^4+5*x^3+x^2-2*x+1) / ((x+1)*(x-1)^3).
a(n) = (n-1)^2 if n<3, a(n) = (n/2+1)^2 - (n mod 2)*5/4 else.

A152838 a(0)=1; a(n)=Floor[a(n-1)^n-n^a(n-1)].

Original entry on oeis.org

1, 0, -1, -2, 3, 118, -199068134034785153195409370979964879499768447341765846329146257207125965412281784631240438088
Offset: 0

Views

Author

Keywords

Examples

			a(1) = 1^1-1^1 = 0. - R. J. Mathar, Jan 08 2009
		

Crossrefs

Programs

  • Mathematica
    lst={};a=1;Do[a=a^n-n^a;AppendTo[lst,Floor[a]],{n,0,6}];lst

Extensions

Indices added to definition, offset corrected - R. J. Mathar, Jan 08 2009

A029177 Expansion of 1/((1-x^2)(1-x^4)(1-x^5)(1-x^12)).

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 2, 1, 3, 2, 4, 2, 6, 3, 7, 4, 9, 6, 10, 7, 13, 9, 15, 10, 19, 13, 21, 15, 25, 19, 28, 21, 33, 25, 37, 28, 43, 33, 47, 37, 54, 43, 59, 47, 67, 54, 73, 59, 82, 67, 89, 73, 99, 82, 107, 89, 118, 99, 127, 107, 140, 118, 150, 127, 164, 140, 175, 150, 190, 164, 203
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A029011(n) = a(2n) = a(2n+5).

Programs

  • Maple
    M := Matrix(23, (i,j)-> if (i=j-1) or (j=1 and member(i, [2, 4, 5, 11, 12, 18, 19, 21])) then 1 elif j=1 and member(i, [6, 7, 9, 14, 16, 17, 23]) then -1 else 0 fi); a := n -> (M^(n))[1,1]; seq (a(n), n=0..70); # Alois P. Heinz, Jul 25 2008
  • Mathematica
    CoefficientList[Series[1/((1-x^2)(1-x^4)(1-x^5)(1-x^12)),{x,0,70}],x] (* Harvey P. Dale, May 31 2012 *)
  • PARI
    a(n)=if(n<-22,-a(-23-n),polcoeff(1/((1-x^2)*(1-x^4)*(1-x^5)*(1-x^12))+x*O(x^n),n))

Formula

G.f.: 1/((1-x^2)(1-x^4)(1-x^5)(1-x^12)).
a(n) = -a(-23 - n).
a(n) = A029011(A084964(n) - 2).

A152839 a(0) = 0; a(n) = n! - a(n-1)!.

Original entry on oeis.org

0, 0, 1, 5, -96
Offset: 0

Views

Author

Keywords

Crossrefs

Extensions

Indices added to definition, offset corrected - R. J. Mathar, Jan 08 2009
Definition corrected by Georg Fischer, Jun 03 2025

A168198 a(n) = 3*n - a(n-1) + 1 with n > 1, a(1)=1.

Original entry on oeis.org

1, 6, 4, 9, 7, 12, 10, 15, 13, 18, 16, 21, 19, 24, 22, 27, 25, 30, 28, 33, 31, 36, 34, 39, 37, 42, 40, 45, 43, 48, 46, 51, 49, 54, 52, 57, 55, 60, 58, 63, 61, 66, 64, 69, 67, 72, 70, 75, 73, 78, 76, 81, 79, 84, 82, 87, 85, 90, 88, 93, 91, 96, 94, 99, 97, 102, 100, 105, 103, 108
Offset: 1

Views

Author

Vincenzo Librandi, Nov 20 2009

Keywords

Comments

Alternately add 5 and subtract 2, starting with 1. Apparently this was a test question: Find the next two numbers after 1,6,4,9,7,12,10. - N. J. A. Sloane, Dec 18 2010

Examples

			From _Muniru A Asiru_, Mar 20 2018: (Start)
For n = 2, a(2) = 3*2 - a[2-1] + 1 = 6 - a[1] + 1 = 6 - 1 + 1 = 6.
For n = 3, a(3) = 3*3 - a[3-1] + 1 = 9 - a[2] + 1 = 9 - 6 + 1 = 4.
For n = 4, a(4) = 3*4 - a[4-1] + 1 = 12 - a[3] + 1 = 12 - 4 + 1 = 9.
... (End)
		

Crossrefs

Programs

  • GAP
    a:=[1];; for n in [2..80] do a[n]:=3*n-a[n-1]+1; od; a; # Muniru A Asiru, Mar 20 2018
  • Magma
    I:=[1,6,4]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..60]]; // Vincenzo Librandi, Feb 28 2012
    
  • Maple
    a:= proc(n) option remember: if n = 1 then 1 elif n >= 2 then 3*n - procname(n-1) + 1 fi; end:
    seq(a(n), n = 1..70); # Muniru A Asiru, Mar 20 2018
  • Mathematica
    LinearRecurrence[{1,1,-1},{1,6,4},100] (* Vincenzo Librandi, Feb 28 2012 *)
  • PARI
    a(n)=(6*n+5+7*(-1)^n)/4 \\ Charles R Greathouse IV, Jan 11 2012
    

Formula

a(n) = (6*n + 5 + 7*(-1)^n)/4. - Jon E. Schoenfield, Jun 24 2010
G.f.: x*(1+5*x-3*x^2)/((1+x)(1-x)^2). - Bruno Berselli, Feb 28 2012
Sum_{n>=1} (-1)^(n+1)/a(n) = 1/3 + Pi/(6*sqrt(3)) + log(3)/2. - Amiram Eldar, Feb 23 2023

A239304 Triangle of permutations corresponding to the compressed square roots of Gray code * bit-reversal permutation (A239303).

Original entry on oeis.org

1, 1, 2, 3, 1, 2, 4, 2, 1, 3, 2, 5, 4, 1, 3, 2, 5, 6, 3, 1, 4, 6, 2, 3, 7, 5, 1, 4, 7, 3, 2, 6, 8, 4, 1, 5, 3, 8, 7, 2, 4, 9, 6, 1, 5, 3, 8, 9, 4, 2, 7, 10, 5, 1, 6, 9, 3, 4, 10, 8, 2, 5, 11, 7, 1, 6, 10, 4, 3, 9
Offset: 1

Views

Author

Tilman Piesk, Mar 14 2014

Keywords

Comments

The symmetrical binary matrices corresponding to the rows of A239303 can be interpreted as adjacency matrices of undirected graphs. These graphs are chains where one end is connected to itself, so they can be interpreted as permutations. The end connected to itself is always the first element of the permutation, i.e., on the left side of the triangle.
Columns of the square array:
T(m,1) = A008619(m) = 1,2,2,3,3...
T(m,2) = 1,1,1...
T(m,3) = A028242(m+3) = 3,2,4,3,5,4,6,5,7,6,8,7,9,8,10,9,11,10,12...
T(m,4) = m+3 = 4,5,6...
T(m,5) = A084964(m+4) = 2,5,3,6,4,7,5,8,6,9,7,10,8,11,9,12,10,13...
T(m,6) = 2,2,2...
T(m,7) = A168230(m+5) = 6,3,7,4,8,5,9,6,10,7,11,8,12,9,13,10,14...
T(m,8) = m+6 = 7,8,9...
T(m,9) = A152832(m+9) = 3,8,4,9,5,10,6,11,7,12,8,13,9,14,10,15...
T(m,10) = 3,3,3...
Diagonals of the square array:
T(n,n) = a(A001844(n)) = 1,1,4,7,4,2,9,14,7,3,14,21,10,4,19,28,13,5,24...
T(n,2n-1) = a(A064225(n)) = 1,2,3...
T(2n-1,n) = a(A081267(n)) = 1,1,5,10,6,2,12,21,11,3,19,32,16,4,26,43,21...

Examples

			Triangular array begins:
  1
  1 2
  3 1 2
  4 2 1 3
  2 5 4 1 3
  2 5 6 3 1 4
Square array begins:
  1 1 3 4 2 2
  2 1 2 5 5 2
  2 1 4 6 3 2
  3 1 3 7 6 2
  3 1 5 8 4 2
  4 1 4 9 7 2
Row 5 of A239303 is the vector (12,18,1,17,10), which corresponds to the following binary matrix:
  0 0 1 1 0
  0 1 0 0 1
  1 0 0 0 0
  1 0 0 0 1
  0 1 0 1 0
Interpreted as an adjacency matrix it describes the following graph, where each number is connected to its neighbors, and only the 2 is connected to itself:
  2 5 4 1 3
This is row 5 of the triangular array.
		

Crossrefs

Previous Showing 11-20 of 28 results. Next