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.

A143097 3*k - 2 interleaved with 3*k - 1 and 3*k.

Original entry on oeis.org

1, 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, 66
Offset: 1

Views

Author

Gary W. Adamson, Jul 24 2008

Keywords

Comments

First differences give A143098.
Binomial transform = A143099: (1, 3, 9, 22, 50, 113, 256, ...).

Examples

			Interleave 3 subsets:
  1,....4,.......7,......10,......13,......16,...
  ...2,.......5,.......8,......11,......14,...
  .........3,.......6,.......9,......12,...
  ...
		

Crossrefs

Cf. A083220 (n + (n mod 4)). - Zak Seidov, Feb 23 2017

Programs

  • Maple
    A143097 := proc(n) if(n<=1)then return n: elif(n mod 3 <= 1)then return n+1-2*(n mod 3): else return n: fi: end: seq(A143097(n), n=1..70); # Nathaniel Johnston, Apr 30 2011
  • Mathematica
    With[{nn=70},Join[{1},Riffle[Rest[Select[Range[nn],!Divisible[#,3]&]], Range[ 3,nn,3],3]]] (* Harvey P. Dale, May 06 2012 *)
    Table[If[k == 1, 1, k - 1 + Mod[k - 1, 3]], {k, 100}] (* Zak Seidov, Feb 23 2017 *)

Formula

A permutation of the natural numbers: 3*k - 2 interleaved with 3*k - 1 and 3*k; k=1,2,3,...; given a(1) = 1. a(n) = n if the subset = 3*k - 1: (2, 5, 8, ...); a(n) = n+1 in 3*k - 2, k>1: (4, 7, 10, ...); and a(n) = (n-1) in 3*k: (3, 6, 9, ...).
G.f.: x(1+x+2x^2-2x^3+x^4)/((1-x)^2(1+x+x^2)). - R. J. Mathar, Sep 06 2008
a(n) = if(n==1, 1, (n-1) + (n-1) mod 3). - Zak Seidov, Feb 23 2017
For n>1, a(n) = n+2*sin(2*(n+1)*Pi/3)/sqrt(3). - Wesley Ivan Hurt, Sep 27 2017
Sum_{n>=1} (-1)^(n+1)/a(n) = 2 - 2*Pi/(3*sqrt(3)) - log(2)/3. - Amiram Eldar, Aug 21 2023

A083219 a(n) = n - 2*floor(n/4).

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13, 12, 13, 14, 15, 14, 15, 16, 17, 16, 17, 18, 19, 18, 19, 20, 21, 20, 21, 22, 23, 22, 23, 24, 25, 24, 25, 26, 27, 26, 27, 28, 29, 28, 29, 30, 31, 30, 31, 32, 33, 32, 33, 34, 35, 34, 35, 36, 37, 36, 37, 38
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 22 2003

Keywords

Comments

Conjecture: number of roots of P(x) = x^n - x^(n-1) - x^(n-2) - ... - x - 1 in the left half-plane. - Michel Lagneau, Apr 09 2013
a(n) is n+2 with its second least significant bit removed (see A021913(n+2) for that bit). - Kevin Ryde, Dec 13 2019

Crossrefs

Cf. A083220, A129756, A162751 (second highest bit removed).
Essentially the same as A018837.

Programs

Formula

a(n) = A083220(n)/2.
a(n) = a(n-1) + n mod 2 + (n mod 4 - 1)*(1 - n mod 2), a(0) = 0.
G.f.: x*(1+x+x^2-x^3)/((1-x)^2*(1+x)*(1+x^2)). - R. J. Mathar, Aug 28 2008
a(n) = n - A129756(n). - Michel Lagneau, Apr 09 2013
Bisection: a(2*k) = 2*floor((n+2)/4), a(2*k+1) = a(2*k) + 1, k >= 0. - Wolfdieter Lang, May 08 2017
a(n) = (2*n + 3 - 2*cos(n*Pi/2) - cos(n*Pi) - 2*sin(n*Pi/2))/4. - Wesley Ivan Hurt, Oct 02 2017
a(n) = A162330(n+2) - 1 = A285869(n+3) - 1. - Kevin Ryde, Dec 13 2019
E.g.f.: ((1 + x)*cosh(x) - cos(x) + (2 + x)*sinh(x) - sin(x))/2. - Stefano Spezia, May 27 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = 2*log(2) - 1. - Amiram Eldar, Aug 21 2023

A212831 a(4*n) = 2*n, a(2*n+1) = 2*n+1, a(4*n+2) = 2*n+2.

Original entry on oeis.org

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

Views

Author

Paul Curtz, Aug 14 2012

Keywords

Comments

First differences: (1, 1, 1, -1, 3, -1, 3, -3, 5,...) = (1, A186422).
Second differences: (0, 0, -2, 4, -4, 4, -6, 8, ...) = (-1)^(n+1) * A201629(n).
Interleave the terms with even indices of the companion A215495 and this one to get (A215495(0), A212831(0), A215495(2), A212831(2),...) = (1, 0, 1, 2, 3, 2, 3, 4, 5, 4,...) = A106249, up to the initial term = A083219 = A083220/2.

Crossrefs

Programs

  • Magma
    [(1/4)*((1 +(-1)^n)*(1 - (-1)^Floor(n/2)) + (3 -(-1)^n)*n): n in [0..50]]; // G. C. Greubel, Apr 25 2018
  • Mathematica
    a[n_] := (1/4)*((-(1 + (-1)^n))*(-1 + (-1)^Floor[n/2]) - (-3 + (-1)^n)*n ); Table[a[n], {n, 0, 84}] (* Jean-François Alcover, Sep 18 2012 *)
    LinearRecurrence[{0,1,0,1,0,-1},{0,1,2,3,2,5},80] (* Harvey P. Dale, May 29 2016 *)
  • PARI
    A212831(n)=if(bittest(n,0), n, n\2+bittest(n,1)) \\ M. F. Hasler, Oct 21 2012
    
  • PARI
    for(n=0,50, print1((1/4)*((1 +(-1)^n)*(1 - (-1)^floor(n/2)) + (3 -(-1)^n)*n), ", ")) \\ G. C. Greubel, Apr 25 2018
    

Formula

a(n) + A215495(n) = A043547(n).
a(n) = -A214283(n)/A000108([n/2]).
a(n+1) = (A186421(n)=0,1,2,1,4,...) + 1.
a(2*n) = A052928(n+1).
a(n+2) - a(n) = 2, 2, 0, 2. (period 4).
a(n) = a(n-2) +a(n-4) -a(n-6); also holds for A215495(n).
G.f.: x*(1+2*x+2*x^2+x^4) / ( (x^2+1)*(x-1)^2*(1+x)^2 ). - R. J. Mathar, Aug 21 2012
a(n) = (1/4)*((1 +(-1)^n)*(1 - (-1)^floor(n/2)) + (3 -(-1)^n)*n). - G. C. Greubel, Apr 25 2018

Extensions

Corrected and edited by M. F. Hasler, Oct 21 2012

A267573 a(n) = prime(n) + (prime(n) mod 4).

Original entry on oeis.org

4, 6, 6, 10, 14, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 62, 62, 70, 74, 74, 82, 86, 90, 98, 102, 106, 110, 110, 114, 130, 134, 138, 142, 150, 154, 158, 166, 170, 174, 182, 182, 194, 194, 198, 202, 214, 226, 230, 230, 234, 242, 242, 254, 258, 266, 270
Offset: 1

Views

Author

Emre APARI, Jan 17 2016

Keywords

Comments

The primes corresponding to the cases where a(n) = a(n+1) can be found in A071698. - Michel Marcus, Jan 17 2016

Examples

			p=19; 19 + (19 modulo 4) = 22.
		

Crossrefs

Programs

  • Magma
    [NthPrime(n)+(NthPrime(n) mod 4): n in [1..100]]; // Vincenzo Librandi, Jan 17 2016
    
  • Maple
    A267573:=n->ithprime(n)+(ithprime(n) mod 4): seq(A267573(n), n=1..100); # Wesley Ivan Hurt, Jan 17 2016
  • Mathematica
    Table[Prime[n] + Mod[Prime[n], 4], {n, 60}] (* Vincenzo Librandi, Jan 17 2016 *)
    #+Mod[#,4]&/@Prime[Range[60]] (* Harvey P. Dale, Jun 12 2020 *)
  • PARI
    a(n) = prime(n) + (prime(n) % 4); \\ Michel Marcus, Jan 17 2016
    
  • PARI
    lista(nn) = forprime(p=2, nn, print1(p + p % 4, ", ")); \\ Altug Alkan, Jan 17 2016

Formula

a(n) = A000040(n) + A039702(n).
a(n) = A083220(prime(n)). - Michel Marcus, Jan 17 2016

Extensions

More terms from Vincenzo Librandi, Jan 17 2016

A282848 a(n) = 2*n + 1 + n mod 4.

Original entry on oeis.org

4, 7, 10, 9, 12, 15, 18, 17, 20, 23, 26, 25, 28, 31, 34, 33, 36, 39, 42, 41, 44, 47, 50, 49, 52, 55, 58, 57, 60, 63, 66, 65, 68, 71, 74, 73, 76, 79, 82, 81, 84, 87, 90, 89, 92, 95, 98, 97, 100, 103, 106, 105, 108, 111, 114, 113, 116, 119, 122, 121, 124, 127
Offset: 1

Views

Author

Zak Seidov, Feb 23 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[2*k + 1 + Mod[k, 4], {k, 100}]
    CoefficientList[ Series[(4 + 3 x + 3 x^2 - x^3 - x^4)/((x -1)^2 (1 + x + x^2 + x^3)), {x, 0, 60}], x] (* or *)
    LinearRecurrence[{1, 0, 0, 1, -1}, {4, 7, 10, 9, 12}, 70] (* Robert G. Wilson v, Feb 23 2017 *)
  • PARI
    Vec(x*(4 + 3*x + 3*x^2 - x^3 - x^4) / ((1 - x)^2*(1 + x)*(1 + x^2)) + O(x^100)) \\ Colin Barker, Feb 23 2017

Formula

For n > 4 a(n) = a(n - 4) + 8.
G.f.: x*(4 + 3*x + 3*x^2 - x^3 - x^4) / ((1 - x)^2*(1 + x)*(1 + x^2)). - Colin Barker, Feb 23 2017
Showing 1-5 of 5 results.