login
Nearest integer to n*(2-phi), where phi is the golden ratio (A001622).
2

%I #18 Jun 14 2020 22:47:21

%S 0,0,1,1,2,2,2,3,3,3,4,4,5,5,5,6,6,6,7,7,8,8,8,9,9,10,10,10,11,11,11,

%T 12,12,13,13,13,14,14,15,15,15,16,16,16,17,17,18,18,18,19,19,19,20,20,

%U 21,21,21,22,22,23,23,23,24,24,24,25,25,26,26,26,27,27

%N Nearest integer to n*(2-phi), where phi is the golden ratio (A001622).

%F a(n) = round(n*(2-phi)).

%F a(n) = n - A101803(n).

%e a(0) = round(0*(2-phi)) = round(0) = 0.

%e a(1) = round(1*(2-phi)) = round(0.382) = 0.

%e a(2) = round(2*(2-phi)) = round(0.764) = 1.

%t a[n_] := Round[n * (2 - GoldenRatio)]; Array[a, 72, 0] (* _Amiram Eldar_, Jun 14 2020 *)

%o (PARI) a(n) = round(n*(2-(1+sqrt(5))/2)); \\ _Michel Marcus_, Jun 14 2020

%Y Cf. A001622, A101803, A132338 (2-phi), A334414, A334413.

%K nonn

%O 0,5

%A _Aresh Pourkavoos_, Apr 30 2020