login
A054072
Position of n in the permutation of 1,2,...,n obtained by ordering the fractional parts {h*sqrt(2)} for h=1,2,...,n.
4
1, 2, 1, 3, 1, 4, 7, 3, 7, 2, 7, 12, 5, 11, 3, 10, 1, 9, 17, 6, 15, 3, 13, 23, 9, 20, 5, 17, 1, 14, 27, 9, 23, 4, 19, 34, 13, 29, 7, 24, 41, 17, 35, 10, 29, 3, 23, 43, 15, 36, 7, 29, 51, 20, 43, 11, 35, 2, 27, 52, 17, 43, 7, 34, 61, 23, 51, 12, 41
OFFSET
1,2
LINKS
MATHEMATICA
r = Sqrt[2]; p[x_] := FractionalPart[x];
u[n_, k_] := If[p[k*r] <= p[n*r], 1, 0]
v[n_, k_] := If[p[k*r] > p[n*r], 1, 0]
s[n_] := Sum[u[n, k], {k, 1, n}]
t[n_] := Sum[v[n, k], {k, 1, n}]
Table[s[n], {n, 1, 100}] (* this sequence *)
Table[t[n], {n, 1, 100}] (* A194735 *)
CROSSREFS
KEYWORD
nonn
STATUS
approved