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.

A278907 a(n) = floor((n*2^(n+1)+2)/(2*n-(-1)^n+3)) - floor((n*2^(n+1)-2)/(2*n-(-1)^n+3)).

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Nov 30 2016

Keywords

Comments

If a(n) = b(n) - c(n), then
b(n) = 1, 1, 3, 5, 13, 23, 55, 99, 227, 419, 931, 1733, 3781, 7099, 15291, 28913, 61681, 117275, 248347, 474355, 998643, 1914791, 4011943, 7717519, 16106127, 31068918, 64623350, 124961333, 259179061, 502234079, 1039104991, ...
c(n) = -1, 0, 2, 4, 12, 22, 54, 99, 227, 418, 930, 1732, 3780, 7099, 15291, 28912, 61680, 117274, 248346, 474355, 998643, 1914790, 4011942, 7717519, 16106127, 31068918, 64623350, 124961332, 259179060, 502234078, 1039104990, ...

Examples

			a(0) = b(0) - c(0) = 1 - (-1) = 2,
a(1) = b(1) - c(1) = 1 - 0 = 1,
a(2) = b(2) - c(2) = 3 - 2 = 1.
		

Crossrefs

Cf. A002064 (Cullen numbers).

Programs

  • Magma
    [((n*2^(n+1)+2) div (2*n-(-1)^n+3))-((n*2^(n+1)-2) div (2*n-(-1)^n+3)): n in [0..100]];
    
  • Mathematica
    a[n_] := Floor[(n*2^(n + 1) + 2)/(2*n - (-1)^n + 3)] - Floor[(n*2^(n + 1) - 2)/(2*n - (-1)^n + 3)]; Table[a[n], {n, 1, 50}] (* G. C. Greubel, Apr 20 2017 *)
  • PARI
    for(n=0,50, print1(floor((n*2^(n+1)+2)/(2*n-(-1)^n+3)) - floor((n*2^(n+1)-2)/(2*n-(-1)^n+3)), ", ")) \\ G. C. Greubel, Apr 20 2017

Extensions

Definition corrected by R. J. Mathar, Dec 02 2016