I am trying to write a little script to compute an integer sequence. The function I'm trying to write in code is the one int the blackboard, a(n). The problem is that I was expecting the function h(n) I defined in the script to give a number as a result, but it is giving something else: for h(2) it gives ArgMax[{p, HarmonicNumber[p] <= 1}, p, Integers]
How can I correct that? (You have to understand that I am by no means a programmer, nor know much about mathematica. Thanks in advnace.
The script I wrote is this one:
h[n_] := (ArgMax[{p,
Sum[1/s, {s, 1 + Sum[h[k], {k, 1, (n - 1)}], p}] <= 1}, p,
Integers]) - Sum[h[k], {k, 1, (n - 1)}]; h[1] = 1;
a(n)=(maximum p such that the sum from s equals r to p is less or equal than one)-r+1, where r=1+the sum from k=1 to (n-1) of a(k), and a(1)=1
PD: Those letters that look like v's are r's. Sorry.