OFFSET
1,2
COMMENTS
Conjecture: the last time n appears is always before the first time n+2 appears.
For example the last time 5 appears is at position 135, the first time 7 appears is at position 159.
PROG
(JavaScript)
function firstIndex(arr, k) {
p=-1;
for (a=1; a<arr.length; a++) if (arr[a]==k) {p=a; return p; }
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(firstIndex(d, i)+", ");
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Oct 16 2012
STATUS
approved