OFFSET
1,3
COMMENTS
Equivalently, numbers k such that floor(k/5) = 2*floor(k/10).
After 0, partial sums of A010122 starting from the 2nd term.
The sequence differs from A007091 after a(25).
Also numbers k such that floor(k/5) is even. - Peter Luschny, Oct 05 2017
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,1,-1).
FORMULA
G.f.: x^2*(1 + x + x^2 + x^3 + 6*x^4)/((1 - x)^2*(1 + x + x^2 + x^3 + x^4)).
a(n) = a(n-1) + a(n-5) - a(n-6).
a(n) = (n-1) + 5*floor((n-1)/5) = 10*floor((n-1)/5) + ((n-1) mod 5).
a(n) = 2n-2-((n-1) mod 5). - Chai Wah Wu, Oct 29 2024
MAPLE
select(k -> type(floor(k/5), even), [$0..130]); # Peter Luschny, Oct 05 2017
MATHEMATICA
Table[n + 5 Floor[n/5], {n, 0, 70}]
Reap[For[k = 0, k <= 130, k++, If[Floor[k/5] == 2*Floor[k/10], Sow[k]]]][[2, 1]] (* or *) LinearRecurrence[{1, 0, 0, 0, 1, -1}, {0, 1, 2, 3, 4, 10}, 66] (* Jean-François Alcover, Oct 05 2017 *)
PROG
(Magma) [n: n in [0..130] | n mod 10 lt 5];
(Magma) [n: n in [0..130] | IsEven(Floor(n/5))];
(Magma) [n+5*Floor(n/5): n in [0..70]];
(PARI) concat(0, Vec(x^2*(1 + x + x^2 + x^3 + 6*x^4) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)) + O(x^70))) \\ Colin Barker, Oct 05 2017
(PARI) select(k->floor(k/5) == 2*floor(k/10), vector(1000, k, k)) \\ Colin Barker, Oct 05 2017
(Python) [k for k in range(131) if (k//5) % 2 == 0] # Peter Luschny, Oct 05 2017
(Python)
def A293292(n): return (n-1<<1)-(n-1)%5 # Chai Wah Wu, Oct 29 2024
(Sage) [k for k in (0..130) if 2.divides(floor(k/5))] # Peter Luschny, Oct 05 2017
CROSSREFS
KEYWORD
nonn,base,easy,changed
AUTHOR
Bruno Berselli, Oct 05 2017
EXTENSIONS
Definition by David A. Corneth, Oct 05 2017
STATUS
approved