
COMMENTS

Conjecture: the last time n appears is always before the first time n+2 appears.
For example, examine: 1, 2, 2, 3, 2, 3, 3, 3, 4, 3, 3, 4, 3, 4, 4, 4, 4, 3, 4, 4, 5, 4, 4, 4 (A217865).
We can see that the last 2 is before the first 4, the last 3 is before the first 5, etc.


PROG

(JavaScript)
function lastIndex(arr, k) {
p=1;
for (a=1; a<arr.length; a++) if (arr[a]==k) p=a;
return p;
}
d=new Array();
for (i=1; i<500000; i++)
d[i]=Math.floor((i+1)*Math.log(i+1))Math.floor(i*Math.log(i));
for (i=1; i<100; i++) document.write(lastIndex(d, i)+", ");
