A004737 Concatenation of sequences (1,2,...,n-1,n,n-1,...,1) for n >= 1.
1, 1, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 4, 3, 2, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5
Offset: 1
Examples
From _Boris Putievskiy_, Jan 13 2013: (Start) The start of the sequence as a table: 1 1 1 1 1 1 ... 1 2 2 2 2 2 ... 1 2 3 3 3 3 ... 1 2 3 4 4 4 ... 1 2 3 4 5 5 ... 1 2 3 4 5 6 ... ... The start of the sequence as an irregular triangle array read by rows: 1; 1,2,1; 1,2,3,2,1; 1,2,3,4,3,2,1; 1,2,3,4,5,4,3,2,1; 1,2,3,4,5,6,5,4,3,2,1; ... Row number k contains 2*k-1 numbers: 1,2,...,k-1,k,k-1,...,1. (End) The sequence of fractions A196199/A004737 = 0/1, -1/1, 0/2, 1/1, -2/1, -1/2, 0/3, 1/2, 2/1, -3/1, -2/2, -1/3, 0/4, 1/3, 2/2, 3/1, -4/4. -3/2, ... contains every rational number (infinitely often) [Laczkovich]. - _N. J. A. Sloane_, Oct 09 2013
References
- Miklós Laczkovich, Conjecture and Proof, TypoTex, Budapest, 1998. See Chapter 10.
- F. Smarandache, "Numerical Sequences", University of Craiova, 1975.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Jerry Brown et al., Problem 4619, School Science and Mathematics, USA, Vol. 97 (4), 1997, pp. 221-222.
- L. E. Jeffery, Danzer matrices (definitions)
- Boris Putievskiy, Transformations [of] Integer Sequences And Pairing Functions arXiv:1212.2732 [math.CO], 2012.
- F. Smarandache, Collected Papers, Vol. II, Tempus Publ. Hse., Bucharest, 1996.
- F. Smarandache, Sequences of Numbers Involved in Unsolved Problems, Hexis, Phoenix, 2006.
- Eric Weisstein's World of Mathematics, Smarandache Sequences.
Programs
-
Haskell
import Data.List (inits) a004737 n = a004737_list !! (n-1) a004737_list = concatMap f $ tail $ inits [1..] where f xs = xs ++ tail (reverse xs) -- Reinhard Zumkeller, May 11 2014, Mar 26 2011
-
Mathematica
Table[Min[n - #^2, (# + 1)^2 - n + 1] &@ Floor[Sqrt[n - 1]], {n, 105}] (* or *) Table[Floor@ # - Abs[n - Floor[#]^2 - Floor@ # - 1] + 1 &@ Sqrt[n - 1], {n, 105}] (* Michael De Vlieger, Oct 21 2016 *) Table[Join[Range[n],Range[n-1,1,-1]],{n,20}]//Flatten (* Harvey P. Dale, Dec 27 2019 *)
-
PARI
a(n) = n--;my(m=sqrtint(n));m+1-abs(n-m^2-m) \\ David A. Corneth, Oct 18 2016
Formula
a(n) = if n<3 then 1 else (if a(n-1)=1 then 1 + 0^(a(n-2)-1) else a(n-1) - 0^X + (a(n-1)-a(n-2))*(1 - 0^X)), where X = A003059(n-1)-a(n-1). - Reinhard Zumkeller, Mar 10 2006
Let b(n) = floor(sqrt(n-1)). Then a(n) = min(n - b(n)^2, (b(n)+1)^2 - n + 1). - Franklin T. Adams-Watters, Jun 09 2006
Ordinal transform of A004741. - Franklin T. Adams-Watters, Aug 28 2006
If the sequence is read as a triangular array, beginning [1]; [1,2,1]; [1,2,3,2,1]; ..., then the o.g.f. is (1+qx)/((1-x)(1-qx)(1-q^2x)) = 1 + x(1 + 2q + q^2) + x^2(1 + 2q + 3q^2 + 2q^3 +q^4) + .... The row polynomials for this triangle are (1 + q + ... + q^n)^2 =[n,2]A008967).%20-%20_Peter%20Bala">q + q[n-1,2]_q, where [n,2]_q are Gaussian polynomials (see A008967). - _Peter Bala, Sep 23 2007
a(n) = floor(sqrt(n-1)) - |n - floor(sqrt(n-1))^2 - floor(sqrt(n-1)) - 1| + 1. - Boris Putievskiy, Jan 13 2013
Read as a triangular array, then T(n,k) = n - |n-k-1|; T(n,0) = 1; T(n,n-1) = n. - Juan Pablo Herrera P., Oct 17 2016
Extensions
More terms from Patrick De Geest, Jun 15 1998
Comments