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.

User: Mattias Dooreman

Mattias Dooreman's wiki page.

Mattias Dooreman has authored 1 sequences.

A273465 Numbers generated by starting at 1 and adding twice and subtracting once following the sequence of positive integers.

Original entry on oeis.org

1, 3, 6, 2, 7, 13, 6, 14, 23, 13, 24, 36, 23, 37, 52, 36, 53, 71, 52, 72, 93, 71, 94, 118, 93, 119, 146, 118, 147, 177, 146, 178, 211, 177, 212, 248, 211, 249, 288, 248, 289, 331, 288, 332, 377, 331, 378, 426, 377, 427
Offset: 1

Author

Mattias Dooreman, May 23 2016

Keywords

Comments

This sequence is generated by listing the successive results of 1 + 2 + 3 - 4 + 5 + 6 - 7 + 8 + 9 - 10 + ... etc.
By adding twice and subtracting once, the results at positions i, i+2 and i+4 are linked by the relationship: n, n+1, n.

Examples

			n1 = 0 + 1 = 1
n2 = 1 + 2 = 3
n3 = 1 + 2 + 3 = 6
n4 = 1 + 2 + 3 - 4 = 2
n5 = 1 + 2 + 3 - 4 + 5 = 7
n6 = 1 + 2 + 3 - 4 + 5 + 6 = 13
n7 = 1 + 2 + 3 - 4 + 5 + 6 - 7 = 6
...
->
(n3, n5, n7) = (6, 7, 6)
(n6, n8, n10) = (13, 14, 13)
...
->
n9 = 2.n6 - n7 + 3 = 23
		

Crossrefs

Cf. A143689.

Programs

  • Mathematica
    Accumulate@ Table[If[Mod[n, 3] == 1 && n > 1, -n, n], {n, 50}] (* Michael De Vlieger, May 23 2016 *)
    LinearRecurrence[{1,0,2,-2,0,-1,1},{1,3,6,2,7,13,6},80] (* Harvey P. Dale, Oct 13 2024 *)

Formula

Let the sequence be written 1, 3, a, 2, a+1, b, a, b+1, c, b, c+1, d, c, ... The (a, a+1, a) triple at positions i, i+2, i+4 can be determined from the previous two sequences: (c = 2*b - a + 3). This new sequence starts at position i+3.
G.f.: (-2*z^6 - z^4 + 6*z^3 - 3*z^2 - 2*z - 1)/((z - 1)^3*(z^2 + z + 1)^2).
a(3*n-2) = A143689(n-1).
From Franck Maminirina Ramaharo, Dec 27 2018: (Start)
a(n) = a(n-1) + 2*a(n-3) - 2*a(n-4) - a(n-6) + a(n-7), n >= 8.
E.g.f.: (1/18)*(exp(3*x/2)*(32 + 6*x + 3*x^2) + (4 - 12*x)*cos(sqrt(3)*x/2) - 4*sqrt(3)*(1 + x)*sin(sqrt(3)*x/2))/exp(x/2). (End)

Extensions

a(25) corrected by Seiichi Manyama, May 26 2016