login
a(n) = Sum_{k=0..n} (k mod 3) (i.e., partial sums of A010872).
31

%I #98 Sep 17 2022 03:45:00

%S 0,1,3,3,4,6,6,7,9,9,10,12,12,13,15,15,16,18,18,19,21,21,22,24,24,25,

%T 27,27,28,30,30,31,33,33,34,36,36,37,39,39,40,42,42,43,45,45,46,48,48,

%U 49,51,51,52,54,54,55,57,57,58,60,60,61,63,63,64,66,66,67,69,69,70,72,72

%N a(n) = Sum_{k=0..n} (k mod 3) (i.e., partial sums of A010872).

%C Essentially the same as A092200. - _R. J. Mathar_, Jun 13 2008

%C Let A be the Hessenberg n X n matrix defined by: A[1,j]=j mod 3, A[i,i]:=1, A[i,i-1]=-1. Then, for n>=1, a(n)=det(A). - _Milan Janjic_, Jan 24 2010

%C 2-adic valuation of A104537(n+1). - _Gerry Martens_, Jul 14 2015

%C Conjecture: a(n) is the exponent of the largest power of 2 that divides all the entries of the matrix {{3,1},{1,-1}}^n. - _Greg Dresden_, Sep 09 2018

%H Vincenzo Librandi, <a href="/A130481/b130481.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1).

%F a(n) = 3*floor(n/3) + A010872(n)*(A010872(n) + 1)/2.

%F G.f.: x*(1 + 2*x)/((1-x^3)*(1-x)).

%F a(n) = n + 1 - (Fibonacci(n+1) mod 2). - _Gary Detlefs_, Mar 13 2011

%F a(n) = floor((n+1)/3) + floor(2*(n+1)/3). - _Clark Kimberling_, May 28 2010

%F a(n) = n when n+1 is not a multiple of 3, and a(n) = n+1 when n+1 is a multiple of 3. - _Dennis P. Walsh_, Aug 06 2012

%F a(n) = n + 1 - sign((n+1) mod 3). - _Wesley Ivan Hurt_, Sep 25 2017

%F a(n) = n + (1-cos(2*(n+2)*Pi/3))/3 + sin(2*(n+2)*Pi/3)/sqrt(3). - _Wesley Ivan Hurt_, Sep 27 2017

%F a(n) = n + 1 - (n+1)^2 mod 3. - _Ammar Khatab_, Aug 14 2020

%F E.g.f.: ((1 + 3*x)*cosh(x) - (cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2))*(cosh(x/2) - sinh(x/2)) + (1 + 3*x)*sinh(x))/3. - _Stefano Spezia_, May 28 2021

%F Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/(3*sqrt(3)) + log(2)/3. - _Amiram Eldar_, Sep 17 2022

%p seq(coeff(series(x*(1+2*x)/((1-x^3)*(1-x)), x, n+1), x, n), n = 0..80); # _G. C. Greubel_, Aug 31 2019

%t a[n_]:= Floor[(n+1)/3] + Floor[2(n+1)/3]; Table[a[n], {n, 0, 80}] (* _Clark Kimberling_, May 28 2012 *)

%t a[n_]:= IntegerExponent[A104537[n + 1], 2];

%t Table[a[n], {n, 0, 80}] (* _Gerry Martens_, Jul 14 2015 *)

%t CoefficientList[Series[x(1+2x)/((1-x^3)(1-x)), {x, 0, 80}], x] (* _Stefano Spezia_, Sep 09 2018 *)

%t LinearRecurrence[{1,0,1,-1},{0,1,3,3},100] (* _Harvey P. Dale_, Jun 14 2021 *)

%o (PARI) main(size)=my(n,k);vector(size,n,sum(k=0,n,k%3)) \\ _Anders Hellström_, Jul 14 2015

%o (PARI) first(n)=my(s); concat(0, vector(n,k,s+=k%3)) \\ _Charles R Greathouse IV_, Jul 14 2015

%o (PARI) a(n)=n\3*3+[0,1,3][n%3+1] \\ _Charles R Greathouse IV_, Jul 14 2015

%o (Magma) [Floor((n+1)/3) + Floor(2*(n+1)/3): n in [0..80]]; // _G. C. Greubel_, Aug 31 2019

%o (Sage)

%o def A130481_list(prec):

%o P.<x> = PowerSeriesRing(ZZ, prec)

%o return P(x*(1+2*x)/((1-x^3)*(1-x))).list()

%o A130481_list(80) # _G. C. Greubel_, Aug 31 2019

%o (GAP) List([0..80], n-> Int((n+1)/3) + Int(2*(n+1)/3)); # _G. C. Greubel_, Aug 31 2019

%Y Cf. A010872, A010873, A010874, A010875, A010876, A010877, A130482, A130483, A130484.

%Y Cf. A092200, A104537.

%K nonn,easy

%O 0,3

%A _Hieronymus Fischer_, May 29 2007