A082389 a(n) = floor((n+2)*phi) - floor((n+1)*phi) where phi=(1+sqrt(5))/2.
1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2
Offset: 1
Examples
a(1)+a(2)=3 and a(a(1)+a(2)) must be a(2) so a(3)=2. Therefore a(a(1)+a(2)+a(3))=a(5)=2 and from the rule the "hole" a(4) is 1. Hence sequence begins 1,2,2,1,2,...
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Crossrefs
Same as A014675 without the first term.
Programs
-
Maple
A082389:=n->floor((n+2)*(1+sqrt(5))/2) - floor((n+1)*(1+sqrt(5))/2): seq(A082389(n), n=1..300); # Wesley Ivan Hurt, Jan 16 2017
-
Mathematica
Rest@Nest[ Flatten[ # /. {1 -> 2, 2 -> {2, 1}}] &, {1}, 11] (* Robert G. Wilson v, Jan 26 2006 *) #[[2]]-#[[1]]&/@Partition[Table[Floor[GoldenRatio n],{n,0,110}],2,1] (* Harvey P. Dale, Sep 04 2019 *) Differences[Floor[GoldenRatio Range[2,150]]] (* Harvey P. Dale, Dec 02 2024 *)
-
Python
from math import isqrt def A082389(n): return (n+2+isqrt(m:=5*(n+2)**2)>>1)-(n+1+isqrt(m-10*n-15)>>1) # Chai Wah Wu, Aug 29 2022
Comments