OFFSET
0,3
COMMENTS
The sequence is an alternative solution to the riddle described in the comments of A304584.
LINKS
Rainer Rosenthal, Table of n, a(n) for n = 0..10000
EXAMPLE
d:
5 | 20
4 | 10 19
3 | 9 11 18
2 | 3 8 12 17
1 | 2 4 7 13 16
0 | 0 1 5 6 14 15
|________________________
x: 0 1 2 3 4 5
.
a(13)= 3 + 13*1 = 16 because the 13th position in the enumeration corresponds to x=3 and d=1.
MAPLE
pos2pM:=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; if modp(k, 2)=1 then return [k-e, e]; else return [e, k-e]; fi end: WhereFlea:=proc(n) local x, d, pair; pair:=pos2pM(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 16 2018
STATUS
approved