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

A109043 a(n) = lcm(n,2).

Original entry on oeis.org

0, 2, 2, 6, 4, 10, 6, 14, 8, 18, 10, 22, 12, 26, 14, 30, 16, 34, 18, 38, 20, 42, 22, 46, 24, 50, 26, 54, 28, 58, 30, 62, 32, 66, 34, 70, 36, 74, 38, 78, 40, 82, 42, 86, 44, 90, 46, 94, 48, 98, 50, 102, 52, 106, 54, 110, 56, 114, 58, 118, 60, 122, 62, 126, 64, 130, 66, 134
Offset: 0

Views

Author

Mitch Harris, Jun 18 2005

Keywords

Comments

Exponent of the dihedral group D(2n) = . - Arkadiusz Wesolowski, Sep 10 2013
Second column of table A210530. - Boris Putievskiy, Jan 29 2013
For n > 1, the basic period of A000166(k) (mod n) (Miska, 2016). - Amiram Eldar, Mar 03 2021

Crossrefs

Cf. A000166, A109042, A152749 (partial sums).
Cf. A066043 (essentially the same), A000034 (=a(n)/n), A026741 (=a(n)/2).

Programs

Formula

For n > 0: a(n) = A186421(n) + A186421(n+2).
a(n) = n*2 / gcd(n, 2).
a(n) = -(n*((-1)^n-3))/2. - Stephen Crowley, Feb 11 2007
From R. J. Mathar, Aug 20 2008: (Start)
a(n) = A066043(n), n > 1.
a(n) = 2*A026741(n).
G.f.: 2*x(1+x+x^2)/((1-x)^2*(1+x)^2). (End)
a(n) = n*A000034(n). - Paul Curtz, Mar 25 2011
E.g.f.: x*(2*cosh(x) + sinh(x)). - Stefano Spezia, May 09 2021
Sum_{k=1..n} a(k) ~ (3/4) * n^2. - Amiram Eldar, Nov 26 2022

A065423 Number of ordered length 2 compositions of n with at least one even summand.

Original entry on oeis.org

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

Views

Author

Len Smiley, Nov 23 2001

Keywords

Examples

			a(7) = 6 because we can write 7 = 1+6 = 2+5 = 3+4 = 4+3 = 5+2 = 6+1; a(8) = 3 because we can write 8 = 2+6 = 4+4 = 6+2.
		

Crossrefs

Cf. A026741, A097140 (first differences), A030451 (absolute first differences), A210530.

Programs

  • C
    int a(int n){n--;return n>>(n&1);} // Mia Boudreau, Aug 27 2025
  • Maple
    A065423 := proc(n)
        (3*n-4-(-1)^n*n)/4 ;
    end proc:
    seq(A065423(n),n=1..40) ; # R. J. Mathar, Jan 24 2022
  • Mathematica
    LinearRecurrence[{0,2,0,-1},{0,0,2,1},100] (* Harvey P. Dale, May 14 2014 *)
  • PARI
    a(n)=n-=2;if(n%2,n+1,n/2)
    

Formula

G.f.: x^3*(x+2)/(1-x^2)^2.
a(n) = floor((n-1)/2) + (n is odd)*floor((n-1)/2).
a(n+2) = Sum_{k=0..n} (gcd(n, k) mod 2). - Paul Barry, May 02 2005
a(n) = Sum_{i=1..n-1} (-1)^i (floor(i/2) + ((i+1) mod 2)). - Olivier Gérard, Jun 21 2007
a(n) = A210530(n,4)/2 for n>2. - Boris Putievskiy, Jan 29 2013
a(n) = (3*n-4-n*(-1)^n)/4. - Boris Putievskiy, Jan 29 2013, corrected Jan 24 2022
a(n) = A026741(n)-1. - Wesley Ivan Hurt, Jun 23 2013
a(n) = floor((n-1) / 2^mod(n-1,2)). - Mia Boudreau, Aug 27 2025
E.g.f.: 1 + (x - 1)*cosh(x) + (x - 2)*sinh(x)/2. - Stefano Spezia, Dec 17 2023

