A004739 Concatenation of sequences (1,2,2,...,n-1,n-1,n,n,n-1,n-1,...,2,2,1) for n >= 1.
1, 1, 1, 2, 2, 1, 1, 2, 3, 3, 2, 1, 1, 2, 3, 4, 4, 3, 2, 1, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 9, 8, 7
Offset: 1
Examples
From _Boris Putievskiy_, Jan 24 2013: (Start) The start of the sequence as table: 1, 1, 2, 3, 4, 5, 6, ... 2, 1, 1, 2, 3, 4, 5, ... 3, 2, 1, 1, 2, 3, 4, ... 4, 3, 2, 1, 1, 2, 3, ... 5, 4, 3, 2, 1, 1, 2, ... 6, 5, 4, 3, 2, 1, 1, ... 7, 6, 5, 4, 3, 2, 1, ... ... The start of the sequence as triangle array read by rows: 1; 1, 1, 2; 2, 1, 1, 2, 3; 3, 2, 1, 1, 2, 3, 4; 4, 3, 2, 1, 1, 2, 3, 4, 5; 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6; 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7; ... Row number r contains 2*r - 1 numbers: r-1, r-2, ..., 1, 1, 2, ..., r. (End)
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Boris Putievskiy, Transformations [Of] Integer Sequences And Pairing Functions, arXiv preprint arXiv:1212.2732 [math.CO], 2012.
- F. Smarandache, Collected Papers, Vol. II
- F. Smarandache, Sequences of Numbers Involved in Unsolved Problems.
- Eric Weisstein's World of Mathematics, Smarandache Sequences
Programs
-
Haskell
a004739 n = a004739_list !! (n-1) a004739_list = concat $ map (\n -> [1..n] ++ [n,n-1..1]) [1..] -- Reinhard Zumkeller, Mar 26 2011
-
Mathematica
aa = {}; Do[Do[AppendTo[aa, (p/Pi) ArcSin[Sqrt[1/((1/Pi^2) (Zeta[2, k/p] + Zeta[2, (p - k)/p]))]]], {k, 1, p - 1}], {p, 3, 50, 2}]; Round[N[aa, 50]] (* Artur Jasinski, Mar 07 2010 *)
Formula
From Boris Putievskiy, Jan 24 2013: (Start)
For the general case,
a(n) = m*v + (2*v-1)*(t*t-n) + t, where t = floor(sqrt(n) - 1/2) + 1 and v = floor((n-1)/t) - t + 1.
For m=1,
a(n) = v + (2*v-1)*(t*t-n) + t, where t = floor(sqrt(n) - 1/2) + 1 and v = floor((n-1)/t) - t + 1. (End)
Extensions
More terms from Patrick De Geest, Jun 15 1998
Comments