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”).

Last time n appears in the first differences of n*log(n): A217865.
1

%I #15 Oct 16 2012 14:26:41

%S 1,5,18,46,137,384,1059,2905,8066,21883,59743,162247,441824

%N Last time n appears in the first differences of n*log(n): A217865.

%C Conjecture: the last time n appears is always before the first time n+2 appears.

%C 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).

%C We can see that the last 2 is before the first 4, the last 3 is before the first 5, etc.

%e 2 lasts appears in A217865 at position 5 so a(2)=5.

%o (JavaScript)

%o function lastIndex(arr,k) {

%o p=-1;

%o for (a=1;a<arr.length;a++) if (arr[a]==k) p=a;

%o return p;

%o }

%o d=new Array();

%o for (i=1;i<500000;i++)

%o d[i]=Math.floor((i+1)*Math.log(i+1))-Math.floor(i*Math.log(i));

%o for (i=1;i<100;i++) document.write(lastIndex(d,i)+", ");

%Y Cf. A217865.

%Y Cf. A217976.

%K nonn

%O 1,2

%A _Jon Perry_, Oct 13 2012