A114753 First column of A114751.

Original entry on oeis.org

1, 3, 3, 7, 5, 11, 7, 15, 9, 19, 11, 23, 13, 27, 15, 31, 17, 35, 19, 39, 21, 43, 23, 47, 25, 51, 27, 55, 29, 59, 31, 63, 33, 67, 35, 71, 37, 75, 39, 79, 41, 83, 43, 87, 45, 91, 47, 95, 49, 99, 51, 103, 53, 107, 55, 111, 57, 115, 59, 119, 61, 123, 63, 127, 65, 131, 67, 135, 69
Offset: 1

Views

Author

Amarnath Murthy, Nov 15 2005

Keywords

Comments

A114752, (1, 2, 5, 4, 9, 6, ...) + A114753 - (1,1,1,...) = 3n+1: (1, 4, 7, 10, 13, ...). - Gary W. Adamson, Sep 16 2007
First column of table A210530. - Boris Putievskiy, Jan 29 2013

Crossrefs

Programs

Formula

a(2n+1) = 2n+1, a(2n) = 4n-1.
a(n) = 2*a(n-2) - a(n-4). - Joerg Arndt, Apr 02 2011
Equals A133080 * [1,2,3,...]. - Gary W. Adamson, Sep 08 2007
G.f. x*(1+3*x+x^2+x^3) / ( (x-1)^2*(1+x)^2 ). - R. J. Mathar, Apr 04 2012
a(n) = (3*n-1-(n-1)*(-1)^(n-1))/2. - Boris Putievskiy, Jan 29 2013

Extensions

More terms from Joshua Zucker, May 05 2006

A066104 a(2n) = 2n, a(2n+1) = 4(n+1).

Original entry on oeis.org

0, 4, 2, 8, 4, 12, 6, 16, 8, 20, 10, 24, 12, 28, 14, 32, 16, 36, 18, 40, 20, 44, 22, 48, 24, 52, 26, 56, 28, 60, 30, 64, 32, 68, 34, 72, 36, 76, 38, 80, 40, 84, 42, 88, 44, 92, 46, 96, 48, 100, 50, 104, 52, 108, 54, 112, 56, 116, 58, 120, 60, 124, 62, 128, 64, 132, 66, 136
Offset: 0

Views

Author

George E. Antoniou, Dec 04 2001

Keywords

Comments

Fourth column of table A210530 for n>0. - Boris Putievskiy, Jan 29 2013

Crossrefs

Programs

  • Mathematica
    Table[(3*n+2-(n+2)*(-1)^n)/2, {n,0,50}] (* or *) LinearRecurrence[{0, 2, 0, -1}, {0, 4, 2, 8}, 50] (* G. C. Greubel, Dec 24 2016 *)
  • PARI
    { for (n=0, 1000, if(n%2, a=2*n + 2, a=n); write("b066104.txt", n, " ", a) ) } \\ Harry J. Smith, Nov 14 2009
    
  • PARI
    concat([0], Vec(2*x*(x+2)/(1-x^2)^2 + O(x^50))) \\ G. C. Greubel, Dec 24 2016

Formula

a(n) = 2*A065423(n+1).
O.g.f.: 2*x(2+x)/(1-x^2)^2. - Len Smiley, Dec 06 2001
a(n) = (3*n+2-(n+2)*(-1)^n)/2. - Boris Putievskiy, Jan 29 2013

A114751 The following triangle contains n consecutive numbers beginning from n in ascending order if n is odd else in descending order. Sequence contains the triangle by rows.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Nov 15 2005

Keywords

Examples

			1
3 2
3 4 5
7 6 5 4
5 6 7 8 9
11 10 9 8 7 6
...
		

Crossrefs

