cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A217866 #15 Oct 16 2012 14:26:41
%S A217866 1,5,18,46,137,384,1059,2905,8066,21883,59743,162247,441824
%N A217866 Last time n appears in the first differences of n*log(n): A217865.
%C A217866 Conjecture: the last time n appears is always before the first time n+2 appears.
%C A217866 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 A217866 We can see that the last 2 is before the first 4, the last 3 is before the first 5, etc.
%e A217866 2 lasts appears in A217865 at position 5 so a(2)=5.
%o A217866 (JavaScript)
%o A217866 function lastIndex(arr,k) {
%o A217866 p=-1;
%o A217866 for (a=1;a<arr.length;a++) if (arr[a]==k) p=a;
%o A217866 return p;
%o A217866 }
%o A217866 d=new Array();
%o A217866 for (i=1;i<500000;i++)
%o A217866 d[i]=Math.floor((i+1)*Math.log(i+1))-Math.floor(i*Math.log(i));
%o A217866 for (i=1;i<100;i++) document.write(lastIndex(d,i)+", ");
%Y A217866 Cf. A217865.
%Y A217866 Cf. A217976.
%K A217866 nonn
%O A217866 1,2
%A A217866 _Jon Perry_, Oct 13 2012