login
A014245
a(n) = (n-th term of Beatty sequence for (3+sqrt(3))/2) - (n-th term of Beatty sequence for sqrt(3)).
1
1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 42, 43, 44, 44, 45, 46, 46, 47
OFFSET
1,3
COMMENTS
It appears that a(n) is the nearest integer to (3-sqrt(3))/2 * n. - Franklin T. Adams-Watters, Nov 02 2006
FORMULA
a(n) = floor((3+sqrt(3))/2 * n) - floor(sqrt(3) * n).
MAPLE
a:=n->floor((3+sqrt(3))/2*n)-floor(sqrt(3)*n): seq(a(n), n=1..80); # Muniru A Asiru, Oct 17 2018
MATHEMATICA
With[{r = Sqrt@ 3}, Array[Floor[# (3 + r)/2] - Floor[# r] &, 80] ] (* Michael De Vlieger, Oct 17 2018 *)
PROG
(PARI) my(r=sqrt(3)); vector(80, n, (n*r*(r+1))\2 - (n*r)\1) \\ G. C. Greubel, Jun 19 2019
(Magma) r:=Sqrt(3); [Floor(n*r*(r+1)/2) - Floor(n*r): n in [1..80]]; // G. C. Greubel, Jun 19 2019
(Sage) r=sqrt(3); [floor(n*r*(r+1)/2) - floor(n*r) for n in (1..80)] # G. C. Greubel, Jun 19 2019
CROSSREFS
Sequence in context: A005206 A309077 A057365 * A350969 A096386 A257063
KEYWORD
nonn
EXTENSIONS
Corrected and extended by Franklin T. Adams-Watters, Nov 02 2006
Extraneous comma following a(56) removed by Sean A. Irvine, Oct 17 2018
STATUS
approved