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

A186809 Period 6 sequence [0, 1, 2, 0, -2, -1, ...].

Original entry on oeis.org

0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0
Offset: 0

Views

Author

Michael Somos, Feb 26 2011

Keywords

Comments

For n > 0: a(n) = A262565(n+1) - A262565(n). - Reinhard Zumkeller, Oct 19 2015

Examples

			G.f. = x + 2*x^2 - 2*x^4 - x^5 + x^7 + 2*x^8 - 2*x^10 - x^11 + x^13 + ...
		

Crossrefs

Cf. A193680.
Cf. A262565.

Programs

  • Haskell
    a186809 n = a186809_list !! (n-1)
    a186809_list = cycle [0, 1, 2, 0, -2, -1]
    -- Reinhard Zumkeller, Oct 19 2015
  • Magma
    [(((n+1) mod 3)-1)*(((n+1) mod 2)+1)*(-1)^(n+1) : n in [0..100]]; // Wesley Ivan Hurt, Aug 31 2014
    
  • Maple
    A186809:=n->(((n+1) mod 3)-1)*(((n+1) mod 2)+1)*(-1)^(n+1): seq(A186809(n), n=0..100); # Wesley Ivan Hurt, Aug 31 2014
  • Mathematica
    Table[(Mod[n + 1, 3] - 1) (Mod[n + 1, 2] + 1) (-1)^(n + 1), {n, 0, 100}] (* Wesley Ivan Hurt, Aug 31 2014 *)
    PadRight[{},120,{0,1,2,0,-2,-1}] (* Harvey P. Dale, Nov 18 2020 *)
  • PARI
    {a(n) = [0, 1, 2, 0, -2, -1][n%6 + 1]};
    

Formula

Euler transform of length 6 sequence [2, -3, 0, 0, 0, 1].
a(n) is multiplicative with a(2^e) = -2 * (-1)^e if e>0. a(3^e) = 0^e, a(p^e) = 1 if p == 1 (mod 6), a(p^e) = (-1)^n if p == 5 (mod 6).
G.f.: x * (1 + x)^2 / (1 + x^2 + x^4). a(n+3) = a(-n) = -a(n). a(n) = n if |n| < 3.
a(n) = (mod(n+1, 3) - 1) * (mod(n+1, 2) + 1) * (-1)^(n+1). - Wesley Ivan Hurt, Aug 31 2014
|a(n)| = A193680(n). - Wesley Ivan Hurt, Aug 31 2014

A262564 A politician's answer to the question "What comes next after 2,3,5?".

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 19 2015

Keywords

Comments

The politician plans to legislate away the mistakes of the past and return to normalcy.

Crossrefs

Cf. A262565.

Programs

  • Haskell
    a262564 n = a262564_list !! (n-1)
    a262564_list = [2, 3, 5, 4] ++ [6..]  -- Reinhard Zumkeller, Oct 20 2015
  • Mathematica
    CoefficientList[Series[(- x^5 + 3 x^4 - 3 x^3 + x^2 - x + 2)/(x - 1)^2, {x, 0, 75}], x] (* Vincenzo Librandi, Nov 04 2016 *)
    LinearRecurrence[{2,-1},{2,3,5,4,6,7},80] (* Harvey P. Dale, Jul 31 2021 *)

Formula

G.f.: x*(-x^5 + 3*x^4 - 3*x^3 + x^2 - x + 2)/(x - 1)^2. - Chai Wah Wu, Nov 03 2016
Showing 1-2 of 2 results.