[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A242774
a(n) = ceiling( n / 2 ) + ceiling( n / 3 ).
2
2, 2, 3, 4, 5, 5, 7, 7, 8, 9, 10, 10, 12, 12, 13, 14, 15, 15, 17, 17, 18, 19, 20, 20, 22, 22, 23, 24, 25, 25, 27, 27, 28, 29, 30, 30, 32, 32, 33, 34, 35, 35, 37, 37, 38, 39, 40, 40, 42, 42, 43, 44, 45, 45, 47, 47, 48, 49, 50, 50, 52, 52, 53, 54, 55, 55, 57
OFFSET
1,1
FORMULA
G.f.: x * (2 + 2*x + x^2) / (1 - x^2 - x^3 + x^5) = (2*x + 2*x^2 + x^3) / ((1 - x^2) * (1 - x^3)).
a(n) = - A010761(-n) = 2 - a(1-n). a(n) = A002789(n) - A002789(n-1) for all n in Z.
a(n) = Sum_{k=1..n} A000035(k) + A000035(A010872(k)). - Benedict W. J. Irwin, Apr 13 2016
E.g.f.: 5*x*exp(x)/6 - exp(-x)/4 + 7*exp(x)/12 + sin(sqrt(3)*x/2)*exp(-x/2)/(3*sqrt(3)) - cos(sqrt(3)*x/2)*exp(-x/2)/3. - Ilya Gutkovskiy, Apr 13 2016
EXAMPLE
G.f. = 2*x + 2*x^2 + 3*x^3 + 4*x^4 + 5*x^5 + 5*x^6 + 7*x^7 + 7*x^8 + ...
MAPLE
A242774:=n->ceil(n/2)+ceil(n/3): seq(A242774(n), n=1..100); # Wesley Ivan Hurt, Apr 13 2016
MATHEMATICA
a[ n_] := Ceiling[ n / 2 ] + Ceiling[ n / 3 ];
LinearRecurrence[{0, 1, 1, 0, -1}, {2, 2, 3, 4, 5}, 100] (* Vincenzo Librandi, Apr 15 2016 *)
Rest[CoefficientList[Series[x*(2+2*x+x^2)/(1-x^2-x^3+x^5), {x, 0, 50}], x]] (* G. C. Greubel, Aug 06 2018 *)
PROG
(PARI) {a(n) = ceil( n / 2 ) + ceil( n / 3 )};
(PARI) {a(n) = if( n<0, polcoeff( -(x^2 + 2*x^3 + 2*x^4) / ((1 - x^2) * (1 - x^3)) + x * O(x^-n), -n), polcoeff( (2*x + 2*x^2 + x^3) / ((1 - x^2) * (1 - x^3)) + x * O(x^n), n))};
(Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(x*(2+2*x+x^2)/(1-x^2-x^3+x^5))); // G. C. Greubel, Aug 06 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael Somos, May 22 2014
STATUS
approved