A081147 First differences of A022839.
2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2
Offset: 0
Keywords
Links
- G. C. Greubel, Table of n, a(n) for n = 0..10000
Programs
-
Magma
A081147:= func< n | Floor((n+1)*Sqrt(5)) - Floor(n*Sqrt(5)) >; [A081147(n): n in [0..120]]; // G. C. Greubel, Jan 15 2024
-
Mathematica
Flatten[ Table[ Nest[ Flatten[ # /. {2 -> {2, 2, 2, 3}, 3 -> {2, 2, 2, 2, 3}}] &, {2}, n], {n,0,4}]] (* Robert G. Wilson v, May 07 2005 *) Differences[Table[Floor[n Sqrt[5]],{n,0,110}]] (* Harvey P. Dale, May 05 2019 *)
-
PARI
a(n)=floor((n+1)*sqrt(5))-floor(n*sqrt(5))
-
SageMath
def A081147(n): return floor((n+1)*sqrt(5)) - floor(n*sqrt(5)) [A081147(n) for n in range(121)] # G. C. Greubel, Jan 15 2024
Formula
a(n) = floor((n+1)*sqrt(5)) - floor(n*sqrt(5)).
Comments