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
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, 26, 36, 28, 29, 40, 31, 32, 44, 34, 35, 48, 37, 38, 52, 40, 41, 56, 43, 44, 60, 46, 47, 64, 49, 50, 68, 52, 53, 72, 55, 56, 76, 58, 59, 80, 61, 62, 84, 64, 65, 88 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
REFERENCES
This is a divisibility sequence.
LINKS
FORMULA
Euler transform of length 5 sequence [1, 1, 2, -1, -1].
a(n) is multiplicative with a(0) = 1, a(3^e) = 4*3^(e-1) if e>0, a(p^e) = p^e otherwise.
G.f.: (1 - x^4) * (1 - x^5) / ((1 - x) * (1 - x^2) * (1 - x^3)^2).
G.f.: (1 + x^2) * (1 + x + x^2 + x^3 + x^4) / (1 - 2*x^3 + x^6).
a(3*n) = A008574(n).
a(n) = -a(-n) for all n in Z except n=0.
From Wesley Ivan Hurt, Apr 27 2015: (Start)
a(n) = 2*a(n-3)-a(n-6).
a(n) = n*(4+floor(n/3)+floor(-n/3))/3 for n>0. (End)
a(n) = (-1)^n * A280057(n). - Michael Somos, Dec 30 2016
G.f.: 1 + x / (1 - x)^2 + x^3 / (1 - x^3)^2. - Michael Somos, Dec 30 2016
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
Dirichlet g.f.: zeta(s-1)*(1+1/3^s). - Amiram Eldar, Dec 29 2022
EXAMPLE
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 + ...
MAPLE
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
MATHEMATICA
a[ n_] := If[ n==0, 1, n + If[ Mod[n, 3] == 0, n/3, 0]];
a[ n_] := n + Which[ n==0, 1, Mod[n, 3] == 0, n/3, True, 0];
Join[{1}, LinearRecurrence[{0, 0, 2, 0, 0, -1}, {1, 2, 4, 4, 5, 8}, 100]] (* Vincenzo Librandi, Apr 28 2015 *)
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 *)
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 *)
PROG
(PARI) {a(n) = n + if( n==0, 1, n%3==0, n/3, 0)};
(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)))};
(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
(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
(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
CROSSREFS
Sequence in context: A219875 A132128 A280057 * A327625 A084824 A344710
KEYWORD
nonn,mult
AUTHOR
Michael Somos, Apr 17 2015
STATUS
approved

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 24 14:32 EDT 2024. Contains 371960 sequences. (Running on oeis4.)