login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A004201
Accept one, reject one, accept two, reject two, ...
13
1, 3, 4, 7, 8, 9, 13, 14, 15, 16, 21, 22, 23, 24, 25, 31, 32, 33, 34, 35, 36, 43, 44, 45, 46, 47, 48, 49, 57, 58, 59, 60, 61, 62, 63, 64, 73, 74, 75, 76, 77, 78, 79, 80, 81, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 133, 134, 135
OFFSET
1,2
COMMENTS
a(n) are the numbers satisfying m - 0.5 < sqrt(a(n)) <= m for some positive integer m. - Floor van Lamoen, Jul 24 2001
Lower s(n)-Wythoff sequence (as defined in A184117) associated to s(n) = A002024(n) = floor(1/2+sqrt(2n)), with complement (upper s(n)-Wythoff sequence) in A004202.
LINKS
FORMULA
a(n) = A061885(n-1)+1. - Franklin T. Adams-Watters, Jul 05 2009
a(n+1) - a(n) = A130296(n+1). - Reinhard Zumkeller, Jul 16 2008
a(A000217(n)) = n^2. - Reinhard Zumkeller, Feb 12 2011
a(n) = A004202(n)-A002024(n). - M. F. Hasler, Feb 13 2011
a(n) = n+A000217(A003056(n-1)) = n+A000217(A002024(n)-1). - M. F. Hasler, Feb 13 2011
a(n) = n + t(t+1)/2, where t = floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 13 2012
a(n) = (2*n - r + r^2)/2, where r = round(sqrt(2*n)). - Wesley Ivan Hurt, Sep 20 2021
MATHEMATICA
f[x_]:=Module[{c=1-x+x^2}, Range[c, c+x-1]]; Flatten[Array[f, 20]] (* Harvey P. Dale, Jul 31 2012 *)
PROG
(Haskell)
a004201 n = a004201_list !! (n-1)
a004201_list = f 1 [1..] where
f k xs = us ++ f (k + 1) (drop (k) vs) where (us, vs) = splitAt k xs
-- Reinhard Zumkeller, Jun 20 2015, Feb 12 2011
(PARI) A004201(n)=n+(n=(sqrtint(8*n-7)+1)\2)*(n-1)\2 \\ M. F. Hasler, Feb 13 2011
(Python)
from math import comb, isqrt
def A004201(n): return n+comb((m:=isqrt(k:=n<<1))+(k>m*(m+1)), 2) # Chai Wah Wu, Nov 09 2024
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Alexander Stasinski
STATUS
approved