login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1) = 1; for n>1, a(n) = a(n-1) + d1 + d2 where d1 = 4 if n is even. d1 = 1 if n is odd, d2 = 15 if n mod 4 = 0, d2 = 0 if n mod 4 != 0.
1

%I #26 Feb 02 2023 20:41:56

%S 1,5,6,25,26,30,31,50,51,55,56,75,76,80,81,100,101,105,106,125,126,

%T 130,131,150,151,155,156,175,176,180,181,200,201,205,206,225,226,230,

%U 231,250,251,255,256,275,276,280,281,300,301,305,306,325,326,330,331,350

%N a(1) = 1; for n>1, a(n) = a(n-1) + d1 + d2 where d1 = 4 if n is even. d1 = 1 if n is odd, d2 = 15 if n mod 4 = 0, d2 = 0 if n mod 4 != 0.

%H Colin Barker, <a href="/A160529/b160529.txt">Table of n, a(n) for n = 1..1000</a>

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

%F From _Hagen von Eitzen_, May 17 2009: (Start)

%F For n>=0, a(4n+1) = 1+25n, a(4n+2) = 5+25n, a(4n+3) = 6+25n, a(4n+4) = 25+25n.

%F a(n) = 25*floor(n/4) + [0,1,5,6](n mod 4).

%F (End)

%F a(n) = a(n-1)+a(n-4)-a(n-5). G.f.: x*(1+4*x+x^2+19*x^3)/((1+x)*(x^2+1)*(x-1)^2). a(n)=-101/8+21*(-1)^n/8+15*A057077(n)/4+25*(n+1)/4. - _R. J. Mathar_, May 17 2009

%F G.f.: x*(1+4*x+x^2+19*x^3) / ((1-x^4)*(1-x)). - _Franklin T. Adams-Watters_, Jul 10 2009

%F a(n) = (-1 - 21*(-1)^n + (15-i*15)*(-i)^n + (15+15*i)*i^n + 50*n)/8 where i=sqrt(-1). - _Colin Barker_, Oct 16 2015

%t LinearRecurrence[{1,0,0,1,-1},{1,5,6,25,26},60] (* _Harvey P. Dale_, Aug 15 2011 *)

%o (C)

%o #include <stdio.h>

%o int main()

%o {

%o int n, d1, d2; int a[101]; a[1] = 1;

%o printf ("%d, ", a[1]);

%o for (n=2; n<101; n++)

%o {

%o if (n % 2==0) d1 =4;

%o else d1 = 1;

%o if (n%4==0) d2 = 15;

%o else d2=0;

%o a[n] = a[n-1] + d1 + d2;

%o printf ("%d, ", a[n]);

%o }

%o printf("\n");

%o return 0;

%o }

%o (PARI) a(n) = (-1 - 21*(-1)^n + (15-I*15)*(-I)^n + (15+15*I)*I^n + 50*n)/8 \\ _Colin Barker_, Oct 16 2015

%o (PARI) Vec(x*(1+4*x+x^2+19*x^3)/((1-x^4)*(1-x)) + O(x^100)) \\ _Colin Barker_, Oct 16 2015

%o (Python)

%o def A160529(n): return 25*(n>>2)+(0,1,5,6)[n&3] # _Chai Wah Wu_, Feb 02 2023

%K nonn,easy

%O 1,2

%A Krishnan (krishnanrk2000(AT)yahoo.com), May 17 2009

%E Edited by _N. J. A. Sloane_, May 17 2009

%E Extended by _R. J. Mathar_, May 17 2009