OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Amiram Eldar, Plot of a(n)/n for n = 1000..10000
FORMULA
a(n) = (-1)*Sum_{k=1..n} (-1)^A002977(k).
a(n) > 0 and a(n) seems to be asymptotic to c*n where c = 0.4...
EXAMPLE
S(12) = (1,3,4,7,9,10,13,15,19,21,22,27) and there are 9 odd terms and 3 even terms in S(12), hence a(12) = 9-3 = 6.
MATHEMATICA
seq[max_] := Module[{s = Flatten[NestWhileList[Flatten[{2*# + 1, 3*# + 1}] &, 1, Min[#1] < max &]], t}, t = Union[Select[s, # <= max &]]; FoldList[Plus, -(-1)^t]]; seq[300] (* Amiram Eldar, May 07 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Nov 20 2002
STATUS
approved