|
|
A188470
|
|
a(n) = [5r]-[nr]-[5r-nr], where r=(1+sqrt(5))/2 and []=floor.
|
|
2
|
|
|
1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1
|
|
COMMENTS
|
Sequence A188471 lists the position of 0's, all other terms equal 1. - M. F. Hasler, Oct 12 2017
|
|
LINKS
|
|
|
FORMULA
|
a(n) = [5r] - [nr] - [5r-nr], where r=(1+sqrt(5))/2 is the golden ratio.
a(n) = 1 - A187946(n) for n not equal to 5 (from [-x]=-[x]-1 for non-integer x). - Michel Dekking, Oct 15 2016
|
|
MAPLE
|
end proc:
|
|
MATHEMATICA
|
r = (1 + 5^(1/2))/2 + .0000000000001;
f[n_] := Floor[5r] - Floor[n*r] - Floor[5r - n*r]
t = Flatten[Table[f[n], {n, 1, 200}]] (* A188470 *)
Flatten[Position[t, 0] ] (* A188471 *)
Flatten[Position[t, 1] ] (* complement of A188471 *)
|
|
PROG
|
(PARI)
\\ For z = a + b*phi with phi = quadgen(5), exact representation of (sqrt(5)+1)/2:
FLOOR(z, F=1, f(w)=floor(real(z)+imag(z)*w), L=f(F))=while(L!=L=f(F=1+1/F), ); LA188470(n, r=quadgen(5)) = FLOOR(5*r)-FLOOR(n*r)-FLOOR(5*r-n*r) \\ M. F. Hasler, Oct 12 2017
(PARI)
A000201(m) = (sqrtint((m^2)*5)+m)\2;
(Python)
from math import isqrt
def A188470(n): return 7-(n+isqrt(5*n**2)>>1)+(n-1+isqrt(5*(n-5)**2)>>1) if n>5 else int(n<5) # Chai Wah Wu, Aug 10 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|