cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A339765 a(n) = 2*floor(n*phi) - 3*n, where phi = (1+sqrt(5))/2.

This page as a plain text file.
%I A339765 #62 Jun 07 2024 18:23:48
%S A339765 -1,0,-1,0,1,0,1,0,1,2,1,2,3,2,3,2,3,4,3,4,3,4,5,4,5,6,5,6,5,6,7,6,7,
%T A339765 8,7,8,7,8,9,8,9,8,9,10,9,10,11,10,11,10,11,12,11,12,11,12,13,12,13,
%U A339765 14,13,14,13,14,15,14,15,16,15,16,15,16,17,16,17,16
%N A339765 a(n) = 2*floor(n*phi) - 3*n, where phi = (1+sqrt(5))/2.
%C A339765 a(n) are coefficients in the formulas for multiplication of fractional parts of multiples of the golden mean:
%C A339765 (I)    frac(b*phi)*frac(c*phi) = 1-frac(d*phi); d = 2*b*c+a(b)*c/2+a(c)*b/2;
%C A339765 (IIa)  frac(b*phi)*(1-frac(c*phi)) = frac(e*phi); e = d+b;
%C A339765 (IIb)  (1-frac(b*phi))*frac(c*phi) = frac(f*phi); f = d+c;
%C A339765 (III)  (1-frac(b*phi))*(1-frac(c*phi)) = 1-frac(g*phi); g = d+b+c;
%C A339765 where frac() = FractionalPart(), phi = (1+sqrt(5))/2 and b,c are positive integers.
%C A339765 The parameters d,e,f,g are also positive integers.
%F A339765 a(n) = 2*A000201(n) - 3*n.
%F A339765 a(n) = A005206(n-1) - A189663(n+1).
%F A339765 a(n) = A019446(n) - A060144(n) - sign(abs(n)) - 1.
%F A339765 From _Primoz Pirnat_, May 15 2024: (Start)
%F A339765 a(n) = A050140(n) - 2*n.
%F A339765 a(n) = 2*A005206(n-1) - n.
%F A339765 a(n) = n - 2*A189663(n+1). (End)
%e A339765 For b=3, c=10, a(3)=-1, a(10)=2 are solutions of upper formulas:
%e A339765 (I) frac(3*phi)*frac(10*phi) = 1-frac(58*phi); d = 2*3*10+a(3)*10/2+a(10)*3/2 = 58;
%e A339765 (IIa)  frac(3*phi)*(1-frac(10*phi)) = frac(61*phi); e = d+3 = 61;
%e A339765 (IIb)  (1-frac(3*phi))*frac(10*phi) = frac(68*phi); f = d+10 = 68;
%e A339765 (III)  (1-frac(3*phi))*(1-frac(10*phi)) = 1-frac(71*phi); g = d+3+10 = 71.
%t A339765 Table[2Floor[n*GoldenRatio]-3n,{n,76}] (* _Stefano Spezia_, Dec 18 2020 *)
%o A339765 (PARI) a(n) = 2*floor(n*quadgen(5)) - 3*n; \\ _Michel Marcus_, Jan 05 2021
%o A339765 (Python)
%o A339765 from math import isqrt
%o A339765 def A339765(n): return ((n+isqrt(5*n**2))&~1)-3*n # _Chai Wah Wu_, Aug 09 2022
%Y A339765 Cf. A000201, A001622, A005206, A050140, A189663, A019446, A060144.
%K A339765 sign
%O A339765 1,10
%A A339765 _Primoz Pirnat_, Dec 16 2020