OFFSET
1
COMMENTS
See A188294.
Essentially the same as 1 - A187946, see formulas. - Michel Dekking, Oct 15 2016, edited by M. F. Hasler, Oct 12 2017
Sequence A188471 lists the position of 0's, all other terms equal 1. - M. F. Hasler, Oct 12 2017
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
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
MATHEMATICA
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
Clark Kimberling, Apr 01 2011
STATUS
approved