OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
From Hagen von Eitzen, May 17 2009: (Start)
For n>=0, a(4n+1) = 1+25n, a(4n+2) = 5+25n, a(4n+3) = 6+25n, a(4n+4) = 25+25n.
a(n) = 25*floor(n/4) + [0,1,5,6](n mod 4).
(End)
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
G.f.: x*(1+4*x+x^2+19*x^3) / ((1-x^4)*(1-x)). - Franklin T. Adams-Watters, Jul 10 2009
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
MATHEMATICA
LinearRecurrence[{1, 0, 0, 1, -1}, {1, 5, 6, 25, 26}, 60] (* Harvey P. Dale, Aug 15 2011 *)
PROG
(C)
#include <stdio.h>
int main()
{
int n, d1, d2; int a[101]; a[1] = 1;
printf ("%d, ", a[1]);
for (n=2; n<101; n++)
{
if (n % 2==0) d1 =4;
else d1 = 1;
if (n%4==0) d2 = 15;
else d2=0;
a[n] = a[n-1] + d1 + d2;
printf ("%d, ", a[n]);
}
printf("\n");
return 0;
}
(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
(PARI) Vec(x*(1+4*x+x^2+19*x^3)/((1-x^4)*(1-x)) + O(x^100)) \\ Colin Barker, Oct 16 2015
(Python)
def A160529(n): return 25*(n>>2)+(0, 1, 5, 6)[n&3] # Chai Wah Wu, Feb 02 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Krishnan (krishnanrk2000(AT)yahoo.com), May 17 2009
EXTENSIONS
Edited by N. J. A. Sloane, May 17 2009
Extended by R. J. Mathar, May 17 2009
STATUS
approved