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

A114112 a(1)=1, a(2)=2; thereafter a(n) = n+1 if n odd, n-1 if n even.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15, 18, 17, 20, 19, 22, 21, 24, 23, 26, 25, 28, 27, 30, 29, 32, 31, 34, 33, 36, 35, 38, 37, 40, 39, 42, 41, 44, 43, 46, 45, 48, 47, 50, 49, 52, 51, 54, 53, 56, 55, 58, 57, 60, 59, 62, 61, 64, 63, 66, 65, 68, 67, 70, 69, 72, 71
Offset: 1

Views

Author

Leroy Quet, Nov 13 2005

Keywords

Comments

a(1)=1; for n>1, a(n) is the smallest positive integer not occurring earlier in the sequence such that a(n) does not divide Sum_{k=1..n-1} a(k). - Leroy Quet, Nov 13 2005 (This was the original definition. A simple induction argument shows that this is the same as the present definition. - N. J. A. Sloane, Mar 12 2018)
Define b(1)=2; for n>1, b(n) is the smallest number not yet in the sequence which shares a prime factor with the sum of all preceding terms. Then a simple induction argument shows that the b(n) sequence is the same as the present sequence with the first term omitted. - David James Sycamore, Feb 26 2018
Here are the details of the two induction arguments (Start)
For a(n), let A(n) = a(1)+...+a(n). The claim is that for n>2 a(n)=n+1 if n odd, n-1 if n even.
The induction hypotheses are: for i
For b(n), the argument is very similar, except that the missing numbers when looking for b(n) are slightly different, and (setting B(n) = b(1)+...b(n)), we have B(2i)=(i+1)(2i+1), B(2i+1)=(i+2)(2i+1). - N. J. A. Sloane, Mar 14 2018
When sequence a(n) is increasing, then the Cesàro means sequence c(n) = (a(1)+...+a(n))/n is also increasing, but the converse is false. This sequence is a such an example where c(n) is increasing, while a(n) is not increasing (Arnaudiès et al.). See proof in A354008. - Bernard Schott, May 11 2022

References

  • J. M. Arnaudiès, P. Delezoide et H. Fraysse, Exercices résolus d'Analyse du cours de mathématiques - 2, Dunod, Exercice 10, pp. 14-16.

Crossrefs

All of A014681, A103889, A113981, A114112, A114285 are essentially the same sequence. - N. J. A. Sloane, Mar 12 2018
Cf. A114113 (partial sums).
See A084265 for the partial sums of the b(n) sequence.
About Cesàro mean theorem: A033999, A141310, A237420, A354008.
Cf. A244009.

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = Block[{k = 1, s, t = Table[ a[i], {i, n - 1}]}, s = Plus @@ t; While[ Position[t, k] != {} || Mod[s, k] == 0, k++ ]; k]; Array[a, 72] (* Robert G. Wilson v, Nov 18 2005 *)
  • PARI
    a(n) = if (n<=2, n, if (n%2, n+1, n-1)); \\ Michel Marcus, May 16 2022
    
  • Python
    def A114112(n): return n + (0 if n <= 2 else -1+2*(n%2)) # Chai Wah Wu, May 24 2022

Formula

G.f.: x*(x^4-2*x^3+x^2+x+1)/((1-x)*(1-x^2)). - N. J. A. Sloane, Mar 12 2018
The g.f. for the b(n) sequence is x*(x^3-3*x^2+2*x+2)/((1-x)*(1-x^2)). - Conjectured (correctly) by Colin Barker, Mar 04 2018
E.g.f.: 1 - x + x^2/2 + (x - 1)*cosh(x) + (x + 1)*sinh(x). - Stefano Spezia, Sep 02 2022
Sum_{n>=1} (-1)^(n+1)/a(n) = 1 - log(2) (A244009). - Amiram Eldar, Jun 29 2025

Extensions

More terms from Robert G. Wilson v, Nov 18 2005
Entry edited (with simpler definition) by N. J. A. Sloane, Mar 12 2018

A210796 Triangle of coefficients of polynomials v(n,x) jointly generated with A210795; see the Formula section.

Original entry on oeis.org

1, 1, 2, 3, 3, 3, 3, 7, 6, 5, 5, 10, 16, 12, 8, 5, 16, 26, 34, 23, 13, 7, 21, 47, 64, 70, 43, 21, 7, 29, 68, 123, 147, 140, 79, 34, 9, 36, 104, 200, 304, 324, 274, 143, 55, 9, 46, 140, 324, 538, 714, 690, 527, 256, 89, 11, 55, 195, 480, 932, 1366, 1616, 1431
Offset: 1

