A003059 k appears 2k-1 times. Also, square root of n, rounded up.
1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 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, 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, 10, 10, 10, 10, 10, 10, 10
Offset: 1
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
- Michael Somos, Sequences used for indexing triangular or square arrays.
- Eric Weisstein's World of Mathematics, Burning Number
- Eric Weisstein's World of Mathematics, Cycle Graph
- Eric Weisstein's World of Mathematics, Path Graph
Programs
-
Haskell
a003059 n = a003059_list !! (n-1) a003059_list = concat $ zipWith ($) (map replicate [1,3..]) [1..] -- Reinhard Zumkeller, Mar 18 2011
-
Magma
[Ceiling(Sqrt(n)): n in [1..100]]; // G. C. Greubel, Nov 14 2018
-
Maple
A003059:=n->ceil(sqrt(n)); seq(A003059(k), k=1..100); # Wesley Ivan Hurt, Nov 08 2013
-
Mathematica
Table[ Table[n, {2n - 1}], {n, 1, 10}] // Flatten (* Jean-François Alcover, Jun 10 2013 *) Ceiling[Sqrt[Range[100]]] (* G. C. Greubel, Nov 14 2018 *) Table[PadRight[{},2k-1,k],{k,10}]//Flatten (* Harvey P. Dale, Jun 07 2020 *)
-
PARI
a(n)=if(n<1,0,1+sqrtint(n-1))
-
Python
from math import isqrt def A003059(n): return isqrt(n-1)+1 # Chai Wah Wu, Nov 14 2022
-
Sage
[ceil(sqrt(n)) for n in (1..100)] # G. C. Greubel, Nov 14 2018
Formula
a(n) = ceiling(sqrt(n)).
G.f.: (Sum_{n>=0} x^(n^2)) * x/(1-x). - Michael Somos, May 03 2003
a(n) = Sum_{k=0..n-1} A010052(k). - Reinhard Zumkeller, Mar 01 2009
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2) (A002162). - Amiram Eldar, Sep 29 2022
Extensions
Name edited by M. F. Hasler, Nov 13 2018
Comments