A301451 Numbers congruent to {1, 7} mod 9.
1, 7, 10, 16, 19, 25, 28, 34, 37, 43, 46, 52, 55, 61, 64, 70, 73, 79, 82, 88, 91, 97, 100, 106, 109, 115, 118, 124, 127, 133, 136, 142, 145, 151, 154, 160, 163, 169, 172, 178, 181, 187, 190, 196, 199, 205, 208, 214, 217, 223, 226, 232, 235, 241, 244, 250, 253, 259, 262, 268
Offset: 1
Links
- Colin Barker, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
Crossrefs
Programs
-
GAP
a := [1,7,10];; for n in [4..60] do a[n] := a[n-1] + a[n-2] - a[n-3]; od; a;
-
Magma
&cat [[9*n+1, 9*n+7]: n in [0..40]];
-
Mathematica
Table[2 (2 n - 1) + (2 n - 3 (1 - (-1)^n))/4, {n, 1, 60}] {#+1,#+7}&/@(9*Range[0,30])//Flatten (* or *) LinearRecurrence[{1,1,-1},{1,7,10},60] (* Harvey P. Dale, Nov 08 2020 *)
-
PARI
Vec(x*(1 + 6*x + 2*x^2) / ((1 - x)^2*(1 + x)) + O(x^60)) \\ Colin Barker, Mar 22 2018
-
Python
[2*(2*n-1)+(2*n-3*(1-(-1)**n))/4 for n in range(1,70)]
-
Sage
[n for n in (1..300) if n % 9 in (1,7)]
Formula
O.g.f.: x*(1 + 6*x + 2*x^2)/((1 + x)*(1 - x)^2).
E.g.f.: (3 + 8*exp(x) - 11*exp(2*x) + 18*x*exp(2*x))*exp(-x)/4.
a(n) = a(n-1) + a(n-2) - a(n-3).
a(n) = 2*(2*n - 1) + (2*n - 3*(1 - (-1)^n))/4. Therefore, for n even a(n) = (9*n - 4)/2, otherwise a(n) = (9*n - 7)/2.
Comments