OFFSET
1,2
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.
EXAMPLE
2 lasts appears in A217865 at position 5 so a(2)=5.
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)+", ");
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Oct 13 2012
STATUS
approved