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

A265667 Permutation of nonnegative integers: a(n) = n + floor(n/3)*(-1)^(n mod 3).

Original entry on oeis.org

0, 1, 2, 4, 3, 6, 8, 5, 10, 12, 7, 14, 16, 9, 18, 20, 11, 22, 24, 13, 26, 28, 15, 30, 32, 17, 34, 36, 19, 38, 40, 21, 42, 44, 23, 46, 48, 25, 50, 52, 27, 54, 56, 29, 58, 60, 31, 62, 64, 33, 66, 68, 35, 70, 72, 37, 74, 76, 39, 78, 80, 41, 82, 84, 43, 86, 88, 45
Offset: 0

Views

Author

Bruno Berselli, Dec 12 2015 - based on an idea by Paul Curtz

Keywords

Comments

The inverse permutation is given by P(n) = A006368(n-1) + 1, for n >= 1, and P(0) = 0. - Wolfdieter Lang, Sep 21 2021
This permutation is given by A006369(n-1) + 1, with A006369(-1) = -1. Observed by Kevin Ryde. - Wolfdieter Lang, Sep 22 2021

Examples

			-------------------------------------------------------------------------
0, 1, 2, 3,  4, 5, 6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, ...
+  +  +  +   +  +  +   +   +   +   +   +   +   +   +   +   +   +   +
0, 0, 0, 1, -1, 1, 2, -2,  2,  3, -3,  3,  4, -4,  4,  5, -5,  5,  6, ...
-------------------------------------------------------------------------
0, 1, 2, 4,  3, 6, 8,  5, 10, 12,  7, 14, 16,  9, 18, 20, 11, 22, 24, ...
-------------------------------------------------------------------------
		

Crossrefs

Cf. A064455: n+floor(n/2)*(-1)^(n mod 2).
Cf. A265888: n+floor(n/4)*(-1)^(n mod 4).
Cf. A265734: n+floor(n/5)*(-1)^(n mod 5).

Programs

  • Magma
    [n+Floor(n/3)*(-1)^(n mod 3): n in [0..70]];
  • Mathematica
    Table[n + Floor[n/3] (-1)^Mod[n, 3], {n, 0, 70}]
  • Sage
    [n+floor(n/3)*(-1)^mod(n,3) for n in (0..70)]
    

Formula

G.f.: x*(1 + 2*x + 4*x^2 + x^3 + 2*x^4) / ((1 - x)^2*(1 + x + x^2)^2).
a(n) = 2*a(n-3) - a(n-6).
a(3*k) = 4*k;
a(3*k+1) = 2*k+1, hence a(3*k+1) = a(3*k)/2 + 1;
a(3*k+2) = 4*k+2, hence a(3*k+2) = 2*a(3*k+1) = a(3*k) + 2.
Sum_{i=0..n} a(i) = A008738(A032793(n+1)).
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/8 + log(2)/4. - Amiram Eldar, Mar 30 2023

A265888 a(n) = n + floor(n/4)*(-1)^(n mod 4).

Original entry on oeis.org

0, 1, 2, 3, 5, 4, 7, 6, 10, 7, 12, 9, 15, 10, 17, 12, 20, 13, 22, 15, 25, 16, 27, 18, 30, 19, 32, 21, 35, 22, 37, 24, 40, 25, 42, 27, 45, 28, 47, 30, 50, 31, 52, 33, 55, 34, 57, 36, 60, 37, 62, 39, 65, 40, 67, 42, 70, 43, 72, 45, 75, 46, 77, 48, 80, 49, 82, 51, 85, 52, 87
Offset: 0

Views

Author

Bruno Berselli, Dec 18 2015

Keywords

Comments

This sequence does not include the numbers of the type 3*A047202(n)+2.
a(n) = n + floor(n/4)*(-1)^(n mod 2). - Chai Wah Wu, Jan 29 2023

Crossrefs

Cf. A064455: n+floor(n/2)*(-1)^(n mod 2).
Cf. A265667: n+floor(n/3)*(-1)^(n mod 3).
Cf. A265734: n+floor(n/5)*(-1)^(n mod 5).

