A339765 a(n) = 2*floor(n*phi) - 3*n, where phi = (1+sqrt(5))/2.
-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
Keywords
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
Comments