OFFSET
1,3
COMMENTS
See A317582 for similar sequences.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 5:
- a(1) + 2 * a(4) = 0 + 2 * 3 = 6 > 5,
- a(2) + 2 * a(3) = 1 + 2 * 2 = 5 <= 5,
- a(3) + 2 * a(2) = 2 + 2 * 1 = 4 <= 5,
- a(4) + 2 * a(1) = 3 + 2 * 0 = 3 <= 5,
- hence a(5) = 3.
MATHEMATICA
a[n_] := a[n] = Length@ Select[ Range[n - 1], a[#] + 2a[n - #] <= n &]; a[0] = 0; Array[a, 70] (* Robert G. Wilson v, Aug 03 2018 *)
PROG
(PARI) a = vector(73); for (n=1, #a, a[n] = sum(k=1, n-1, a[k] + 2*a[n-k] <= n); print1 (a[n] ", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Aug 01 2018
STATUS
approved