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”).
%I #12 Feb 22 2021 13:27:14
%S 1,1,2,2,3,3,4,3,5,5,4,4,7,3,4,4,3,3,4,3,3,3,3,3,3,3,4,4,3,3,4,3,3,3,
%T 3,3,3,3,3,3,3,3,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
%U 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
%N a(n) = common difference giving the highest score in the game "Sequences" for a sequence with largest element n and as many elements as possible.
%C The aim of the game is to find, in the given numbered tiles, arithmetic sequences of at least three elements. The score for a sequence is (max element)*(common difference ^ num elements). This sequence gives the common difference which produces the best score for a sequence with largest element n, and containing as many elements as possible.
%C This sequence converges to 3, which must have something to do with the fact that log(x)/x is maximized at x=e. Is n=45 the last time a(n) is not 3?
%H Christian Perfect, <a href="http://christianp.github.io/sequences">Sequences game</a>
%o (Python)
%o def score(n,step):
%o ...return n*(step**(n//step+(1 if n%step!=0 else 0)))
%o .
%o def best(n):
%o ...return max(range(1,(n-1)//2+1),key=lambda step:score(n,step))
%K nonn,easy
%O 3,3
%A _Christian Perfect_, Jun 09 2015