Programs

  • Magma
    [n+Floor(n/4)*(-1)^(n mod 4): n in [0..70]];
    
  • Mathematica
    Table[n + Floor[n/4] (-1)^Mod[n, 4], {n, 0, 70}]
    LinearRecurrence[{0, 1, 0, 1, 0, -1}, {0, 1, 2, 3, 5, 4}, 80]
  • PARI
    x='x+O('x^100); concat(0, Vec(x*(1+2*x+2*x^2+3*x^3)/((1+x^2)*(1- x^2)^2))) \\ Altug Alkan, Dec 22 2015
    
  • Python
    def A265888(n): return n+(-(n>>2) if n&1 else n>>2) # Chai Wah Wu, Jan 29 2023
  • Sage
    [n+floor(n/4)*(-1)^mod(n, 4) for n in (0..70)]
    

Formula

G.f.: x*(1 + 2*x + 2*x^2 + 3*x^3)/((1 + x^2)*(1 - x^2)^2).
a(n) = a(n-2) + a(n-4) - a(n-6) for n>5.
a(n+1) + a(n) = A047624(n+1).
a(4*k+r) = (4+(-1)^r)*k + r mod 3, where r = 0..3.

A265672 a(n) = n + floor((n+1)/7)*(-1)^((n+1) mod 7).

Original entry on oeis.org

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

Views

Author

Paul Curtz, Dec 13 2015

Keywords

Comments

A permutation of A001477. This sequence, without the terms of the form 8*k+5, becomes A265228.
Similar sequences of the type n + floor((n+1)/k)*(-1)^((n+1) mod k):
k = 1: A005408;
k = 2: A014682;
k = 3: A006369 (permutation of A001477);
k = 4: 0, 1, 2, 4, 3, 6, 5, 9, 6, 11, 8, 14, ...;
k = 5: 0, 1, 2, 3, 5, 4, 7, 6, 9, 11, 8, 13, ... (permutation of A001477);
k = 6: 0, 1, 2, 3, 4, 6, 5, 8, 7, 10, 9, 13, ...;
k = 7: this sequence.

Examples

			-------------------------------------------------------------------------
0, 1, 2, 3, 4, 5, 6,  7, 8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, ...
+  +  +  +  +  +  +   +  +   +   +   +   +   +   +   +   +   +   +
0, 0, 0, 0, 0, 0, 1, -1, 1, -1,  1, -1,  1,  2, -2,  2, -2,  2, -2, ...
-------------------------------------------------------------------------
0, 1, 2, 3, 4, 5, 7,  6, 9,  8, 11, 10, 13, 15, 12, 17, 14, 19, 16, ...
-------------------------------------------------------------------------
		

Crossrefs

Programs

  • Magma
    [n+Floor((n+1)/7)*(-1)^((n+1) mod 7): n in [0..80]]; // Bruno Berselli, Dec 26 2015
  • Maple
    A265672:=n->n + floor((n+1)/7)*(-1)^((n+1) mod 7): seq(A265672(n), n=0..100); # Wesley Ivan Hurt, Apr 09 2017
  • Mathematica
    Table[n + Floor[(n + 1)/7] (-1)^Mod[n + 1, 7], {n, 0, 80}] (* Bruno Berselli, Dec 22 2015 *)
  • PARI
    concat(0, Vec(x*(1 +x^2)*(1 +2*x +2*x^2 +2*x^3 +3*x^4 +5*x^5 +3*x^6 +2*x^7 +x^8 +3*x^9 +x^10) / ((1 -x)^2*(1 +x +x^2 +x^3 +x^4 +x^5 +x^6)^2) + O(x^100))) \\ Colin Barker, Dec 13 2015
    

Formula

a(n) = a(n-7) + (-1)^((n+1) mod 7) + 7 for n>6.
From Colin Barker, Dec 13 2015: (Start)
a(n) = 2*a(n-7) - a(n-14) for n>13.
G.f.: x*(1 +x^2)*(1 +2*x +2*x^2 +2*x^3 +3*x^4 +5*x^5 +3*x^6 +2*x^7 +x^8 +3*x^9 +x^10) / ((1 -x)^2*(1 +x +x^2 +x^3 +x^4 +x^5 +x^6)^2). (End)

Extensions

Edited by Bruno Berselli, Dec 22 2015

A267654 Irregular triangle of palindromic subsequences. Every row has 2*n+1 terms. From the second row, there are only two alternated numbers: 2*n+4 and 2*n+2.

Original entry on oeis.org

2, 4, 2, 4, 6, 4, 6, 4, 6, 8, 6, 8, 6, 8, 6, 8, 10, 8, 10, 8, 10, 8, 10, 8, 10, 12, 10, 12, 10, 12, 10, 12, 10, 12, 10, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16
Offset: 0

