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!)
A001670 n appears n times (n even). 7
2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 16, 16, 16 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 1..10000

FORMULA

a(n) = 2*floor( 1/2 + sqrt(n)). - Antonio Esposito (antonio.b.esposito(AT)italtel.it), Jan 21 2002

With a different offset: g.f. = Sum(i=0, inf, 2*x^(i^2+i)/(1-x)). - Ralf Stephan, Mar 11 2003

a(1)=2, a(2)=2, a(n)=a(n-a(n-2))+2 [From Branko Curgus, May 11 2010]

a(n) = 2*round(sqrt(n)). - Branko Curgus, May 11 2010

G.f.: x^(3/4)*theta_2(0,x)/(1-x) where theta_2 is the second Jacobi theta function. - Robert Israel, Jan 14 2015

a(n) = 2*floor((sqrt(4*n-3)+1)/2). - Néstor Jofré, Apr 24 2017

MAPLE

seq(2*n $ 2*n, n = 1 .. 10); # Robert Israel, Jan 14 2015

MATHEMATICA

a[1]=2, a[2]=2, a[n_]:=a[n]=a[n-a[n-2]]+2 (* Branko Curgus, May 11 2010 *)

Flatten[Table[Table[n, {n}], {n, 2, 16, 2}]] (* Harvey P. Dale, May 31 2012 *)

PROG

(MAGMA) [2*Round(Sqrt(n)): n in [1..70]]; // Vincenzo Librandi, Jun 23 2011

(PARI) a(n)=round(sqrt(n))<<1 \\ Charles R Greathouse IV, Jun 23 2011

(MATLAB) a = @(n) 2*floor((sqrt(4*n-3)+1)/2); % handle function // Néstor Jofré, Apr 24 2017

CROSSREFS

Cf. A001650, A000194.

Equals A130829(n) - 1.

Sequence in context: A035683 A261009 A239896 * A100144 A076222 A177692

Adjacent sequences:  A001667 A001668 A001669 * A001671 A001672 A001673

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane

EXTENSIONS

The first formula corrected by Branko Curgus, May 11 2010

Offset changed from 2 to 1 by Vincenzo Librandi, Jun 23 2011

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 April 11 22:01 EDT 2021. Contains 342888 sequences. (Running on oeis4.)