A190483 a(n) = [(bn+c)r]-b[nr]-[cr], where (r,b,c)=(sqrt(2),2,1) and []=floor.
1, 2, 0, 1, 0, 1, 2, 1, 1, 0, 1, 2, 1, 2, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 1, 1, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 1, 1, 0, 1, 2, 1, 2, 0, 1, 0, 1, 2, 1, 1, 0, 1, 2, 1, 1, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 1, 1, 0, 1, 2, 1, 2, 0, 1, 0, 1, 2, 1, 1, 0, 1, 2, 1, 2, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 1, 1, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 1, 1, 0, 1, 2, 1, 2, 0
Offset: 1
Keywords
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
r = Sqrt[2]; b = 2; c = 1; f[n_] := Floor[(b*n + c)*r] - b*Floor[n*r] - Floor[c*r]; t = Table[f[n], {n, 1, 200}] (* A190483 *) Flatten[Position[t, 0]] (* A190484 *) Flatten[Position[t, 1]] (* A190485 *) Flatten[Position[t, 2]] (* A190486 *)
-
Python
from sympy import sqrt, floor r=sqrt(2) def a(n): return floor((2*n + 1)*r) - 2*floor(n*r) - floor(r) print([a(n) for n in range(1, 501)]) # Indranil Ghosh, Jul 02 2017
Comments