# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a004738 Showing 1-1 of 1 %I A004738 #43 Apr 21 2020 11:03:03 %S A004738 1,2,1,2,3,2,1,2,3,4,3,2,1,2,3,4,5,4,3,2,1,2,3,4,5,6,5,4,3,2,1,2,3,4, %T A004738 5,6,7,6,5,4,3,2,1,2,3,4,5,6,7,8,7,6,5,4,3,2,1,2,3,4,5,6,7,8,9,8,7,6, %U A004738 5,4,3,2,1,2,3,4,5,6,7,8,9,10,9,8,7,6,5,4,3,2,1,2,3,4,5,6,7,8,9,10,11,10,9 %N A004738 Concatenation of sequences (1,2,...,n-1,n,n-1,...,2) for n >= 2. %C A004738 Also concatenation of sequences n,n-1,...,2,1,2,...,n-1,n. %C A004738 Table T(n,k) n, k > 0, T(n,k) = n-k+1, if n >= k, T(n,k) = k-n+1, if n < k. Table read by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). General case A209301. Let m be a natural number. The first column of the table T(n,1) is the sequence of the natural numbers A000027. In all columns with number k (k > 1) the segment with the length of (k-1): {m+k-2, m+k-3, ..., m} shifts the sequence A000027. For m=1 the result is A004739, for m=2 the result is A004738, for m=3 the result is A209301. - _Boris Putievskiy_, Jan 24 2013 %D A004738 F. Smarandache, "Numerical Sequences", University of Craiova, 1975; [ See Arizona State University, Special Collection, Tempe, AZ, USA ]. %H A004738 Boris Putievskiy, Transformations [Of] Integer Sequences And Pairing Functions, arXiv preprint arXiv:1212.2732 [math.CO], 2012. %H A004738 F. Smarandache, Collected Papers, Vol. II %H A004738 F. Smarandache, Sequences of Numbers Involved in Unsolved Problems. %H A004738 Eric Weisstein's World of Mathematics, Smarandache Sequences %F A004738 a(n) = floor(sqrt(n) + 1/2) + 1 - abs(n - 1 - (floor(sqrt(n) + 1/2))^2). - _Benoit Cloitre_, Feb 08 2003 %F A004738 From _Boris Putievskiy_, Jan 24 2013: (Start) %F A004738 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. %F A004738 For m=2, a(n) = 2*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) %e A004738 From _Boris Putievskiy_, Jan 24 2013: (Start) %e A004738 The start of the sequence as table: %e A004738 1, 2, 3, 4, 5, 6, 7, ... %e A004738 2, 1, 2, 3, 4, 5, 6, ... %e A004738 3, 2, 1, 2, 3, 4, 5, ... %e A004738 4, 3, 2, 1, 2, 3, 4, ... %e A004738 5, 4, 3, 2, 1, 2, 3, ... %e A004738 6, 5, 4, 3, 2, 1, 2, ... %e A004738 7, 6, 5, 4, 3, 2, 1, ... %e A004738 ... %e A004738 The start of the sequence as triangle array read by rows: %e A004738 1; %e A004738 2, 1, 2; %e A004738 3, 2, 1, 2, 3; %e A004738 4, 3, 2, 1, 2, 3, 4; %e A004738 5, 4, 3, 2, 1, 2, 3, 4, 5; %e A004738 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6; %e A004738 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 7; %e A004738 ... %e A004738 Row number r contains 2*r - 1 numbers: r, r-1, ..., 1, 2, ..., r. (End) %p A004738 A004738 := proc(n) %p A004738 local tri ; %p A004738 tri := floor(sqrt(n)+1/2) ; %p A004738 tri+1-abs(n-1-tri^2) ; %p A004738 end proc: %p A004738 seq(A004738(n),n=1..30) ; #_R. J. Mathar_, Feb 14 2019 %t A004738 row[n_] := Range[n, 1, -1] ~Join~ Range[2, n]; %t A004738 Array[row, 10] // Flatten (* _Jean-François Alcover_, Apr 19 2020 *) %o A004738 (PARI) a(n)= floor(sqrt(n)+1/2)+1-abs(n-1-(floor(sqrt(n)+1/2)-1/2)^2) %Y A004738 Cf. A004737, A004739, A187760, A079813, A209301. %K A004738 nonn,easy %O A004738 1,2 %A A004738 R. Muller %E A004738 More terms from _Patrick De Geest_, Jun 15 1998 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE