%I #49 Dec 13 2015 08:58:04
%S 0,1,2,3,4,7,6,9,8,11,10,15,12,17,14,19,16,23,18,25,20,27,22,31,24,33,
%T 26,35,28,39,30,41,32,43,34,47,36,49,38,51,40,55,42,57,44,59,46,63,48,
%U 65,50,67,52,71,54,73,56,75,58,79,60,81,62,83,64,87,66
%N Interleave the even numbers with the numbers that are congruent to {1, 3, 7} mod 8.
%C b(n) denotes the sequence:
%C 0, 0, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, 2, -2, 2, -2, 2, -2, 2, 3, -3, 3, -3, 3, -3, 3, 4, -4, ..., and
%C c(n) = n + b(n) = n + floor((n+1)/7)*(-1)^((n+1) mod 7) provides:
%C 0, 1, 2, 3, 4, 5, 7, 6, 9, 8, 11, 10, 13, 15, 12, 17, 14, 19, 16, 21, 23, 18, 25, 20, 27, 22, 29, ..., which is a permutation of A001477.
%C a(n) differs from c(n) because c(n) contains the terms of the form 8*k+5.
%H Colin Barker, <a href="/A265228/b265228.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,0,0,0,1,0,-1).
%F a(n) = n + 2*A260160(n) = n + (1-(-1)^n)*floor(n/6+1/3). Therefore, for odd n, a(n) = A047529((n+1)/2); otherwise, a(n) = n.
%F a(n) = a(n-6) - (-1)^n + 7.
%F a(n) = A260708(n) - A260699(n-1) - A079979(n+3), with A260699(-1) = 0.
%F From _Colin Barker_, Dec 06 2015: (Start)
%F a(n) = a(n-2) + a(n-6) - a(n-8) for n > 7.
%F G.f.: x*(1+2*x+2*x^2+2*x^3+4*x^4+2*x^5+x^6) / ((1-x)^2*(1+x)^2*(1-x+x^2)*(1+x+x^2)). (End)
%t lim = 11; Riffle[Range[0, 6 lim, 2], Select[Range[8 lim], MemberQ[{1, 3, 7}, Mod[#, 8]] &]] (* _Michael De Vlieger_, Dec 06 2015 *)
%o (PARI) concat(0, Vec(x*(1+2*x+2*x^2+2*x^3+4*x^4+2*x^5+x^6)/((1-x)^2 *(1+x)^2*(1-x+x^2)*(1+x+x^2)) + O(x^100))) \\ _Colin Barker_, Dec 06 2015
%o (PARI) vector(100, n, n--; n+(1-(-1)^n)*floor(n/6+1/3)) \\ _Altug Alkan_, Dec 09 2015
%Y Cf. A001477, A004770, A005843, A047529, A079979, A260160, A260699, A260708.
%K nonn,easy
%O 0,3
%A _Paul Curtz_, Dec 06 2015