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.

A355141 a(0)=1, a(1)=a(2)=0; for n > 2, a(n) = a(n-1) + s if n is odd, a(n-1) - s if n is even, where s = a(n-1) + a(n-2) + a(n-3).

This page as a plain text file.
%I A355141 #54 Aug 11 2025 13:09:12
%S A355141 1,0,0,1,0,1,-1,-1,0,-2,1,0,1,3,-1,2,-2,-3,0,-5,3,1,2,8,-3,4,-5,-9,1,
%T A355141 -12,8,5,4,21,-9,7,-12,-26,5,-28,21,19,7,54,-26,9,-28,-73,19,-63,54,
%U A355141 64,9,136,-73,-1,-63,-200,64,-135,136,201,-1,335,-200,-66
%N A355141 a(0)=1, a(1)=a(2)=0; for n > 2, a(n) = a(n-1) + s if n is odd, a(n-1) - s if n is even, where s = a(n-1) + a(n-2) + a(n-3).
%C A355141 Apparently, |a(n)|^(1/n) < 1.100276355... = (A347177^2 + A347178^2)^(1/4). - _Jon E. Schoenfield_, Jun 22 2022
%H A355141 Michael De Vlieger, <a href="/A355141/b355141.txt">Table of n, a(n) for n = 0..10000</a>
%H A355141 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,-1,0,-1).
%F A355141 a(n) = a(n-1) + (2*(n mod 2) - 1)*(a(n-3) + a(n-2) + a(n-1)), with a(0) = 1, a(1) = 0, and a(2) = 0.
%F A355141 G.f.: (1 + x^3 + x^4 + x^5)/(1 + x^4 + x^6). - _Stefano Spezia_, Jun 22 2022
%e A355141 For n = 12, a(12) = 1: The previous three terms are a(9) = -2, a(10) = 1, a(11) = 0, whose sum is -1. 12 is even, so we subtract that sum from the previous term, a(11) = 0, which gives a(12) = 0 - (-1) = 1.
%t A355141 CoefficientList[Series[(1 + x^3 + x^4 + x^5)/(1 + x^4 + x^6), {x, 0, 65}], x] (* _Michael De Vlieger_, Jun 22 2022 *)
%t A355141 LinearRecurrence[{0,0,0,-1,0,-1},{1,0,0,1,0,1},70] (* _Harvey P. Dale_, Aug 11 2025 *)
%o A355141 (Python)
%o A355141 def a(n):
%o A355141     if n in [0, 1, 2]:
%o A355141         return [1, 0, 0][n]
%o A355141     else:
%o A355141         previous_terms = [1, 0, 0]
%o A355141         for i in range(n - 2):
%o A355141             previous_three_terms = previous_terms[-3:]
%o A355141             previous_three_terms_sum = sum(previous_three_terms)
%o A355141             current_term = previous_terms[-1]
%o A355141             if i % 2 == 0:
%o A355141                 previous_terms.append(current_term + previous_three_terms_sum)
%o A355141             else:
%o A355141                 previous_terms.append(current_term - previous_three_terms_sum)
%o A355141         return previous_terms[-1]
%o A355141 print([a(n) for n in range(66)])
%o A355141 (Python)
%o A355141 a, terms = [1, 0,  0], 66
%o A355141 [a.append(a[-1]-(-1)**(n%2)*sum(a[-3:])) for n in range(3, terms)]
%o A355141 print(a) # _Michael S. Branicky_, Jun 22 2022
%K A355141 sign,easy
%O A355141 0,10
%A A355141 _Nate Shaw_, Jun 20 2022