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.

A008611 a(n) = a(n-3) + 1, with a(0)=a(2)=1, a(1)=0.

Original entry on oeis.org

1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8, 7, 8, 9, 8, 9, 10, 9, 10, 11, 10, 11, 12, 11, 12, 13, 12, 13, 14, 13, 14, 15, 14, 15, 16, 15, 16, 17, 16, 17, 18, 17, 18, 19, 18, 19, 20, 19, 20, 21, 20, 21, 22, 21, 22, 23, 22, 23, 24, 23, 24, 25, 24, 25, 26, 25, 26, 27, 26, 27, 28
Offset: 0

Views

Author

N. J. A. Sloane, Mar 15 1996

Keywords

Comments

Molien series of 2-dimensional representation of cyclic group of order 3 over GF(2).
One step back, two steps forward.
The crossing number of the graph C(n, {1,3}), n >= 8, is [n/3] + n mod 3, which gives this sequence starting at the first 4. [Yang Yuansheng et al.]
A Chebyshev transform of A078008. The g.f. is the image of (1-x)/(1-x-2*x^2) (g.f. of A078008) under the Chebyshev transform A(x)-> (1/(1+x^2))*A(x/(1+x^2)). - Paul Barry, Oct 15 2004
A047878 is an essentially identical sequence. - Anton Chupin, Oct 24 2009
Rhyme scheme of Dante Alighieri's "Divine Comedy." - David Gaita, Feb 11 2011
A194960 results from deleting the first four terms of A008611. Note that deleting the first term or first four terms of A008611 leaves a concatenation of segments (n, n+1, n+2); for related concatenations, see
A008619, (n,n+1) after deletion of first term;
A053737, (n,n+1,n+2,n+3) beginning with n=0;
A053824, (n to n+4) beginning with n=0. - Clark Kimberling, Sep 07 2011
It appears that a(n) is the number of roots of x^(n+1) + x + 1 inside the unit circle. - Michel Lagneau, Nov 02 2012
Also apparently for n >= 2: a(n) is the largest remainder r that results from dividing n+2 by 1..n+2 more than once, i.e., a(n) = max(i, A072528(n+2,i)>1). - Ralf Stephan, Oct 21 2013
Number of n-element subsets of [n+1] whose sum is a multiple of 3. a(4) = 1: {1,2,4,5}. - Alois P. Heinz, Feb 06 2017
It appears that a(n) is the number of roots of the Fibonacci polynomial F(n+2,x) strictly inside the unit circle of the complex plane. - Michel Lagneau, Apr 07 2017
For the proof of the preceding conjecture see my comments under A008615 and A049310. Chebyshev S(n,x) = i^n*F(n+1,-i*x), with i = sqrt(-1). - Wolfdieter Lang, May 06 2017
The sequence is the interleaving of three sequences: the positive integers (A000027), the nonnegative integers (A001477), and the positive integers, in that order. - Guenther Schrack, Nov 07 2020
a(n) is the number of multiples of 3 between n and 2n. - Christian Barrientos, Dec 20 2021
a(n) is the least number of football games a team has to play to be able to get n-1 points, where a win is 3 points, a draw is 1 point, and a loss is 0 points. - Sigurd Kittilsen, Dec 01 2022

Examples

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

References

  • D. J. Benson, Polynomial Invariants of Finite Groups, Cambridge, 1993, p. 103.

Crossrefs

Programs

  • Haskell
    a008611 n = n' + mod r 2 where (n', r) = divMod (n + 1) 3
    a008611_list = f [1,0,1] where f xs = xs ++ f (map (+ 1) xs)
    -- Reinhard Zumkeller, Nov 25 2013
    
  • Magma
    [(n-1)-2*Floor((n-1)/3): n in [0..90]]; // Vincenzo Librandi, Aug 21 2011
    
  • Maple
    with(numtheory): for n from 1 to 70 do:it:=0:
    y:=[fsolve(x^n+x+1, x, complex)] : for m from 1 to nops(y) do : if abs(y[m])< 1 then it:=it+1:else fi:od: printf(`%d, `,it):od:
    A008611:=n->(n-1)-2*floor((n-1)/3); seq(A008611(n), n=0..50); # Wesley Ivan Hurt, May 18 2014
  • Mathematica
    With[{nn=30},Riffle[Riffle[Range[nn],Range[0,nn-1]],Range[nn],3]] (* or *) RecurrenceTable[{a[0]==a[2]==1,a[1]==0,a[n]==a[n-3]+1},a,{n,90}] (* Harvey P. Dale, Nov 06 2011 *)
    LinearRecurrence[{1, 0, 1, -1}, {1, 0, 1, 2}, 100] (* Vladimir Joseph Stephan Orlovsky, Feb 23 2012 *)
    a[ n_] := Quotient[n - 1, 3] + Mod[n + 2, 3]; (* Michael Somos, Jan 23 2014 *)
  • PARI
    {a(n) = (n-1) \ 3 + (n+2) % 3}; /* Michael Somos, Jan 23 2014 */

