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.

A140081 Period 4: repeat [0, 1, 1, 2].

Original entry on oeis.org

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

Views

Author

Nadia Heninger and N. J. A. Sloane, Jun 03 2008

Keywords

Comments

Also fix e = 4; then a(n) = minimal Hamming distance between the binary representation of n and the binary representation of any multiple k*e (0 <= k <= n/e) which is a child of n.
A number m is a child of n if the binary representation of n has a 1 in every position where the binary representation of m has a 1.

Crossrefs

Cf. A140201. - Reinhard Zumkeller, Feb 21 2010

Programs

Formula

a(n) = 1 + a(n - 1 - a(n-1)) + 2*a(a(n-1)) - 2*a(n-1), a(0)=0. - Ramasamy Chandramouli, Jan 31 2010
a(n) = A047624(n+2) - A047624(n+1) - 1. - Reinhard Zumkeller, Feb 21 2010
a(n) = 1 - cos(Pi*n/2)/2 - sin(Pi*n/2)/2 - (-1)^n/2. - R. J. Mathar, Oct 08 2011
a(n) = ((n mod 4) + (n mod 2))/2. - Gary Detlefs, Apr 21 2012
From Colin Barker, Jan 13 2013: (Start)
a(n) = a(n-4).
G.f.: -x*(2*x^2+x+1) / ((x-1)*(x+1)*(x^2+1)). (End)
a(n) = floor((3*(n mod 4) + 1)/4). - Wesley Ivan Hurt, Mar 27 2014
From Wesley Ivan Hurt, Apr 22 2015: (Start)
a(n) = floor(1/2 + (n mod 4)/2).
a(n) = 1 - (-1)^n/2 - (-1)^(n/2 - 1/4 + (-1)^n/4)/2. (End)
a(n) = n - floor(n/2) - 2*floor(n/4). - Ridouane Oudra, Oct 30 2019

A140201 Partial sums of A140081.

Original entry on oeis.org

0, 1, 2, 4, 4, 5, 6, 8, 8, 9, 10, 12, 12, 13, 14, 16, 16, 17, 18, 20, 20, 21, 22, 24, 24, 25, 26, 28, 28, 29, 30, 32, 32, 33, 34, 36, 36, 37, 38, 40, 40, 41, 42, 44, 44, 45, 46, 48, 48, 49, 50, 52, 52, 53, 54, 56, 56, 57, 58, 60, 60, 61, 62, 64, 64, 65, 66, 68, 68, 69, 70, 72, 72, 73, 74
Offset: 0

Views

Author

Nadia Heninger and N. J. A. Sloane, Jun 09 2008

Keywords

Crossrefs

Programs

  • Magma
    I:=[0, 1, 2, 4, 4]; [n le 5 select I[n] else Self(n-1)+Self(n-4)-Self(n-5): n in [1..80]]; // Vincenzo Librandi, Sep 17 2012
  • Maple
    A140201:=n->(4*n+1-I^(2*n)+(-I)^(1+n)+I^(1+n))/4: seq(A140201(n), n=0..100); # Wesley Ivan Hurt, Jun 04 2016
  • Mathematica
    Accumulate[PadRight[{}, 68, {0, 1, 1, 2}]] (* Harvey P. Dale, Aug 19 2011 *)

Formula

a(n) = A047624(n+1) - A042948(A004526(n)). - Reinhard Zumkeller, Feb 21 2010
a(n) = A002265(n+1) + A057353(n+1). - Reinhard Zumkeller, Feb 26 2011
From Bruno Berselli, Jan 27 2011: (Start)
G.f.: x*(1+x+2*x^2)/((1+x)*(1+x^2)*(1-x)^2).
a(n) = a(n-1) + a(n-4) - a(n-5) for n>4.
a(n) = n + A121262(n+1). (End)
a(n) = n when n+1 is not a multiple of 4, and a(n) = n+1 when n+1 is a multiple of 4. - Dennis P. Walsh, Aug 06 2012
a(n) = A004524(n+1) + A004526(n+1). - Arkadiusz Wesolowski, Sep 17 2012
a(n) = (4*n+1-i^(2*n)+(-i)^(1+n)+i^(1+n))/4 where i=sqrt(-1). - Wesley Ivan Hurt, Jun 04 2016
a(n) = n+1-(sign((n+1) mod 4) mod 3). - Wesley Ivan Hurt, Sep 26 2017

A173562 a(n) = n^2 + floor(n/4).

Original entry on oeis.org

0, 1, 4, 9, 17, 26, 37, 50, 66, 83, 102, 123, 147, 172, 199, 228, 260, 293, 328, 365, 405, 446, 489, 534, 582, 631, 682, 735, 791, 848, 907, 968, 1032, 1097, 1164, 1233, 1305, 1378, 1453, 1530, 1610, 1691, 1774, 1859, 1947, 2036, 2127, 2220, 2316, 2413, 2512
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 21 2010

Keywords

Crossrefs

Programs

Formula

a(n) = A002378(n)-A057353(n) = A035608(n)-A002265(n+2) = A000290(n)+A002265(n);
a(n+1) - a(n) = A047624(n+2).
a(n) = floor((n + 1/8)^2).
a(n) = 2*a(n-1) - a(n-2) + a(n-4) - 2*a(n-5) + a(n-6) for n>5.
G.f.: x*(1+2*x+2*x^2+3*x^3)/((1+x)*(x^2+1)*(1-x)^3). - R. J. Mathar, Feb 27 2010
a(n) = (8*n^2+2*n-3+i^(2*n)+(1+i)*i^(-n)+(1-i)*i^n)/8 where i=sqrt(-1). - Wesley Ivan Hurt, Jun 04 2016

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.
Showing 1-4 of 4 results.