cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A059029 a(n) = n if n is even, 2*n + 1 if n is odd.

This page as a plain text file.
%I A059029 #41 Jul 23 2025 19:36:20
%S A059029 0,3,2,7,4,11,6,15,8,19,10,23,12,27,14,31,16,35,18,39,20,43,22,47,24,
%T A059029 51,26,55,28,59,30,63,32,67,34,71,36,75,38,79,40,83,42,87,44,91,46,95,
%U A059029 48,99,50,103,52,107,54,111,56,115,58,119,60,123,62,127,64,131,66,135
%N A059029 a(n) = n if n is even, 2*n + 1 if n is odd.
%C A059029 a(n-1) = n^k - 1 mod 2*n, n >= 1, for any k >= 2, also for k = n. - _Wolfdieter Lang_, Dec 21 2011
%H A059029 Vincenzo Librandi, <a href="/A059029/b059029.txt">Table of n, a(n) for n = 0..10000</a>
%H A059029 <a href="/index/Tu#2wis">Index entries for two-way infinite sequences</a>
%H A059029 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1).
%F A059029 G.f.: x*(x^2 + 2*x + 3)/(1 - x^2)^2. - _Ralf Stephan_, Jun 10 2003
%F A059029 Third main diagonal of A059026: a(n) = B(n+2, n) = lcm(n+2, n)/(n+2) + lcm(n+2, n)/n - 1 for all n >= 1.
%F A059029 a(2*n) + a(2*n+1) = A016945(n). - _Paul Curtz_, Aug 29 2008
%F A059029 E.g.f.: 2*x*cosh(x) + (1 + x)*sinh(x). - _Franck Maminirina Ramaharo_, Nov 08 2018
%p A059029 B := (n,m) -> lcm(n,m)/n + lcm(n,m)/m - 1: seq(B(m+2,m),m=1..90);
%t A059029 Table[n +(n+1)*(1-(-1)^n)/2, {n,0,70}] (* _G. C. Greubel_, Nov 08 2018 *)
%t A059029 Table[If[EvenQ[n],n,2n+1],{n,0,70}] (* or *) LinearRecurrence[{0,2,0,-1},{0,3,2,7},70] (* _Harvey P. Dale_, Jul 23 2025 *)
%o A059029 (PARI) a(n)=if(n%2,2*n+1,n)
%o A059029 (Magma) [n+((n+1)/2)*(1-(-1)^n): n in [0..70]]; // _Vincenzo Librandi_, Aug 14 2011
%Y A059029 Cf. A059026, A059030, A059031.
%Y A059029 a(n) = A022998(n+1) - 1 = A043547(n+3) - 3. Partial sums in A032438.
%K A059029 nonn,easy
%O A059029 0,2
%A A059029 _Asher Auel_, Dec 15 2000
%E A059029 New description from _Ralf Stephan_, Jun 10 2003