Author

Clark Kimberling, Mar 26 2012

Keywords

Comments

Row n starts with A109613(n) and ends with F(n+1), where F=A000045 (Fibonacci numbers).
Column 2: A114113
For a discussion and guide to related arrays, see A208510.

Examples

			First five rows:
1
1...2
3...3....3
3...7....6....5
5...10...16...12...8
First three polynomials v(n,x): 1, 1 + 2x, 3 + 3x + 3x^2
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := u[n - 1, x] + (x + j)*v[n - 1, x] + c;
    d[x_] := h + x; e[x_] := p + x;
    v[n_, x_] := d[x]*u[n - 1, x] + e[x]*v[n - 1, x] + f;
    j = 0; c = 1; h = 2; p = -1; f = 0;
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]   (* A210795 *)
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]   (* A210796 *)

Formula

u(n,x)=u(n-1,x)+x*v(n-1,x)+1,
v(n,x)=(x+2)*u(n-1,x)+(x-1)*v(n-1,x),
where u(1,x)=1, v(1,x)=1.

A210798 Triangle of coefficients of polynomials v(n,x) jointly generated with A210797; see the Formula section.

Original entry on oeis.org

1, 2, 2, 1, 3, 3, 2, 5, 7, 5, 1, 6, 12, 13, 8, 2, 8, 20, 29, 25, 13, 1, 9, 27, 51, 62, 46, 21, 2, 11, 39, 84, 125, 129, 84, 34, 1, 12, 48, 126, 224, 284, 258, 151, 55, 2, 14, 64, 182, 374, 562, 622, 505, 269, 89, 1, 15, 75, 250, 580, 1008, 1328, 1315, 969, 475
Offset: 1

Author

Clark Kimberling, Mar 26 2012

Keywords

Comments

Row n starts with A109613(n) and ends with F(n+1), where F=A000045 (Fibonacci numbers).
Column 2: A114113
For a discussion and guide to related arrays, see A208510.

Examples

			First five rows:
1
2...2
1...3...3
2...5...7....5
1...6...12...13...8
First three polynomials v(n,x): 1, 2 + 2x, 1 + 3x + 3x^2
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := u[n - 1, x] + (x + j)*v[n - 1, x] + c;
    d[x_] := h + x; e[x_] := p + x;
    v[n_, x_] := d[x]*u[n - 1, x] + e[x]*v[n - 1, x] + f;
    j = 0; c = 0; h = 2; p = -1; f = 1;
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]    (* A210797 *)
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]    (* A210798 *)
    Table[u[n, x] /. x -> 1, {n, 1, z}]   (* A099232 *)
    Table[v[n, x] /. x -> 1, {n, 1, z}]   (* A006130 *)
    Table[u[n, x] /. x -> -1, {n, 1, z}]  (* A008346 *)
    Table[v[n, x] /. x -> -1, {n, 1, z}]  (* A039834 *)

Formula

u(n,x)=u(n-1,x)+x*v(n-1,x),
v(n,x)=(x+2)*u(n-1,x)+(x-1)*v(n-1,x)+1,
where u(1,x)=1, v(1,x)=1.

A376901 a(n) = (n*(n-1)+(-1)^n+5)/2.

Original entry on oeis.org

3, 2, 4, 5, 9, 12, 18, 23, 31, 38, 48, 57, 69, 80, 94, 107, 123, 138, 156, 173, 193, 212, 234, 255, 279, 302, 328, 353, 381, 408, 438, 467, 499, 530, 564, 597, 633, 668, 706, 743, 783, 822, 864, 905, 949, 992, 1038, 1083, 1131, 1178, 1228, 1277, 1329, 1380, 1434
Offset: 0

Author

Eric W. Weisstein, Oct 08 2024

Keywords

Comments

For n >= 3, also the disorder number of the pan graph.

Crossrefs

Programs

  • Mathematica
    Table[(n (n - 1) + 5 + (-1)^n)/2, {n, 20}]
    LinearRecurrence[{2, 0, -2, 1}, {2, 4, 5, 9}, {0, 20}]

Formula

a(n) = 2*a(n-1)-2*a(n-3)+1*a(n-4).
G.f.: x*(-2+3*x^2-3*x^3)/((-1+x)^3*(1+x)).
After initial terms same as {A114113}+2, {A236453}+1, ({A081353}+1)/2 + 2. Hugo Pfoertner, Oct 10 2024.
Showing 1-4 of 4 results.