login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A000194 n appears 2n times, for n >= 1; also nearest integer to square root of n. 53
0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

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) = ceiling(obrt(n)). - Franklin T. Adams-Watters, Jun 24 2015

From Wolfdieter Lang, Mar 12 2019: (Start)

The general Pell equation is related to the non reduced form F(n) = Xvec^T A(n) Xvec = x^2 - D(n)*y^2 with D(n) = A000037(n) (D not a square), Xvec = (x,y)^T (T for transposed) and A(n) = matrix[[1,0], [0,-D(n)]]. The discriminant of F(n) = [1, 0, -D(n)] is 4*D(n).

The first reduced form appears after two applications of an equivalence transformation A' = R^T A R obtained with R = R(t) = matrix([0, -1], [1, t]), namely first with t = 0, leading to the still not reduced form [-D, 0, 1], and then with t = ceiling(f(4*D(n))/2 - 1), where f(4*D(n)) = ceiling(2*sqrt(D(n))). This can be shown to be a(n), which is also D(n) - n, for n >= 1 (see a formula below).

This leads to the reduced form FR(n) = [1, 2*a(n), -(D(n) - a(n)^2)] = [1, 2*a(n), -(n - a(n)*(a(n) - 1)]. Example: n = 5, a(5) = 2: D(5) = 7 and FR(5) = [1, 4, -3].  (End)

REFERENCES

B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 78, Entry 24.

LINKS

T. D. Noe, Table of n, a(n) for n = 0..1000

Jonathan M. Borwein and others, Nearest Integer Zeta Functions, solution to Problem 10212, The American Mathematical Monthly, Vol. 101, No. 6 (1994), pp. 579-580.

G. Gutin, Problem 913 (BCC20.5), Mediated digraphs, in Research Problems from the 20th British Combinatorial Conference, Discrete Math., 308 (2008), 621-630.

M. A. Nyblom, Some curious sequences involving floor and ceiling functions, Am. Math. Monthly 109 (#6, 2002), 559-564.

Michael Somos, Sequences used for indexing triangular or square arrays.

Eric Weisstein's World of Mathematics, Ramanujan Theta Functions.

FORMULA

a(n) = A000037(n) - n.

G.f.: x * f(x^2, x^6)/(1-x) where f(,) is Ramanujan's two-variable theta function. - Michael Somos, May 31 2000

a(n) = a(n - 2*a(n - a(n-1))) + 1. - Benoit Cloitre, Oct 27 2002

a(n+1) = a(n) + A005369(n).

a(n) = floor((1/2)*(1 + sqrt(4*n - 3))). - Zak Seidov, Jan 18 2006

a(n) = A000037(n) - n. - Jaroslav Krizek, Jun 14 2009

a(n) = floor(A027434(n)/2). - Gregory R. Bryant, Apr 17 2013

From Mikael Aaltonen, Jan 17 2015: (Start)

a(n) = floor(sqrt(n) + 1/2).

a(n) = sqrt(A053187(n)). (End)

a(0) = 0, and a(n) = k for k from the closed interval [k^2 - k + 1, k*(k+1)] = [A002061(k), A002378(k)], for k >=1. See A053187. - Wolfdieter Lang, Mar 12 2019

a(n) = floor(2*sqrt(n)) - floor(sqrt(n)). - Ridouane Oudra, Jun 08 2020

Sum_{n>=1} 1/a(n)^s = 2*zeta(s-1), for s >2 (Borwein, 1994). - Amiram Eldar, Oct 31 2020

EXAMPLE

G.f. = x + x^2 + 2*x^3 + 2*x^4 + 2*x^5 + 2*x^6 + 3*x^7 + 3*x^8 + 3*x^9 + 3*x^10 + ...

MAPLE

Digits := 100; f := n->round(evalf(sqrt(n))); [ seq(f(n), n=0..100) ];

# More efficient:

a := n -> isqrt(n): seq(a(n), n=0..98); # Peter Luschny, Mar 13 2019

MATHEMATICA

A000194[n_] := Floor[(1 + Sqrt[4 n - 3])/2]; (* Enrique Pérez Herrero, Apr 14 2010 *)

Flatten[Table[PadRight[{}, 2n, n], {n, 10}]] (* Harvey P. Dale, Nov 16 2011 *)

PROG

(PARI) {a(n) = ceil( sqrtint(4*n) / 2)}; /* Michael Somos, Feb 11 2004 */

(PARI) a(n)=(sqrtint(4*n) + 1)\2 \\ Charles R Greathouse IV, Jun 08 2020

(Haskell)

a000194 n = a000194_list !! (n-1)

a000194_list = concat $ zipWith ($) (map replicate [2, 4..]) [1..]

-- Reinhard Zumkeller, Mar 18 2011

CROSSREFS

Cf. A000037, A002024, A002061, A002378, A053187, A105209, A259351.

Partial sums of A005369.

Sequence in context: A260999 A090532 A003058 * A168255 A097429 A100617

Adjacent sequences:  A000191 A000192 A000193 * A000195 A000196 A000197

KEYWORD

nonn,easy,nice

AUTHOR

N. J. A. Sloane

EXTENSIONS

Additional comments from Michael Somos, May 31 2000

Edited by M. F. Hasler, Mar 01 2014

Initial 0 added by N. J. A. Sloane, Nov 13 2017

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 16 21:28 EDT 2021. Contains 343951 sequences. (Running on oeis4.)