login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A257174 a(n) = 4*n/3 if n = 3*k and n!=0, otherwise a(n) = n except a(0) = 1. 2

%I #24 Dec 29 2022 06:30:19

%S 1,1,2,4,4,5,8,7,8,12,10,11,16,13,14,20,16,17,24,19,20,28,22,23,32,25,

%T 26,36,28,29,40,31,32,44,34,35,48,37,38,52,40,41,56,43,44,60,46,47,64,

%U 49,50,68,52,53,72,55,56,76,58,59,80,61,62,84,64,65,88

%N a(n) = 4*n/3 if n = 3*k and n!=0, otherwise a(n) = n except a(0) = 1.

%D This is a divisibility sequence.

%H G. C. Greubel, <a href="/A257174/b257174.txt">Table of n, a(n) for n = 0..2500</a>

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

%F Euler transform of length 5 sequence [1, 1, 2, -1, -1].

%F a(n) is multiplicative with a(0) = 1, a(3^e) = 4*3^(e-1) if e>0, a(p^e) = p^e otherwise.

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

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

%F a(3*n) = A008574(n).

%F a(n) = -a(-n) for all n in Z except n=0.

%F From _Wesley Ivan Hurt_, Apr 27 2015: (Start)

%F a(n) = 2*a(n-3)-a(n-6).

%F a(n) = n*(4+floor(n/3)+floor(-n/3))/3 for n>0. (End)

%F a(n) = (-1)^n * A280057(n). - _Michael Somos_, Dec 30 2016

%F G.f.: 1 + x / (1 - x)^2 + x^3 / (1 - x^3)^2. - _Michael Somos_, Dec 30 2016

%F 0 = +22 + a(n)*(+21 + 3*a(n) + 7*a(n+1) -14*a(n+2)) + a(n+1)*(-6*a(n+1) + 7*a(n+2)) + a(n+2)*(-21 + 3*a(n+2)) if n>0. - _Michael Somos_, Dec 30 2016

%F Dirichlet g.f.: zeta(s-1)*(1+1/3^s). - _Amiram Eldar_, Dec 29 2022

%e G.f. = 1 + x + 2*x^2 + 4*x^3 + 4*x^4 + 5*x^5 + 8*x^6 + 7*x^7 + 8*x^8 + ...

%p A257174:=n->`if`(n=0,1,(n/3)*(4+floor(n/3)-ceil(n/3))): seq(A257174(n), n=0..100); # _Wesley Ivan Hurt_, Apr 27 2015

%t a[ n_] := If[ n==0, 1, n + If[ Mod[n, 3] == 0, n/3, 0]];

%t a[ n_] := n + Which[ n==0, 1, Mod[n, 3] == 0, n/3, True, 0];

%t Join[{1}, LinearRecurrence[{0, 0, 2, 0, 0, -1}, {1, 2, 4, 4, 5, 8}, 100]] (* _Vincenzo Librandi_, Apr 28 2015 *)

%t a[ n_] := If[ n==0, 1, Sign[n] SeriesCoefficient[ x / (1 - x)^2 + x^3 / (1 - x^3)^2, {x, 0, Abs@n}]; (* _Michael Somos_, Dec 30 2016 *)

%t CoefficientList[Series[(1+x^2)*(1+x+x^2+x^3+x^4)/(1-2*x^3+x^6), {x, 0, 60}], x] (* _G. C. Greubel_, Aug 02 2018 *)

%o (PARI) {a(n) = n + if( n==0, 1, n%3==0, n/3, 0)};

%o (PARI) {a(n) = if( n==0, 1, sign(n) * polcoeff( (1 - x^4) * (1 - x^5) / ((1 - x) * (1 - x^2) * (1 - x^3)^2) + x * O(x^abs(n)), abs(n)))};

%o (PARI) my(x='x+O('x^60)); Vec((1+x^2)*(1+x+x^2+x^3+x^4)/(1-2*x^3+x^6)) \\ _G. C. Greubel_, Aug 02 2018

%o (Magma) I:=[1,1,2,4,4,5,8]; [n le 7 select I[n] else 2*Self(n-3)-Self(n-6): n in [1..80]]; // _Vincenzo Librandi_, Apr 28 2015

%o (Magma) m:=60; R<x>:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!((1+x^2)*(1+x+x^2+x^3+x^4)/(1-2*x^3+x^6))); // _G. C. Greubel_, Aug 02 2018

%Y Cf. A008574, A280057.

%K nonn,mult

%O 0,3

%A _Michael Somos_, Apr 17 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 01:40 EDT 2024. Contains 371696 sequences. (Running on oeis4.)