[go: up one dir, main page]

login
A188374
[nr+kr]-[nr]-[kr], where r=1/sqrt(2), k=2, [ ]=floor.
4
1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1
OFFSET
1
COMMENTS
See A187950. For k=1 instead of 2, see A080764 for which the position sequences of 0 and 1 are A001952 and A001951, respectively.
FORMULA
a(n)=[nr+2r]-[nr]-[2r], where r=1/sqrt(2).
MATHEMATICA
r=2^(-1/2); k=2;
t=Table[Floor[n*r+k*r]-Floor[n*r]-Floor[k*r], {n, 1, 220}] (* A188374 *)
Flatten[Position[t, 0] ] (* A188375 *)
Flatten[Position[t, 1] ] (* A188376 *)
PROG
(Python)
from __future__ import division
from gmpy2 import isqrt
def A188374(n):
return int(isqrt((n+2)**2//2)-isqrt(n**2//2)) - 1 # Chai Wah Wu, Oct 08 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Mar 29 2011
STATUS
approved