Views

Author

Paul Curtz, Jan 19 2016

Keywords

Comments

Row sums = 2, 10, 26, 50, ... = A069894(n).
Starting from A053186(n) =
0, for b(n)
0, 1, 2, for c(n)
0, 1, 2, 3, 4, for d(n)
0, 1, 2, 3, 4, 5, 6,
etc,
a(n) is used for
1) b(n+1) = b(n) + (a(0)=2) i.e. 0, 2, 4, 6, ... = A005843(n).
2) c(n+3) = c(n) + (period 3:repeat 4, 2, 4) i.e. 0, 1, 2, 4, 3, 6, 8, ... = A265667(n).
3) d(n+5) = d(n) + (period 5:repeat 6, 4, 6, 4, 6) i.e. 0, 1, 2, 3, 4, 6, 5, 8, 7, 10, ... = A265734(n).
Etc.
a(n) has a companion with the same terms,differently distributed,yielding permutations of the nonnegative numbers. See A265672.
a(n) other writing (by pairs):
2, 4, 2, 4,
6, 4, 6, 4,
6, 8, 6, 8, 6, 8, 6, 8,
10 8, 10, 8, 10, 8, 10, 8,
10, 12, 10, 12, 10, 12, 10, 12, 10, 12, 10, 12,
14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12,
etc.
First column: A168276(n+2). Second column: A168273(n+2).
Row sums: 12, 20, 56, 72, ... = 4*A074378(n+1).
The last term of the successive rows is the number of their terms.
Main diagonal: A005843(n+1).

Examples

			The triangle is
2,
4, 2, 4,
6, 4, 6, 4, 6,
8, 6, 8, 6, 8, 6, 8,
etc.
		

Crossrefs

Programs

  • Mathematica
    Table[2 (n - 1) + 2 (Boole@ OddQ@ k + 1), {n, 0, 7}, {k, 2 n + 1}] // Flatten (* Michael De Vlieger, Jan 19 2016 *)

Formula

a(n) = 2 * A086520(n+2).
a(2n) = 4*n + 2 times 4*n + 2 = 2, 2, 6, 6, 6, 6, 6, 6, 10,....
a(2n+1) = 4*(n+1) times 4*(n+1) = 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 12, ....

A272188 Triangle with 2*n+1 terms per row, read by rows: the first row is 1 (by decree), following rows contain 0 to 2n+1 but omitting 2n.

Original entry on oeis.org

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

Views

Author

Paul Curtz, Apr 22 2016

Keywords

Comments

Row n is row 2n+1 of A128138, a bisection.
The second bisection by rows
0, 2,
0, 1, 2, 4,
0, 1, 2, 3, 4, 6,
0, 1, 2, 3, 4, 5, 6, 8,
etc
is the basis of
0, 2, 4, 6, 8, 10, 12, ... the even numbers A005843(n)
0, 1, 2, 4, 3, 6, 8, 5, 10, ... a permutation of the nonnegative integers A265667(n).
0, 1, 2, 3, 4, 6, 5, 8, 7, 10, 12, ... a permutation of the nonnegative integers A265734(n)
etc.
A005843(n) - A005843(n-1) = 2, for n>0.
A265667(n) - A265667(n-3) = 4, 2, 4 (period 3), for n>2.
A265734(n) - A265734(n-5) = 6, 4, 6, 4, 6 (period 5), for n>4.
See A267654.
For
1, 3, 5, 7, 9, 11, 13 ... the odd numbers A005408(n),
0, 1, 3, 2, 5, 7, 4, 9, 11, ... a permutation of the nonnegative numbers A006369,
0, 1, 2, 3, 5, 4, 7, 6, 9, 11, 8, 13, 10, 15, ... another permutation,
a(n) must be extended with one term by row:
1, 3,
0, 1, 3, 2,
0, 1, 2, 3, 5, 4,

Examples

			Irregular triangle:
1,
0, 1, 3,
0, 1, 2, 3, 5,
0, 1, 2, 3, 4, 5, 7,
0, 1, 2, 3, 4, 5, 6, 7, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13,
etc.
		

Crossrefs

Programs

  • Mathematica
    Table[Delete[Range[0, 2 n + 1], 2 n + 1], {n, 0, 8}] // Flatten (* Michael De Vlieger, Apr 25 2016 *)
Showing 1-5 of 5 results.