A047623 Numbers that are congruent to {1, 3, 5} mod 8.
1, 3, 5, 9, 11, 13, 17, 19, 21, 25, 27, 29, 33, 35, 37, 41, 43, 45, 49, 51, 53, 57, 59, 61, 65, 67, 69, 73, 75, 77, 81, 83, 85, 89, 91, 93, 97, 99, 101, 105, 107, 109, 113, 115, 117, 121, 123, 125, 129, 131, 133, 137, 139, 141, 145, 147, 149, 153, 155, 157
Offset: 1
References
- James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 17.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..5000
- Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
Programs
-
Magma
I:=[1, 3, 5, 9]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..70]]; // Vincenzo Librandi, Apr 27 2012
-
Maple
A047623:=n->(24*n-21-6*cos(2*n*Pi/3)+2*sqrt(3)*sin(2*n*Pi/3))/9: seq(A047623(n), n=1..100); # Wesley Ivan Hurt, Jun 10 2016
-
Mathematica
Select[Range[0,150], MemberQ[{1,3,5}, Mod[#,8]]&] (* Vincenzo Librandi, Apr 27 2012 *)
Formula
a(n) = 2*floor((n-1)/3) + 2*n - 1. - Gary Detlefs, Mar 18 2010
From Colin Barker, Feb 03 2012: (Start)
G.f.: x*(1+2*x+2*x^2+3*x^3)/(1-x-x^3+x^4).
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4. (End)
From Wesley Ivan Hurt, Jun 10 2016: (Start)
a(n) = (24*n-21-6*cos(2*n*Pi/3)+2*sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 8k-3, a(3k-1) = 8k-5, a(3k-2) = 8k-7. (End)
Comments