A204457 Odd numbers not divisible by 13.
1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 93, 95, 97, 99, 101, 103, 105, 107, 109
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,0,0,0,0,0,1,-1).
Programs
-
Haskell
a204457 n = a204457_list !! (n-1) a204457_list = [x | x <- [1, 3 ..], mod x 13 > 0] -- Reinhard Zumkeller, Feb 08 2012
-
Mathematica
Select[Range[1,111,2],!Divisible[#,13]&] (* or *) With[{nn=111}, Complement[ Range[1,nn,2],13*Range[Floor[nn/13]]]] (* Harvey P. Dale, Jul 23 2013 *)
-
PARI
a(n) = 2*n-1+(n+5)\12*2 \\ Charles R Greathouse IV, Feb 08 2012
Formula
O.g.f.: x*(1 + 2*(x+x^6)*(1+x+x^2+x^3+x^4) + 4*x^6 + x^12)/((1-x^12)*(1-x)). The denominator can be factored.
a(n) = 2*n-1 + 2*floor((n+5)/12) = 2*n+1 + 2*floor((n-7)/12), n>=1. Note that this is -1 for n=0, but the o.g.f. starting with x^0 has a(0)=0.
Comments