Programs

  • Maple
    for n from 1 to 14 do if n mod 2 = 1 then print(seq(k,k=n..2*n-1)) else print(seq(2*n-k,k=1..n)) fi od; # yields sequence in triangular form # Emeric Deutsch, Jan 26 2006

Formula

a(n) = (3*t+2-t*(-1)^(t-1))/2-(1+(-1)^t)*(j-1)/2+(1-(-1)^t)*(j-1)/2, where j = (t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Jan 30 2013

Extensions

More terms from Emeric Deutsch, Jan 26 2006

A211161 Table T(n,k) = n, if k is odd, k/2 if k is even; n, k > 0, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Jan 30 2013

Keywords

Comments

In general, let B and C be sequences. By b(n) and c(n)denote elements B and C respectively. Table T(n,k) = b(n), if k is odd, c(k) if k is even. For this sequence b(n)=n, c(k)=k.
Row T(n,k) is b(n),c(1),b(n),c(2),b(n),c(3),...Numbers c(1),c(2),c(3),... sandwiched between b(n)'s. For this sequence numbers 1,2,3,... (A000027) sandwiched between n's.

Examples

			The start of the sequence as table for general case:
b(1)..c(1)..b(1)..c(2)..b(1)..c(3)..b(1)..c(4)...
b(2)..c(1)..b(2)..c(2)..b(2)..c(3)..b(2)..c(4)...
b(3)..c(1)..b(3)..c(2)..b(3)..c(3)..b(3)..c(4)...
b(4)..c(1)..b(4)..c(2)..b(4)..c(3)..b(4)..c(4)...
b(5)..c(1)..b(5)..c(2)..b(5)..c(3)..b(5)..c(4)...
b(6)..c(1)..b(6)..c(2)..b(6)..c(3)..b(6)..c(4)...
b(7)..c(1)..b(7)..c(2)..b(7)..c(3)..b(7)..c(4)...
b(8)..c(1)..b(8)..c(2)..b(8)..c(3)..b(8)..c(4)...
. . .
The start of the sequence as triangle array read by rows for general case:
b(1);
c(1),b(2);
b(1),c(1),b(3);
c(2),b(2),c(1),b(4);
b(1),c(2),b(3),c(1),b(5);
c(3),b(2),c(2),b(4),c(1),b(6);
b(1),c(3),b(3),c(2),b(5),c(1),b(7);
c(4),b(2),c(3),b(4),c(2),b(6),c(1),b(8);
. . .
Row number r contains r numbers.
If r is odd  b(1),c((r-1)/2),b(3),c((r-1)/2-1),b(5),c((r-1)/2-2),...c(1),b(r).
If r is even c(r/2),b(2),c(r/2-1),b(4),c(r/2-2),b(6),...c(1),b(r).
The start of the sequence as table for b(n)=n and c(k)=k:
1..1..1..2..1..3..1..4...
2..1..2..2..2..3..2..4...
3..1..3..2..3..3..3..4...
4..1..4..2..4..3..4..4...
5..1..5..2..5..3..5..4...
6..1..6..2..6..3..6..4...
7..1..7..2..7..3..7..4...
8..1..8..2..8..3..8..4...
. . .
The start of the sequence as triangle array read by rows for b(n)=n and c(k)=k:
1;
1,2;
1,1,3;
2,2,1,4;
1,2,3,1,5;
3,2,2,4,1,6;
1,3,3,2,5,1,7;
4,2,3,4,2,6,1,8;
. . .
Row number r contains r numbers.
If r is odd  1,(r-1)/2,3,(r-1)/2-1,5,(r-1)/2-2,...1,r.
If r id even r/2,2,r/2-1,4,r/2-1,6,...1,r.
		

Crossrefs

Programs

  • Python
    def a(n):
        t=int((math.sqrt(8*n-7) - 1)/ 2)
        i=n-t*(t+1)//2
        j=(t*t+3*t+4)//2-n
        return (1+(-1)**j)*j//4 - (-1+(-1)**j)*i//2

Formula

For the general case
As table T(n,k) = (1+(-1)^k)*c(k/2)/2 - (-1+(-1)^k)*b(n)/2.
As linear sequence
a(n) = (1+(-1)^j)*c(j/2)/2 - (-1+(-1)^j)*b(i)/2, where i = n-t*(t+1)/2, j = (t*t+3*t+4)/2-n, t = floor((-1+sqrt(8*n-7))/2).
For b(n) = n and c(k) = k:
As table T(n,k) = (1+(-1)^k)*k/4 - (-1+(-1)^k)*n/2.
As linear sequence a(n) = (1+(-1)^A004736(n))*A004736(n)/4 - (-1+(-1)^A004736(n))*A002260(n)/2. a(n) = (1+(-1)^j)*j/4 - (-1+(-1)^j)*i/2,
where i = n-t*(t+1)/2, j = (t*t+3*t+4)/2-n, t = floor((-1+sqrt(8*n-7))/2).

A204904 p(n)-q(n), where (p(n), q(n)) is the least pair of odd primes for which n divides p(n)-q(n).

Original entry on oeis.org

2, 2, 6, 4, 10, 6, 14, 8, 18, 10, 22, 12, 26, 14, 30, 16, 34, 18, 38, 20, 42, 22, 46, 24, 50, 26, 54, 28, 58, 30, 62, 32, 66, 34, 70, 36, 74, 38, 78, 40, 82, 42, 86, 44, 90, 46, 94, 48, 98, 50, 102, 52, 106, 54, 110, 56, 114, 58, 118, 60, 122, 62, 126, 64, 130
Offset: 1

Views

Author

Clark Kimberling, Jan 20 2012

Keywords

Comments

This sequence agrees with A109043 for 0
For a guide to related sequences, see A204892.
Sequence agrees with A109043 at least up to 6400. - Michel Marcus, Mar 14 2018
If Polignac's conjecture is true, then this is a duplicate of A109043. - Robert Israel, Mar 14 2018

Examples

			1 = (5-3)/2=(7-3)/4=(13-3)/6=(11-3)/8=...
2 = (5-3)/1=(11-5)/3=(7-3)/5=(17-3)/7=...
		

Crossrefs

Programs

  • Mathematica
    (See the program at A204900.)
  • PARI
    a(n) = {forprime(p=5,,forprime(q=3, p-1, d = p-q; if ((d % n) == 0, return (d));););} \\ Michel Marcus, Mar 14 2018

A211197 Table T(n,k) = 2*n + ((-1)^n)*(1/2 - (k-1) mod 2) - 1/2; n, k > 0, read by antidiagonals.

Original entry on oeis.org

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

Author

Boris Putievskiy, Feb 03 2013

Keywords

Comments

In general, let B and C be sequences. By b(n) and c(n) denote elements B and C respectively. Table T(n,k) = (1-(-1)^k)*b(n)/2+(1+(-1)^k)*c(n)/2 read by antidiagonals.
For this sequence b(n)=2*n-1, b(n)=A005408(n), c(n)=2*n, c(n)=A005843(n).
If n is odd row T(n,k) is alternation b(n) and c(n) starts from b(n).
If n is even row T(n,k) is alternation c(n) and b(n) starts from c(n).
For this sequence if n is odd alternation numbers 2*n-1 and 2*n starts from 2*n-1.
For this sequence if n is even alternation numbers 2*n and 2*n-1 starts from 2*n.
T(n,k) is replication of the first and the second columns that are “a braid” from sequences B and C.

Examples

			The start of the sequence as table for general case:
  b(1)..c(1)..b(1)..c(1)..b(1)..c(1)..b(1)..c(1)..
  c(2)..b(2)..c(2)..b(2)..c(2)..b(2)..c(2)..b(2)..
  b(3)..c(3)..b(3)..c(3)..b(3)..c(3)..b(3)..c(3)..
  c(4)..b(4)..c(4)..b(4)..c(4)..b(4)..c(4)..b(4)..
  b(5)..c(5)..b(5)..c(5)..b(5)..c(5)..b(5)..c(5)..
  c(6)..b(6)..c(6)..b(6)..c(6)..b(6)..c(6)..b(6)..
  b(7)..c(7)..b(7)..c(7)..b(7)..c(7)..b(7)..c(7)..
  c(8)..b(8)..c(8)..b(8)..c(8)..b(8)..c(8)..b(8)..
  . . .
The start of the sequence as triangle array read by rows for general case:
  b(1);
  c(1),c(2);
  b(1),b(2),b(3);
  c(1),c(2),c(3),c(4);
  b(1),b(2),b(3),b(4),b(5);
  c(1),c(2),c(3),c(4),c(5),c(6);
  b(1),b(2),b(3),b(4),b(5),b(6),b(7);
  c(1),c(2),c(3),c(4),c(5),c(6),c(7),c(8);
. . .
Row number r contains r numbers.
If r is odd  b(1),b(2),...,b(r).
If r is even c(1),c(2),...,c(r).
The start of the sequence as table for b(n)=2*n-1 and c(n)=2*n:
  1....2...1...2...1...2...1...2...
  4....3...4...3...4...3...4...3...
  5....6...5...6...5...6...5...6...
  8....7...8...7...8...7...8...7...
  9...10...9..10...9..10...9..10...
  12..11..12..11..12..11..12..11...
  13..14..13..14..13..14..13..14...
  16..15..16..15..16..15..16..15...
  . . .
The start of the sequence as triangle array read by rows for  b(n)=2*n-1 and c(n)=2*n:
  1;
  2,4;
  1,3,5;
  2,4,6,8;
  1,3,5,7,9;
  2,4,6,8,10,12;
  1,3,5,7,9,11,13;
  2,4,6,8,10,12,14,16;
  . . .
Row number r contains r numbers.
If r is odd  1,3,...2*r-1 - coincides with the elements row number r triangle array read by rows for sequence 2*A002260-1.
If r is even 2,4,...,2*r  - coincides with the elements row number r triangle array read by rows for sequence 2*A002260.
		

Programs

  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result =2*i+((-1)**i)*(0.5 - (j-1) % 2) - 0.5
    
  • Python
    a211197_list = [2*n - k%2 for k in range(1, 13) for n in range(1, k+1)] # David Radcliffe, Jun 01 2025

Formula

For the general case:
As a table: T(n,k) = (1-(-1)^k)*b(n)/2+(1+(-1)^k)*c(n)/2.
As a linear sequence: a(n) = (1-(-1)^j)*b(i)/2+(1+(-1)^j)*c(i)/2, where i = n-t*(t+1)/2, j = (t*t+3*t+4)/2-n, t = floor((-1+sqrt(8*n-7))/2).
where b(n) = 2*n-1 and c(n) = 2*n.
As a table: T(n,k) = 2*n+((-1)^n)*(1/2- (k-1) mod 2) - 1/2.
As a linear sequence:
a(n) = 2*A002260(n) + ((-1)^A002260(n))*(1/2- (A004736(n)-1) mod 2) -1/2.
a(n) = -(1+(-1)^A003056(n))*A002260(n) +(1+(-1)^A003056(n))*(2*A002260(n)-1)/2.
a(n) = 2*i+((-1)^i)*(1/2- (j-1) mod 2) - 1/2
a(n) = -(1+(-1)^t)*i +(1+(-1)^t)*(2*i-1)/2,
where i = n-t*(t+1)/2, j = (t*t+3*t+4)/2-n, t = floor((-1+sqrt(8*n-7))/2).
T(n, k) = 2*n - 1 + (n+k mod 2); a(n) = 2*A002260(n) - A057211(n). - David Radcliffe, Jun 01 2025
Showing 1-8 of 8 results.