login
n occurs 2n+2 times.
6

%I #24 Nov 07 2024 17:20:56

%S 0,0,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,5,5,5,5,

%T 5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,

%U 7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8

%N n occurs 2n+2 times.

%C Define the oblong root obrt(x) to be the (larger) solution of y * (y+1) = x; i.e., obrt(x) = sqrt(x+1/4) - 1/2. So obrt(x) is an integer iff x is an oblong number (A002378). Then a(n) = floor(obrt(n)).

%C a(n) gives (from the preceding comment) also the maximal number of parts of partitions of n with no part 1 and difference of parts at least two. See A003106, with the combinatorial interpretation of the sum of the Rogers-Ramanujan identity. - _Wolfdieter Lang_, Oct 29 2016

%H Reinhard Zumkeller, <a href="/A259361/b259361.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = A000194(n+1)-1.

%F a(n) = floor((-1 + sqrt(1+4*n))/2). See the first comment above. - _Wolfdieter Lang_, Oct 29 2016

%t Flatten[Table[PadLeft[{}, 2n + 2, n], {n, 0, 8}]] (* _Alonso del Arte_, Jun 30 2015 *)

%t Table[Floor[(-1 + Sqrt[1 + 4 n])/2], {n, 0, 120}] (* _Michael De Vlieger_, Oct 31 2016 *)

%o (Haskell)

%o a259361 = floor . subtract (1 / 2) . sqrt . (+ 1 / 4) . fromIntegral

%o a259361_list = concat xss where

%o xss = iterate (\(xs@(x:_)) -> map (+ 1) (x : x : xs)) [0, 0]

%o -- _Reinhard Zumkeller_, Jul 09 2015

%o (Magma) [Floor((-1+Sqrt(1+4*n))/2): n in [0..85]]; // _Vincenzo Librandi_, Oct 30 2016

%o (Python)

%o from math import isqrt

%o def A259361(n): return (m:=isqrt(n-1)-1)+(n-1>m*(m+3)) if n else 0 # _Chai Wah Wu_, Nov 07 2024

%Y Cf. A000194, A002378.

%Y Cf. A003056.

%K nonn,easy

%O 0,7

%A _Franklin T. Adams-Watters_, Jun 24 2015