%I #299 Dec 03 2023 01:43:13
%S 0,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,
%T 14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,24,49,25,
%U 51,26,53,27,55,28,57,29,59,30,61,31,63,32,65,33,67,34,69,35,71,36,73,37,75,38
%N a(n) = n if n odd, n/2 if n even.
%C a(n) is the size of largest conjugacy class in D_2n, the dihedral group with 2n elements. - Sharon Sela (sharonsela(AT)hotmail.com), May 14 2002
%C a(n+1) is the composition length of the n-th symmetric power of the natural representation of a finite subgroup of SL(2,C) of type D_4 (quaternion group). - _Paul Boddington_, Oct 23 2003
%C For n > 1, a(n) is the greatest common divisor of all permutations of {0, 1, ..., n} treated as base n + 1 integers. - _David Scambler_, Nov 08 2006 (see the Mathematics Stack Exchange link below).
%C From Dimitrios Choussos (choussos(AT)yahoo.de), May 11 2009: (Start)
%C Sequence A075888 and the above sequence are fitting together.
%C First 2 entries of this sequence have to be taken out.
%C In some cases two three or more sequenced entries of this sequence have to be added together to get the next entry of A075888.
%C Example: Sequences begin with 1, 3, 2, 5, 3, 7, 4, 9 (4 + 9 = 13, the next entry in A075888).
%C But it works out well up to primes around 50000 (haven't tested higher ones).
%C As A075888 gives a very regular graph. There seems to be a regularity in the primes. (End)
%C Starting with 1 = triangle A115359 * [1, 2, 3, ...]. - _Gary W. Adamson_, Nov 27 2009
%C From _Gary W. Adamson_, Dec 11 2009: (Start)
%C Let M be an infinite lower triangular matrix with (1, 1, 1, 0, 0, 0, ...) in every column, shifted down twice. This sequence starting with 1 = M * (1, 2, 3, ...)
%C M =
%C 1;
%C 1, 0;
%C 1, 1, 0;
%C 0, 1, 0, 0;
%C 0, 1, 1, 0, 0;
%C 0, 0, 1, 0, 0, 0;
%C 0, 0, 1, 1, 0, 0, 0;
%C ...
%C A026741 = M * (1, 2, 3, ...); but A002487 = lim_{n->infinity} M^n, a left-shifted vector considered as a sequence. (End)
%C A particular case of sequence for which a(n+3) = (a(n+2) * a(n+1)+q)/a(n) for every n > n0. Here n0 = 1 and q = -1. - _Richard Choulet_, Mar 01 2010
%C For n >= 2, a(n+1) is the smallest m such that s_n(2*m*(n-1))/(n-1) is even, where s_b(c) is the sum of digits of c in base b. - _Vladimir Shevelev_, May 02 2011
%C A001477 and A005408 interleaved. - _Omar E. Pol_, Aug 22 2011
%C Numerator of n/((n-1)*(n-2)). - _Michael B. Porter_, Mar 18 2012
%C Number of odd terms of n-th row in the triangles A162610 and A209297. - _Reinhard Zumkeller_, Jan 19 2013
%C For n >= 3, a(n) is the periodic of integer of spiral length ratio of spiral that have (n-1) circle centers. See illustration in links. - _Kival Ngaokrajang_, Dec 28 2013
%C This is the sequence of Lehmer numbers u_n(sqrt(R), Q) with the parameters R = 4 and Q = 1. It is a strong divisibility sequence, that is, gcd(a(n), a(m)) = a(gcd(n, m)) for all natural numbers n and m. Cf. A005013 and A108412. - _Peter Bala_, Apr 18 2014
%C The sequence of convergents of the 2-periodic continued fraction [0; 1, -4, 1, -4, ...] = 1/(1 - 1/(4 - 1/(1 - 1/(4 - ...)))) = 2 begins [0/1, 1/1, 4/3, 3/2, 8/5, 5/3, 12/7, ...]. The present sequence is the sequence of denominators; the sequence of numerators of the continued fraction convergents [0, 1, 4, 3, 8, 5, 12, ...] is A022998, also a strong divisibility sequence. - _Peter Bala_, May 19 2014
%C For n >= 3, (a(n-2)/a(n))*Pi = vertex angle of a regular n-gon. See illustration in links. - _Kival Ngaokrajang_, Jul 17 2014
%C For n > 1, the numerator of the harmonic mean of the first n triangular numbers. - _Colin Barker_, Nov 13 2014
%C The difference sequence is a permutation of the integers. - _Clark Kimberling_, Apr 19 2015
%C From _Timothy Hopper_, Feb 26 2017: (Start)
%C Given the function a(n, p) = n/p if n mod p = 0, else n, then a possible formula is: a(n, p) = n*(1 + (p-1)*((n^(p-1)) mod p))/p, p prime, (n^(p-1)) mod p = 1, n not divisible by p. (Fermat's Little Theorem). Examples: p = 2; a(n), p = 3; A051176(n), p = 5; A060791(n), p = 7; A106608(n).
%C Conjecture: lcm(n, p) = p*a(n, p), gcd(n, p) = n/a(n, p).
%C (End)
%C Let r(n) = (a(n+1) + 1)/a(n+1) if n mod 2 = 1, a(n+1)/(a(n+1) + 2) otherwise; then lim_{k->oo} 2^(k+2) * Product_{n=0..k} r(n)^(k-n) = Pi. - _Dimitris Valianatos_, Mar 22 2021
%D David Wells, Prime Numbers: The Most Mysterious Figures in Math. Hoboken, New Jersey: John Wiley & Sons (2005), p. 53.
%D David Wells, The Penguin Dictionary of Curious and Interesting Numbers, 2nd Ed. Penguin (1997), p. 79.
%H Vincenzo Librandi, <a href="/A026741/b026741.txt">Table of n, a(n) for n = 0..10000</a>
%H Isabel Cação, Helmuth R. Malonek, Maria Irene Falcão, and Graça Tomaz, <a href="https://www.emis.de/journals/JIS/VOL21/Falcao/falcao2.html">Combinatorial Identities Associated with a Multidimensional Polynomial Sequence</a>, J. Int. Seq., Vol. 21 (2018), Article 18.7.4.
%H John M. Campbell, <a href="http://arxiv.org/abs/1105.3399">An Integral Representation of Kekulé Numbers, and Double Integrals Related to Smarandache Sequences</a>, arXiv:1105.3399 [math.GM], 2011.
%H Leonhard Euler, <a href="http://math.dartmouth.edu/~euler/pages/E542.html">De mirabilibus proprietatibus numerorum pentagonalium</a>, par. 2
%H Leonhard Euler, <a href="http://arXiv.org/abs/math.HO/0505373">On the remarkable properties of the pentagonal numbers</a>, arXiv:math/0505373 [math.HO], 2005.
%H Y. Ito and I. Nakamura, <a href="http://www.math.sci.hokudai.ac.jp/~nakamura/ADEHilb.pdf">Hilbert schemes and simple singularities</a>, New trends in algebraic geometry (Warwick, 1996), 151-233, Cambridge University Press, 1999.
%H Masanobu Kaneko, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL3/KANEKO/AT-kaneko.html">The Akiyama-Tanigawa algorithm for Bernoulli numbers</a>, J. Integer Sequences, 3 (2000), #00.2.9.
%H Mathematics Stack Exchange, <a href="http://math.stackexchange.com/questions/210578">Permutations (with no duplicates) of decimal base digits 1,2,...,8,9,0</a>
%H Kival Ngaokrajang, <a href="/A026741/a026741.pdf">Illustration of spiral with circle centers 2..5</a>
%H Kival Ngaokrajang, <a href="/A026741/a026741_1.pdf">Illustration of vertex angle of regular n-gon for n = 3..7</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SimplexSimplexPicking.html">Simplex Simplex Picking</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/LehmerNumber.html">Lehmer Number</a>
%H <a href="/index/Di#divseq">Index to divisibility sequences</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1).
%F G.f.: x*(1 + x + x^2)/(1-x^2)^2. - _Len Smiley_, Apr 30 2001
%F a(n) = 2*a(n-2) - a*(n-4) for n >= 4.
%F a(n) = n * 2^((n mod 2) - 1). - _Reinhard Zumkeller_, Oct 16 2001
%F a(n) = 2*n/(3 + (-1)^n). - _Benoit Cloitre_, Mar 24 2002
%F Multiplicative with a(2^e) = 2^(e-1) and a(p^e) = p^e, p > 2. - _Vladeta Jovovic_, Apr 05 2002
%F a(n) = n / gcd(n, 2). a(n)/A045896(n) = n/((n+1)*(n+2)).
%F For n > 0, a(n) = denominator of Sum_{i=1..n-1} 2/(i*(i+1)), numerator=A022998. - _Reinhard Zumkeller_, Apr 21 2012, Jul 25 2002 [thanks to _Phil Carmody_ who noticed an error]
%F For n > 1, a(n) = GCD of the n-th and (n-1)th triangular numbers (A000217). - _Ross La Haye_, Sep 13 2003
%F Euler transform of finite sequence [1, 2, -1]. - _Michael Somos_, Jun 15 2005
%F G.f.: x * (1 - x^3) / ((1 - x) * (1 - x^2)^2) = Sum_{k>0} k * (x^k - x^(2*k)). - _Michael Somos_, Jun 15 2005
%F a(n+3) + a(n+2) = 3 + a(n+1) + a(n). a(n+3) * a(n) = - 1 + a(n+2) * a(n+1). a(n) = -a(-n) for all n in Z. - _Michael Somos_, Jun 15 2005
%F For n > 1, a(n) is the numerator of the average of 1, 2, ..., n - 1; i.e., numerator of A000217(n-1)/(n-1), with corresponding denominators [1, 2, 1, 2, ...] (A000034). - _Rick L. Shepherd_, Jun 05 2006
%F Equals A126988 * (1, -1, 0, 0, 0, ...). - _Gary W. Adamson_, Apr 17 2007
%F For n >= 1, a(n) = gcd(n,A000217(n)). - _Rick L. Shepherd_, Sep 12 2007
%F a(n) = numerator(n/(2*n-2)) for n >= 2; A022998(n-1) = denominator(n/(2*n-2)) for n >= 2. - _Johannes W. Meijer_, Jun 18 2009
%F a(n) = A167192(n+2, 2). - _Reinhard Zumkeller_, Oct 30 2009
%F a(n) = A106619(n) * A109012(n). - _Paul Curtz_, Apr 04 2011
%F From _R. J. Mathar_, Apr 18 2011: (Start)
%F a(n) = A109043(n)/2.
%F Dirichlet g.f.: zeta(s-1)*(1 - 1/2^s). (End)
%F a(n) = A001318(n) - A001318(n-1) for n > 0. - _Jonathan Sondow_, Jan 28 2013
%F a((2*n+1)*2^p - 1) = 2^p - 1 + n*A151821(p+1), p >= 0 and n >= 0. - _Johannes W. Meijer_, Feb 03 2013
%F a(n+1) = denominator(H(n, 1)), n >= 0, with H(n, 1) = 2*n/(n+1) the harmonic mean of n and 1. a(n+1) = A227042(n, 1). See the formula a(n) = n/gcd(n, 2) given above. - _Wolfdieter Lang_, Jul 04 2013
%F a(n) = numerator(n/2). - _Wesley Ivan Hurt_, Oct 02 2013
%F a(n) = numerator(1 - 2/(n+2)), n >= 0; a(n) = denominator(1 - 2/n), n >= 1. - _Kival Ngaokrajang_, Jul 17 2014
%F a(n) = Sum_{i = floor(n/2)..floor((n+1)/2)} i. - _Wesley Ivan Hurt_, Apr 27 2016
%F Euler transform of length 3 sequence [1, 2, -1]. - _Michael Somos_, Jan 20 2017
%F G.f.: x / (1 - x / (1 - 2*x / (1 + 7*x / (2 - 9*x / (7 - 4*x / (3 - 7*x / (2 + 3*x))))))). - _Michael Somos_, Jan 20 2017
%F From _Peter Bala_, Mar 24 2019: (Start)
%F a(n) = Sum_{d|n, n/d odd} phi(d), where phi(n) is the Euler totient function A000010.
%F O.g.f.: Sum_{n >= 1} phi(n)*x^n/(1 - x^(2*n)). (End)
%F a(n) = A256095(2*n,n). - _Alois P. Heinz_, Jan 21 2020
%F E.g.f.: x*(2*cosh(x) + sinh(x))/2. - _Stefano Spezia_, Apr 28 2023
%F From _Ctibor O. Zizka_, Oct 05 2023: (Start)
%F For k >= 0, a(k) = gcd(k + 1, k*(k + 1)/2).
%F If (k mod 4) = 0 or 2 then a(k) = (k + 1).
%F If (k mod 4) = 1 or 3 then a(k) = (k + 1)/2. (End)
%F Sum_{n=1..oo} 1/a(n)^2 = 7*Pi^2/24. - _Stefano Spezia_, Dec 02 2023
%e G.f. = x + x^2 + 3*x^3 + 2*x^4 + 5*x^5 + 3*x^6 + 7*x^7 + 4*x^8 + ...
%p A026741 := proc(n) if type(n,'odd') then n; else n/2; end if; end proc: seq(A026741(n), n=0..76); # _R. J. Mathar_, Jan 22 2011
%t Numerator[Abs[Table[Det[DiagonalMatrix[Table[1/i^2 - 1, {i, 1, n - 1}]] + 1], {n, 20}]]] (* _Alexander Adamchuk_, Jun 02 2006 *)
%t halfMax = 40; Riffle[Range[0, halfMax], Range[1, 2halfMax + 1, 2]] (* _Harvey P. Dale_, Mar 27 2011 *)
%t a[ n_] := Numerator[n / 2]; (* _Michael Somos_, Jan 20 2017 *)
%t Array[If[EvenQ[#],#/2,#]&,80,0] (* _Harvey P. Dale_, Jul 08 2023 *)
%o (PARI) a(n) = numerator(n/2) \\ _Rick L. Shepherd_, Sep 12 2007
%o (Sage) [lcm(n, 2) / 2 for n in range(77)] # _Zerinvary Lajos_, Jun 07 2009
%o (Magma) [2*n/(3+(-1)^n): n in [0..70]]; // _Vincenzo Librandi_, Aug 14 2011
%o (Haskell)
%o import Data.List (transpose)
%o a026741 n = a026741_list !! n
%o a026741_list = concat $ transpose [[0..], [1,3..]]
%o -- _Reinhard Zumkeller_, Dec 12 2011
%o (Python)
%o def A026741(n): return n if n % 2 else n//2 # _Chai Wah Wu_, Apr 02 2021
%Y Signed version is in A030640. Partial sums give A001318.
%Y Cf. A051176, A060819, A060791, A060789 for n / gcd(n, k) with k = 3..6. See also A106608 thru A106612 (k = 7 thru 11), A051724 (k = 12), A106614 thru A106621 (k = 13 thru 20).
%Y Cf. A045896, A022998, A060762, A126988, A109007, A130334, A109043, A115359, A002487, A220466.
%Y Cf. A013942.
%Y Cf. A227042 (first column). Cf. A005013 and A108412.
%Y Cf. A256095.
%K nonn,easy,nice,frac,mult
%O 0,4
%A J. Carl Bellinger (carlb(AT)ctron.com)
%E Better description from _Jud McCranie_
%E Edited by _Ralf Stephan_, Jun 04 2003