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.

User: Primoz Pirnat

Primoz Pirnat's wiki page.

Primoz Pirnat has authored 1 sequences.

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

Original entry on oeis.org

-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, 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, 14, 13, 14, 13, 14, 15, 14, 15, 16, 15, 16, 15, 16, 17, 16, 17, 16
Offset: 1

Author

Primoz Pirnat, Dec 16 2020

Keywords

Comments

a(n) are coefficients in the formulas for multiplication of fractional parts of multiples of the golden mean:
(I) frac(b*phi)*frac(c*phi) = 1-frac(d*phi); d = 2*b*c+a(b)*c/2+a(c)*b/2;
(IIa) frac(b*phi)*(1-frac(c*phi)) = frac(e*phi); e = d+b;
(IIb) (1-frac(b*phi))*frac(c*phi) = frac(f*phi); f = d+c;
(III) (1-frac(b*phi))*(1-frac(c*phi)) = 1-frac(g*phi); g = d+b+c;
where frac() = FractionalPart(), phi = (1+sqrt(5))/2 and b,c are positive integers.
The parameters d,e,f,g are also positive integers.

Examples

			For b=3, c=10, a(3)=-1, a(10)=2 are solutions of upper formulas:
(I) frac(3*phi)*frac(10*phi) = 1-frac(58*phi); d = 2*3*10+a(3)*10/2+a(10)*3/2 = 58;
(IIa)  frac(3*phi)*(1-frac(10*phi)) = frac(61*phi); e = d+3 = 61;
(IIb)  (1-frac(3*phi))*frac(10*phi) = frac(68*phi); f = d+10 = 68;
(III)  (1-frac(3*phi))*(1-frac(10*phi)) = 1-frac(71*phi); g = d+3+10 = 71.
		

Programs

  • Mathematica
    Table[2Floor[n*GoldenRatio]-3n,{n,76}] (* Stefano Spezia, Dec 18 2020 *)
  • PARI
    a(n) = 2*floor(n*quadgen(5)) - 3*n; \\ Michel Marcus, Jan 05 2021
    
  • Python
    from math import isqrt
    def A339765(n): return ((n+isqrt(5*n**2))&~1)-3*n # Chai Wah Wu, Aug 09 2022

Formula

a(n) = 2*A000201(n) - 3*n.
a(n) = A005206(n-1) - A189663(n+1).
a(n) = A019446(n) - A060144(n) - sign(abs(n)) - 1.
From Primoz Pirnat, May 15 2024: (Start)
a(n) = A050140(n) - 2*n.
a(n) = 2*A005206(n-1) - n.
a(n) = n - 2*A189663(n+1). (End)