login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(2n+6) = a(2n) + 12*n + 20, a(2n+1) = (n+1)*(2*n+1), with a(0)=0, a(2)=2, a(4)=9.
5

%I #51 Sep 08 2022 08:46:13

%S 0,1,2,6,9,15,20,28,34,45,53,66,76,91,102,120,133,153,168,190,206,231,

%T 249,276,296,325,346,378,401,435,460,496,522,561,589,630,660,703,734,

%U 780,813,861,896,946,982,1035,1073

%N a(2n+6) = a(2n) + 12*n + 20, a(2n+1) = (n+1)*(2*n+1), with a(0)=0, a(2)=2, a(4)=9.

%C Sequence extended to left:

%C ..., 36, 29, 21, 16, 10, 6, 3, 1, 0, 0, 1, 2, 6, 9, 15, 20, 28, 34, ...,

%C where 0, 1, 3, 6, 10, 16, 21, 29, 36, 46, ... is A260708.

%C After 2, if a(n) is prime then n == 4 (mod 6).

%C a(n) is a square for n = 0, 1, 4, 49, 52, 192, 1681, 4948, 57121, 60388, 221952, 1940449, 5710372, ...

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

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

%F a(n) = a(n-1) + a(n-2) - a(n-3) + a(n-6) - a(n-7) - a(n-8) + a(n-9).

%F a(2*k+1) = A000217(2*k+1) by definition; for even indices:

%F a(6*k) = 2*k*(9*k + 1),

%F a(6*k+2) = 2*(9*k^2 + 7*k + 1),

%F a(6*k+4) = 18*k^2 + 26*k + 9.

%F a(n) = n*(n + 1)/2 - (1 + (-1)^n)*floor(n/6 + 2/3)/2. [_Bruno Berselli_, Nov 18 2015]

%e a(0) = 0,

%e a(1) = 1*1 = 1,

%e a(2) = 2,

%e a(3) = 2*3 = 6,

%e a(4) = 9,

%e a(5) = 3*5 = 15,

%e a(6) = a(0) + 12*0 + 20 = 20, etc.

%t LinearRecurrence[{1, 1, -1, 0, 0, 1, -1, -1, 1}, {0, 1, 2, 6, 9, 15, 20, 28, 34}, 50] (* _Bruno Berselli_, Nov 18 2015 *)

%o (Magma) [n*(n+1)/2-(1+(-1)^n)*Floor(n/6+2/3)/2: n in [0..50]]; // _Bruno Berselli_, Nov 18 2015

%o (Sage) [n*(n+1)/2-(1+(-1)^n)*floor(n/6+2/3)/2 for n in (0..50)] # _Bruno Berselli_, Nov 18 2015

%Y Cf. A000217, A264041, A260708.

%K nonn,easy

%O 0,3

%A _Paul Curtz_, Nov 16 2015

%E Edited by _Bruno Berselli_, Nov 17 2015