login
a(0) = a(1) = 1; for n>1, a(n) = a(n-1) + (a(n-2) mod 5).
0

%I #17 Sep 08 2022 08:46:14

%S 1,1,2,3,5,8,8,11,14,15,19,19,23,27,30,32,32,34,36,40,41,41,42,43,45,

%T 48,48,51,54,55,59,59,63,67,70,72,72,74,76,80,81,81,82,83,85,88,88,91,

%U 94,95,99,99,103,107,110,112,112

%N a(0) = a(1) = 1; for n>1, a(n) = a(n-1) + (a(n-2) mod 5).

%F Empirical g.f.: (4*x^12+2*x^11-2*x^10-2*x^9+4*x^8+x^7-2*x^6+x^5+2*x^4+x^3+1) / ((x-1)^2*(x^4+x^3+x^2+x+1)*(x^8-x^6+x^4-x^2+1)). - _Colin Barker_, Nov 23 2015

%t a[0] = a[1] = 1; a[n_] := a[n] = a[n - 1] + Mod[a[n - 2], 5]; Table[a@ n, {n, 0, 60}] (* _Michael De Vlieger_, Nov 24 2015 *)

%o (PARI) first(m)=my(v=vector(m));v[1]=1;v[2]=1;for(i=3,m,v[i]=v[i-1]+v[i-2]%5);v

%o (Magma) [n le 2 select 1 else Self(n-1)+Self(n-2) mod 5: n in [1..60]]; // _Vincenzo Librandi_, Nov 24 2015

%Y Cf. A000045, A003893.

%K nonn,easy

%O 0,3

%A _Anders Hellström_, Nov 23 2015