Formula

a(n) = a(n-3) + 1.
a(n) = (n-1) - 2*floor((n-1)/3).
G.f.: (1 + x^2 + x^4)/(1 - x^3)^2.
After the initial term, has form {n, n+1, n+2} for n=0, 1, 2, ...
From Paul Barry, Mar 18 2004: (Start)
a(n) = Sum_{k=0..n} (-1)^floor(2*(k-2)/3);
a(n) = 4*sqrt(3)*cos(2*Pi*n/3 + Pi/6)/9 + (n+1)/3. (End)
From Paul Barry, Oct 15 2004: (Start)
G.f.: (1 - x + x^2)/((1 + x + x^2)*(x-1)^2);
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)*A078008(n-2k)*(-1)^k. (End)
a(n) = -a(-2-n) for all n in Z.
Euler transform of length 6 sequence [0, 1, 2, 0, 0, -1]. - Michael Somos, Jan 23 2014
a(n) = ((n-1) mod 3) + floor((n-1)/3). - Wesley Ivan Hurt, May 18 2014
PSUM transform of A257075. - Michael Somos, Apr 15 2015
a(n) = A194960(n-3), n >= 0, with extended A194960. See the a(n) formula two lines above. - Wolfdieter Lang, May 06 2017
From Guenther Schrack, Nov 07 2020: (Start)
a(n) = (3*n + 3 + 2*(w^(2*n)*(1 - w) + w^n*(2 + w)))/9, where w = (-1 + sqrt(-3))/2, a primitive third root of unity;
a(n) = (n + 1 + 2*A049347(n))/3;
a(n) = (2*n - A330396(n-1))/3. (End)
E.g.f.: (3*exp(x)*(1 + x) + exp(-x/2)*(6*cos(sqrt(3)*x/2) - 2*sqrt(3)*sin(sqrt(3)*x/2)))/9. - Stefano Spezia, May 06 2022
Sum_{n>=2} (-1)^n/a(n) = 3*log(2) - 1. - Amiram Eldar, Sep 10 2023

A194960 a(n) = floor((n+2)/3) + ((n-1) mod 3).

Original entry on oeis.org

1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8, 7, 8, 9, 8, 9, 10, 9, 10, 11, 10, 11, 12, 11, 12, 13, 12, 13, 14, 13, 14, 15, 14, 15, 16, 15, 16, 17, 16, 17, 18, 17, 18, 19, 18, 19, 20, 19, 20, 21, 20, 21, 22, 21, 22, 23, 22, 23, 24, 23, 24, 25, 24, 25, 26, 25, 26
Offset: 1

Views

Author

Clark Kimberling, Sep 06 2011

Keywords

Comments

The sequence is formed by concatenating triples of the form (n, n+1, n+2) for n>=1. See A194961 and A194962 for the associated fractalization and interspersion. The sequence can be obtained from A008611 by deleting its first four terms.
The sequence contains every positive integer n exactly min(n,3) times. - Wesley Ivan Hurt, Dec 17 2013

Crossrefs

