A197652 Numbers that are congruent to 0 or 1 mod 10.
0, 1, 10, 11, 20, 21, 30, 31, 40, 41, 50, 51, 60, 61, 70, 71, 80, 81, 90, 91, 100, 101, 110, 111, 120, 121, 130, 131, 140, 141, 150, 151, 160, 161, 170, 171, 180, 181, 190, 191, 200, 201, 210, 211, 220, 221, 230, 231, 240, 241, 250, 251, 260, 261, 270, 271
Offset: 1
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
Programs
-
Magma
[5*n-7-2*(-1)^n: n in [1..60]]; // Vincenzo Librandi, Jul 11 2012
-
Maple
A197652:=n->5*n-7-2*(-1)^n: seq(A197652(n), n=1..100); # Wesley Ivan Hurt, Sep 26 2015
-
Mathematica
CoefficientList[Series[x*(1+9*x)/((1+x)*(1-x)^2),{x,0,50}],x] (* Vincenzo Librandi, Jul 11 2012 *)
-
PARI
a(n)=n\2*10+n%2*9-9 \\ Charles R Greathouse IV, Oct 25 2011
-
Python
def A197652(n): return 5*n-(5 if n&1 else 9) # Chai Wah Wu, Oct 29 2024
Formula
From Zak Seidov, Oct 20 2011: (Start)
a(n) = a(n-2) + 10.
a(n) = 5*n - 7 - 2*(-1)^n. (End)
From Vincenzo Librandi, Jul 11 2012: (Start)
G.f.: x^2*(1+9*x)/((1+x)*(1-x)^2).
a(n) = a(n-1) + a(n-2) - a(n-3) for n>3. (End)
E.g.f.: 9 + (5*x - 7)*exp(x) - 2*exp(-x). - David Lovler, Sep 03 2022
Comments