login
A258756
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.
0
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, 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, 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
OFFSET
3,3
COMMENTS
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.
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?
PROG
(Python)
def score(n, step):
...return n*(step**(n//step+(1 if n%step!=0 else 0)))
.
def best(n):
...return max(range(1, (n-1)//2+1), key=lambda step:score(n, step))
CROSSREFS
Sequence in context: A375110 A283367 A322528 * A127431 A289777 A182921
KEYWORD
nonn,easy
AUTHOR
Christian Perfect, Jun 09 2015
STATUS
approved