Programs

  • Magma
    I:=[1,2,3,2]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..100]]; // Vincenzo Librandi, Dec 17 2013
    
  • Maple
    A194960:=n->floor((n+2)/3)+((n-1) mod 3); seq(A194960(n), n=1..100); # Wesley Ivan Hurt, Dec 17 2013
  • Mathematica
    (* First program *)
    p[n_]:= Floor[(n+2)/3] + Mod[n-1, 3]
    Table[p[n], {n, 1, 90}]  (* A194960 *)
    g[1] = {1}; g[n_]:= Insert[g[n-1], n, p[n]]
    f[1] = g[1]; f[n_]:= Join[f[n-1], g[n]]
    f[20]  (* A194961 *)
    row[n_]:= Position[f[30], n];
    u = TableForm[Table[row[n], {n, 1, 5}]]
    v[n_, k_]:= Part[row[n], k];
    w = Flatten[Table[v[k, n-k+1], {n, 1, 13}, {k, 1, n}]]  (* A194962 *)
    q[n_]:= Position[w, n];
    Flatten[Table[q[n], {n, 1, 80}]]  (* A194963 *)
    (* Other programs *)
    CoefficientList[Series[(1 +x +x^2 -2 x^3)/((1+x+x^2) (1-x)^2), {x, 0, 100}], x] (* Vincenzo Librandi, Dec 17 2013 *)
    Table[(n+4 -2*ChebyshevU[2*n+4, 1/2])/3, {n,80}] (* G. C. Greubel, Oct 23 2022 *)
  • PARI
    a(n)=(n+2)\3 + (n-1)%3 \\ Charles R Greathouse IV, Sep 02 2015
    
  • SageMath
    [(n+4 - 2*chebyshev_U(2*n+4, 1/2))/3 for n in (1..80)] # G. C. Greubel, Oct 23 2022

Formula

From R. J. Mathar, Sep 07 2011: (Start)
a(n) = ((-1)^n*A130772(n) + n + 4)/3.
G.f.: x*(1 + x + x^2 - 2*x^3)/((1+x+x^2)*(1-x)^2). (End)
a(n) = A006446(n)/floor(sqrt(A006446(n))). - Benoit Cloitre, Jan 15 2012
a(n) = a(n-1) + a(n-3) - a(n-4). - Vincenzo Librandi, Dec 17 2013
a(n) = a(n-3) + 1, n >= 1, with input a(-2) = 0, a(-1) = 1 and a(0) = 2. Proof trivial. a(n) = A008611(n+3), n >= -2. See the first comment above. - Wolfdieter Lang, May 06 2017
From Guenther Schrack, Nov 09 2020: (Start)
a(n) = n - 2*floor((n-1)/3).
a(n) = (n + 2 + 2*((n-1) mod 3))/3.
a(n) = (3*n + 12 + 2*(w^(2*n)*(1 - w) + w^n*(2 + w)))/9, where w = (-1 + sqrt(-3))/2.
a(n) = (n + 4 + 2*A049347(n))/3.
a(n) = (2*n + 3 - A330396(n-1))/3. (End)
a(n) = (n + 4 - 2*A010892(2*n+4))/3. - G. C. Greubel, Oct 23 2022

A047878 a(n) is the least number of knight's moves from corner (0,0) to n-th diagonal of unbounded chessboard.

Original entry on oeis.org

0, 3, 2, 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8, 7, 8, 9, 8, 9, 10, 9, 10, 11, 10, 11, 12, 11, 12, 13, 12, 13, 14, 13, 14, 15, 14, 15, 16, 15, 16, 17, 16, 17, 18, 17, 18, 19, 18, 19, 20, 19, 20, 21, 20, 21, 22, 21, 22, 23, 22, 23, 24, 23, 24, 25
Offset: 0

Views

Author

Keywords

Comments

Apart from initial terms, same as A008611. - Anton Chupin, Oct 24 2009

Crossrefs

Programs

  • Magma
    I:=[2, 1, 2, 3]; [0,3] cat [n le 4 select I[n] else Self(n-1) +Self(n-3) -Self(n-4): n in [1..81]]; // G. C. Greubel, Oct 22 2022
    
  • Mathematica
    LinearRecurrence[{1,0,1,-1},{0,3,2,1,2,3},80] (* Harvey P. Dale, Sep 01 2018 *)
    Join[{0,3}, Table[(n+2 -2*ChebyshevU[2*n, 1/2])/3, {n,2,75}]] (* G. C. Greubel, Oct 22 2022 *)
  • PARI
    concat(0, Vec(x*(2*x^4-2*x^3-x^2-x+3)/((x-1)^2*(x^2+x+1)) + O(x^100))) \\ Colin Barker, May 04 2014
    
  • SageMath
    (Sage) [0,3]+[(n+2 - 2*chebyshev_U(2*n, 1/2))/3 for n in (2..75)] # G. C. Greubel, Oct 22 2022

