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.

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

This page as a plain text file.
%I A257174 #27 Jun 15 2025 05:59:49
%S A257174 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 A257174 26,36,28,29,40,31,32,44,34,35,48,37,38,52,40,41,56,43,44,60,46,47,64,
%U A257174 49,50,68,52,53,72,55,56,76,58,59,80,61,62,84,64,65,88
%N A257174 a(n) = 4*n/3 if n = 3*k and n!=0, otherwise a(n) = n except a(0) = 1.
%D A257174 This is a divisibility sequence.
%H A257174 G. C. Greubel, <a href="/A257174/b257174.txt">Table of n, a(n) for n = 0..2500</a>
%H A257174 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,2,0,0,-1).
%F A257174 Euler transform of length 5 sequence [1, 1, 2, -1, -1].
%F A257174 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 A257174 G.f.: (1 - x^4) * (1 - x^5) / ((1 - x) * (1 - x^2) * (1 - x^3)^2).
%F A257174 G.f.: (1 + x^2) * (1 + x + x^2 + x^3 + x^4) / (1 - 2*x^3 + x^6).
%F A257174 a(3*n) = A008574(n).
%F A257174 a(n) = -a(-n) for all n in Z except n=0.
%F A257174 From _Wesley Ivan Hurt_, Apr 27 2015: (Start)
%F A257174 a(n) = 2*a(n-3)-a(n-6).
%F A257174 a(n) = n*(4+floor(n/3)+floor(-n/3))/3 for n>0. (End)
%F A257174 a(n) = (-1)^n * A280057(n). - _Michael Somos_, Dec 30 2016
%F A257174 G.f.: 1 + x / (1 - x)^2 + x^3 / (1 - x^3)^2. - _Michael Somos_, Dec 30 2016
%F A257174 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 A257174 Dirichlet g.f.: zeta(s-1)*(1+1/3^s). - _Amiram Eldar_, Dec 29 2022
%e A257174 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 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 A257174 a[ n_] := If[ n==0, 1, n + If[ Mod[n, 3] == 0, n/3, 0]];
%t A257174 a[ n_] := n + Which[ n==0, 1, Mod[n, 3] == 0, n/3, True, 0];
%t A257174 Join[{1}, LinearRecurrence[{0, 0, 2, 0, 0, -1}, {1, 2, 4, 4, 5, 8}, 100]] (* _Vincenzo Librandi_, Apr 28 2015 *)
%t A257174 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 A257174 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 A257174 (PARI) {a(n) = n + if( n==0, 1, n%3==0, n/3, 0)};
%o A257174 (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 A257174 (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 A257174 (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 A257174 (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 A257174 Cf. A008574, A280057.
%K A257174 nonn,mult,easy
%O A257174 0,3
%A A257174 _Michael Somos_, Apr 17 2015