A336017 a(n) = floor(frac(Pi*n)*n), where frac denotes the fractional part.
0, 0, 0, 1, 2, 3, 5, 6, 1, 2, 4, 6, 8, 10, 13, 1, 4, 6, 9, 13, 16, 20, 2, 5, 9, 13, 17, 22, 27, 3, 7, 12, 16, 22, 27, 33, 3, 8, 14, 20, 26, 33, 39, 3, 10, 16, 23, 30, 38, 45, 3, 11, 18, 26, 34, 43, 52, 4, 12, 20, 29, 38, 48, 57, 3, 13, 22, 32, 42, 53, 63, 3, 14, 24
Offset: 0
Keywords
Links
- Wikipedia, Equidistribution theorem.
Programs
-
Mathematica
a[n_]:=Floor[FractionalPart[Pi*n]*n]; Table[a[n], {n, 0, 100}] (* uncomment following lines to count increasing subsequences. The function MySplit[c] splits the sequence c into monotonically increasing subsequences *) (* MySplit[c_List]:=Module[{d={{c[[1]]}},k=1}, Do[If[c[[j]]>c[[j-1]],AppendTo[d[[k]],c[[j]]] ,AppendTo[d,{c[[j]]}];k++],{j,2,Length[c]}];Return[d]]; tab=Table[a[n], {n, 1, 2^20 }]; Map[Length, MySplit[tab], 1] // Tally *)
-
PARI
a(n) = frac(Pi*n)*n\1; \\ Michel Marcus, Jul 07 2020
Formula
a(n) = floor((Pi*n - floor(Pi*n))*n).
Comments