OFFSET
0,2
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
A. J. Hildebrand, Junxian Li, Xiaomin Li, and Yun Xie, Almost Beatty Partitions, arXiv:1809.08690 [math.NT], 2018.
Vincent Russo and Loren Schwiebert, Beatty Sequences, Fibonacci Numbers, and the Golden Ratio, The Fibonacci Quarterly, Vol 49, Number 2, May 2011.
FORMULA
a(n) = n+floor(2*n*phi). [Formula corrected by Clark Kimberling, Mar 22 2008]
MATHEMATICA
r=5^(1/2); k=1;
t=Table[Floor[n*r+k*r]-Floor[n*r]-Floor[k*r], {n, 1, 220}] (* A188221 *)
Flatten[Position[t, 0] ] (* A188222 *)
Flatten[Position[t, 1] ] (* A004976 *)
(* Clark Kimberling, Mar 24 2011] *)
With[{c=GoldenRatio^3}, Floor[c*Range[0, 50]] (* Vincenzo Librandi, Apr 12 2012 *)
PROG
(PARI) a(n)=2*n+sqrtint(5*n^2) \\ Charles R Greathouse IV, Apr 12 2012
(Python)
from math import isqrt
def A004976(n): return (isqrt(20*n**2)>>1)+(n<<1) # Chai Wah Wu, Aug 17 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved