login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
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
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
For n>5, a(n) = 9 - A000201(n) + A000201(n-5). - Max Alekseyev, Oct 14 2017
MAPLE
A188470 := proc(n)
8-A000201(n)-A000201(5-n);
end proc:
seq(A188470(n), n=1..50) ; # R. J. Mathar, Oct 13 2017
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;
A188470(n) = if(n<=5, n%5!=0, 9+A000201(n-5)-A000201(n)); \\ Max Alekseyev, Oct 13 2017
(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