login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A236348 Expansion of (1 - x + 2*x^2 + x^3) / ((1 - x) * (1 - x^3)) in powers of x. 2
1, 0, 2, 4, 3, 5, 7, 6, 8, 10, 9, 11, 13, 12, 14, 16, 15, 17, 19, 18, 20, 22, 21, 23, 25, 24, 26, 28, 27, 29, 31, 30, 32, 34, 33, 35, 37, 36, 38, 40, 39, 41, 43, 42, 44, 46, 45, 47, 49, 48, 50, 52, 51, 53, 55, 54, 56, 58, 57, 59, 61, 60, 62, 64, 63, 65, 67 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

An order 2 permutation of nonnegative integers.

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 0..1000

Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).

FORMULA

G.f.: (1 - x + 2*x^2 + x^3) / ((1 - x) * (1 - x^3)).

First difference is period 3 sequence [-1, 2, 2, ...].

a(n) = a(n-1) + a(n-3) - a(n-4). a(4-n) = 4-a(n).

0 = a(n)*(-a(n+1) + a(n+3)) + a(n+1)*(a(n+1) - a(n+2)) + a(n+2)*(a(n+2) - a(n+3)) for all n in Z.

a(n) = A143097(n) if n>1.

a(n) = a(n-1) + 3*(n^2 mod 3) - 1, with a(0)=1. [Paolo P. Lava, Feb 14 2014]

a(n) = n - 1 + mod(n-1, 3). - Wesley Ivan Hurt, Aug 21 2014

a(n) = n + (2/sqrt(3))*sin(2*(n+1)*Pi/3). - Wesley Ivan Hurt, Sep 26 2017

EXAMPLE

G.f. = 1 + 2*x^2 + 4*x^3 + 3*x^4 + 5*x^5 + 7*x^6 + 6*x^7 + 8*x^8 + 10*x^9 + ...

MAPLE

P:=proc(q) local a, n; a:=1; print(a);

for n from 0 to q do a:=a+3*(n^2 mod 3)-1; print(a);

od; end: P(100); # Paolo P. Lava, Feb 14 2014

MATHEMATICA

Table[n - 1 + Mod[n - 1, 3], {n, 0, 100}] (* Wesley Ivan Hurt, Aug 21 2014 *)

LinearRecurrence[{1, 0, 1, -1}, {1, 0, 2, 4}, 80] (* or *) CoefficientList[Series[(1 - x + 2 x^2 + x^3) / ((1 - x) (1 -x^3)), {x, 0, 80}], x] (* Vincenzo Librandi, Sep 28 2017 *)

PROG

(PARI) {a(n) = (n-1) % 3 + n-1 }

(Magma) [n-1+((n-1) mod 3) : n in [0..100]]; // Wesley Ivan Hurt, Aug 21 2014

(Magma) I:=[1, 0, 2, 4]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..80]]; // Vincenzo Librandi, Sep 28 2017

CROSSREFS

Cf. A143097.

Sequence in context: A074135 A074146 A262478 * A143097 A074147 A138607

Adjacent sequences: A236345 A236346 A236347 * A236349 A236350 A236351

KEYWORD

nonn,easy

AUTHOR

Michael Somos, Jan 23 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 08:01 EDT 2023. Contains 361579 sequences. (Running on oeis4.)