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-10 of 13 results. Next

A084964 Follow n+2 by n. Also solution of a(n+2)=a(n)+1, a(0)=2, a(1)=0.

Original entry on oeis.org

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

Views

Author

Michael Somos, Jun 15 2003

Keywords

Crossrefs

Cf. A217764(1,n) = a(n+2).

Programs

  • Haskell
    import Data.List (transpose)
    a084964 n = a084964_list !! n
    a084964_list = concat $ transpose [[2..], [0..]]
    -- Reinhard Zumkeller, Apr 06 2015
  • Magma
    &cat[ [n+2, n]: n in [0..37] ]; // Klaus Brockhaus, Nov 23 2009
    
  • Maple
    A084964:=n->floor(n/2)+1+(-1)^n; seq(A084964(k), k=0..100); # Wesley Ivan Hurt, Nov 08 2013
  • Mathematica
    lst={}; a=1; Do[a=n-a; AppendTo[lst, a], {n, 0, 100}]; lst (* Vladimir Joseph Stephan Orlovsky, Dec 14 2008 *)
    Table[{n,n-2},{n,2,40}]//Flatten (* or *) LinearRecurrence[{1,1,-1},{2,0,3},80] (* Harvey P. Dale, Sep 12 2021 *)
  • PARI
    a(n)=n\2-2*(n%2)+2
    

Formula

G.f.: (2-2x+x^2)/((1-x)(1-x^2)).
a(2n+1)=n. a(2n)=n+2. a(n+2)=a(n)+1. a(n)=-a(-3-n).
a(n) = floor(n/2) + 1 + (-1)^n. - Reinhard Zumkeller, Aug 27 2005
A112032(n)=2^a(n); A112033(n)=3*2^a(n); a(n)=A109613(n+2)-A052938(n). - Reinhard Zumkeller, Aug 27 2005
a(n) = n + 1 - a(n-1) (with a(0)=2). - Vincenzo Librandi, Aug 08 2010
a(n) = floor(n/2)*3 - floor((n-1)/2)*2. - Ross La Haye, Mar 27 2013
a(n) = 3*n - 3 - 5*floor((n-1)/2). - Wesley Ivan Hurt, Nov 08 2013
a(n) = (3 + 5*(-1)^n + 2*n)/4. - Wolfgang Hintze, Dec 13 2014
E.g.f.: ((4 + x)*cosh(x) - (1 - x)*sinh(x))/2. - Stefano Spezia, Jul 01 2023

Extensions

First part of definition adjusted to match offset by Klaus Brockhaus, Nov 23 2009

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

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

A198392 a(n) = (6*n*(3*n+7)+(2*n+13)*(-1)^n+3)/16 + 1.

Original entry on oeis.org

2, 4, 12, 18, 31, 41, 59, 73, 96, 114, 142, 164, 197, 223, 261, 291, 334, 368, 416, 454, 507, 549, 607, 653, 716, 766, 834, 888, 961, 1019, 1097, 1159, 1242, 1308, 1396, 1466, 1559, 1633, 1731, 1809, 1912, 1994, 2102, 2188, 2301, 2391, 2509, 2603, 2726, 2824, 2952
Offset: 0

Views

Author

Bruno Berselli, Oct 25 2011

Keywords

Comments

For an origin of this sequence, see the triangular spiral illustrated in the Links section.
First bisection gives A117625 (without the initial term).

Crossrefs

Cf. A152832 (by Superseeker).
Cf. sequences related to the triangular spiral: A022266, A022267, A027468, A038764, A045946, A051682, A062708, A062725, A062728, A062741, A064225, A064226, A081266-A081268, A081270-A081272, A081275 [incomplete list].

Programs

  • Magma
    [(6*n*(3*n+7)+(2*n+13)*(-1)^n+3)/16+1: n in [0..50]];
  • Mathematica
    LinearRecurrence[{1,2,-2,-1,1},{2,4,12,18,31},60] (* Harvey P. Dale, Jun 15 2022 *)
  • PARI
    for(n=0, 50, print1((6*n*(3*n+7)+(2*n+13)*(-1)^n+3)/16+1", "));
    

Formula

G.f.: (2+2*x+4*x^2+2*x^3-x^4)/((1+x)^2*(1-x)^3).
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5).
a(n)-a(-n-1) = A168329(n+1).
a(n)+a(n-1) = A102214(n).
a(2n)-a(2n-1) = A016885(n).
a(2n+1)-a(2n) = A016825(n).

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

A162938 A 2-based alternate sum over the numbers from 0 to the n-th nonprime.

Original entry on oeis.org

2, 5, 8, 11, 14, 25, 17, 20, 23, 40, 26, 29, 32, 55, 35, 38, 65, 41, 70, 44, 47, 50, 85, 53, 90, 56, 59, 100, 62, 65, 68, 115, 71, 74, 125, 77, 130, 80, 83, 140, 86, 145, 89, 92, 95, 160, 98, 165, 101, 104, 175, 107, 110, 113, 190, 116, 195, 119, 122, 205, 125, 128, 215
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 18 2009

Keywords

Comments

Define a 2-based sum S(n) = Sum_{i=0..n} (2 - (-1)^i*i) = 2*n - (-1)^n*A152832(n).
a(n) is this sum evaluated at A141468(n).

Examples

			a(1) = 2 - 0*(-1)^0 = 2.
a(2) = 2 - 0*(-1)^0 + 2 - 1*(-1)^1 = 2 + 3 = 5.
a(3) = 2 - 0*(-1)^0 + 2 - 1*(-1)^1 + 2 - 2*(-1)^2 + 2 - 3*(-1)^3 + 2 - 4*(-1)^4 = 2 + 3 + 0 + 5 - 2 = 8.
		

Crossrefs

Cf. A141468.

Programs

  • Maple
    A152832 := proc(n) option remember; if n = 0 then -2; else n-procname(n-1) ; fi; end:
    A141468 := proc(n) option remember ; local a; if n <=2 then n-1; else for a from procname(n-1)+1 do if not isprime(a) then RETURN(a); fi; od: fi; end:
    A162938 := proc(n) local npr; npr := A141468(n) ; 2*npr-(-1)^npr*A152832(npr) ; end:
    seq(A162938(n),n=1..100) ; # R. J. Mathar, Jul 21 2009

Formula

a(n) = Sum_{x=0..n-th nonprime} (2 - x*(-1)^x). - Juri-Stepan Gerasimov, Jul 28 2009

Extensions

Definition edited by R. J. Mathar, Jul 21 2009

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

Showing 1-10 of 13 results. Next