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.

A167051 Start at 1, then add the first term (which is one here) plus 1 for the second term; then add the second term plus 2 for the third term; then add the third term to the sum of the first and second term; this gives the fourth term. Restart the sequence by adding 1 to the fourth term, etc. (From a sixth grade math extra credit assignment).

This page as a plain text file.
%I A167051 #10 Jun 02 2025 02:09:56
%S A167051 1,2,4,7,8,10,25,26,28,79,80,82,241,242,244,727,728,730,2185,2186,
%T A167051 2188,6559,6560,6562,19681,19682,19684,59047,59048,59050,177145,
%U A167051 177146,177148,531439,531440,531442,1594321,1594322,1594324,4782967,4782968,4782970,14348905
%N A167051 Start at 1, then add the first term (which is one here) plus 1 for the second term; then add the second term plus 2 for the third term; then add the third term to the sum of the first and second term; this gives the fourth term. Restart the sequence by adding 1 to the fourth term, etc. (From a sixth grade math extra credit assignment).
%H A167051 Andrew Howroyd, <a href="/A167051/b167051.txt">Table of n, a(n) for n = 1..1000</a>
%F A167051 a(n) = a(n-1) + 1 for n mod 3 == 2;
%F A167051 a(n) = a(n-1) + 2 for n mod 3 == 0;
%F A167051 a(n) = a(n-1) + a(n-2) + a(n-3) for n mod 3 == 1 and n > 1.
%F A167051 G.f.: x*(1 + 2*x + 4*x^2 + 3*x^3 - 6*x^5)/((1 - x)*(1 + x + x^2)*(1 - 3*x^3)). - _Andrew Howroyd_, Apr 13 2021
%o A167051 (PARI) seq(n)={my(a=vector(n)); a[1]=1; for(n=2, #a, my(t=n%3); a[n]=a[n-1]+if(t==2, 1, if(t==0, 2, a[n-2]+a[n-3]))); a} \\ _Andrew Howroyd_, Apr 13 2021
%o A167051 (PARI) Vec((1 + 2*x + 4*x^2 + 3*x^3 - 6*x^5)/((1 - x)*(1 + x + x^2)*(1 - 3*x^3)) + O(x^40)) \\ _Andrew Howroyd_, Apr 13 2021
%K A167051 nonn
%O A167051 1,2
%A A167051 Chris Rice (cwrice(AT)research.att.com), Oct 27 2009