login
A265228
Interleave the even numbers with the numbers that are congruent to {1, 3, 7} mod 8.
2
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, 26, 35, 28, 39, 30, 41, 32, 43, 34, 47, 36, 49, 38, 51, 40, 55, 42, 57, 44, 59, 46, 63, 48, 65, 50, 67, 52, 71, 54, 73, 56, 75, 58, 79, 60, 81, 62, 83, 64, 87, 66
OFFSET
0,3
COMMENTS
b(n) denotes the sequence:
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(n) = n + b(n) = n + floor((n+1)/7)*(-1)^((n+1) mod 7) provides:
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.
a(n) differs from c(n) because c(n) contains the terms of the form 8*k+5.
FORMULA
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.
a(n) = a(n-6) - (-1)^n + 7.
a(n) = A260708(n) - A260699(n-1) - A079979(n+3), with A260699(-1) = 0.
From Colin Barker, Dec 06 2015: (Start)
a(n) = a(n-2) + a(n-6) - a(n-8) for n > 7.
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)
MATHEMATICA
lim = 11; Riffle[Range[0, 6 lim, 2], Select[Range[8 lim], MemberQ[{1, 3, 7}, Mod[#, 8]] &]] (* Michael De Vlieger, Dec 06 2015 *)
PROG
(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
(PARI) vector(100, n, n--; n+(1-(-1)^n)*floor(n/6+1/3)) \\ Altug Alkan, Dec 09 2015
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Dec 06 2015
STATUS
approved