OFFSET
0,3
COMMENTS
The sequence solves the following riddle, which has been communicated by Klaus Nagel: A flea starts to jump on the nonnegative integers at time = 0 at an unknown location x >= 0 making jumps of unknown, but constant distance d >= 0 at every subsequent time step. By which strategy can the flea be captured with 100% certainty in a finite number of trials? The solution is to hit a(n) at time = n. This works for all enumerations of pairs (x,d) of integers, because eventually any combination of starting location x and jump width d will be addressed.
LINKS
Rainer Rosenthal, Table of n, a(n) for n = 0..10000
EXAMPLE
d:
5 | 20
4 | 14 19
3 | 9 13 18
2 | 5 8 12 17
1 | 2 4 7 11 16
0 | 0 1 3 6 10 15
|________________________
x: 0 1 2 3 4 5
.
a(13) = 1 + 13*3 = 40 because the 13th position in the enumeration corresponds to x=1 and d=3.
MAPLE
pos2pair:=proc(n) local w, k, e; w:=floor(sqrt(2*n)); if w*(w+1)>2*n then k:=w-1; else k:=w; fi; e:=n-k*(k+1)/2; return [k-e, e]; end:WhereFlea:=proc(n) local x, d, pair; pair:=pos2pair(n); x:=pair[1]; d:=pair[2]; return x+d*n; end:
seq(WhereFlea(n), n=0..66); # Rainer Rosenthal, May 23 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, May 15 2018
STATUS
approved