The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A265888 a(n) = n + floor(n/4)*(-1)^(n mod 4). 4

%I #24 Jan 29 2023 23:00:58

%S 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,

%T 32,21,35,22,37,24,40,25,42,27,45,28,47,30,50,31,52,33,55,34,57,36,60,

%U 37,62,39,65,40,67,42,70,43,72,45,75,46,77,48,80,49,82,51,85,52,87

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

%C This sequence does not include the numbers of the type 3*A047202(n)+2.

%C a(n) = n + floor(n/4)*(-1)^(n mod 2). - _Chai Wah Wu_, Jan 29 2023

%H G. C. Greubel, <a href="/A265888/b265888.txt">Table of n, a(n) for n = 0..10000</a>

%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,0,1,0,-1).

%F G.f.: x*(1 + 2*x + 2*x^2 + 3*x^3)/((1 + x^2)*(1 - x^2)^2).

%F a(n) = a(n-2) + a(n-4) - a(n-6) for n>5.

%F a(n+1) + a(n) = A047624(n+1).

%F a(4*k+r) = (4+(-1)^r)*k + r mod 3, where r = 0..3.

%t Table[n + Floor[n/4] (-1)^Mod[n, 4], {n, 0, 70}]

%t LinearRecurrence[{0, 1, 0, 1, 0, -1}, {0, 1, 2, 3, 5, 4}, 80]

%o (Sage) [n+floor(n/4)*(-1)^mod(n, 4) for n in (0..70)]

%o (Magma) [n+Floor(n/4)*(-1)^(n mod 4): n in [0..70]];

%o (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

%o (Python)

%o def A265888(n): return n+(-(n>>2) if n&1 else n>>2) # _Chai Wah Wu_, Jan 29 2023

%Y Cf. A047202, A047624.

%Y Cf. A064455: n+floor(n/2)*(-1)^(n mod 2).

%Y Cf. A265667: n+floor(n/3)*(-1)^(n mod 3).

%Y Cf. A265734: n+floor(n/5)*(-1)^(n mod 5).

%K nonn,easy

%O 0,3

%A _Bruno Berselli_, Dec 18 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 4 08:21 EDT 2024. Contains 373092 sequences. (Running on oeis4.)