login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A217866
Last time n appears in the first differences of n*log(n): A217865.
1
1, 5, 18, 46, 137, 384, 1059, 2905, 8066, 21883, 59743, 162247, 441824
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
Cf. A217865.
Cf. A217976.
Sequence in context: A273559 A272792 A273566 * A256539 A109363 A218214
KEYWORD
nonn
AUTHOR
Jon Perry, Oct 13 2012
STATUS
approved