Formula

a(n) = Min_{i=0..n} A049604(i,n-i).
a(3n) = n, a(3n+1) = n+1, a(3n+2) = n+2 for n >= 1.
From Colin Barker, May 04 2014: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>5.
G.f.: x*(3-x-x^2-2*x^3+2*x^4) / ((1-x)^2*(1+x+x^2)). (End)
From Guenther Schrack, Nov 19 2020: (Start)
a(n) = a(n-3) + 1, for n > 4 with a(0) = 0, a(1) = 3, a(2) = 2, a(3) = 1, a(4) = 2;
a(n) = (3*n + 6 - 2*(w^(2*n)*(2 + w) + w^n*(1 - w)))/9, for n > 1 with a(0) = 0, a(1) = 3, where w = (-1 + sqrt(-3))/2, a primitive third root of unity;
a(n) = (n + 2 - 2*A057078(n))/3 for n > 1;
a(n) = A194960(n-2) for n > 2;
a(n) = (2*n + 2 - A330396(n))/3 for n > 1. (End)

A210635 Array read by descending antidiagonals: a(n,w) = ((w - (n mod w) - 1) + n) - (n mod w), n >= 0, w >= 1.

Original entry on oeis.org

0, 1, 1, 2, 0, 2, 3, 1, 3, 3, 4, 2, 0, 2, 4, 5, 3, 1, 5, 5, 5, 6, 4, 2, 0, 4, 4, 6, 7, 5, 3, 1, 7, 3, 7, 7, 8, 6, 4, 2, 0, 6, 8, 6, 8, 9, 7, 5, 3, 1, 9, 5, 7, 9, 9, 10, 8, 6, 4, 2, 0, 8, 4, 6, 8, 10, 11, 9, 7, 5, 3, 1, 11, 7, 11, 11, 11, 11, 12, 10, 8, 6, 4, 2, 0, 10, 6, 10, 10, 10, 12
Offset: 0

Views

Author

Lucas Beristayn, Mar 25 2012

Keywords

Comments

Each column is a permutation of the nonnegative integers.
Column w can be used to mirror horizontally an infinite rectangular image of width w stored in a array of pixels. The pixels in the first row of the image are numbered from 0 to w-1 and subsequent rows continue the numbering likewise.

Examples

			The transposed array begins:
  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 ...
  1  0  3  2  5  4  7  6  9  8 11 10 13 12 15 14 17 16 19 18 ...
  2  1  0  5  4  3  8  7  6 11 10  9 14 13 12 17 16 15 20 19 ...
  3  2  1  0  7  6  5  4 11 10  9  8 15 14 13 12 19 18 17 16 ...
  4  3  2  1  0  9  8  7  6  5 14 13 12 11 10 19 18 17 16 15 ...
  5  4  3  2  1  0 11 10  9  8  7  6 17 16 15 14 13 12 23 22 ...
  6  5  4  3  2  1  0 13 12 11 10  9  8  7 20 19 18 17 16 15 ...
  7  6  5  4  3  2  1  0 15 14 13 12 11 10  9  8 23 22 21 20 ...
  8  7  6  5  4  3  2  1  0 17 16 15 14 13 12 11 10  9 26 25 ...
  9  8  7  6  5  4  3  2  1  0 19 18 17 16 15 14 13 12 11 10 ......
		

Crossrefs

Column 2: A004442, column 3: A330396, column 4: A004444, column 8: A004448.

Programs

  • Maple
    a:= (n,w) ->  ((w - (n mod w) - 1) + n) - (n mod w):
    seq(seq(a(n,1+d-n), n=0..d), d=0..12);  # Alois P. Heinz, Jun 07 2023
  • PARI
    a(n,w) = ((w - n % w - 1) + n) - n % w;
    matrix(7, 7, n, k, a(k-1, n)) \\ Michel Marcus, Jun 07 2023

Formula

a(n,w) = ((w - (n mod w) - 1) + n) - (n mod w).

Extensions

Edited by N. J. A. Sloane, Mar 26 2012
Entry revised by Editors of the OEIS, Jun 17 2023
Showing 1-4 of 4 results.