A047221 Numbers that are congruent to {2, 3} mod 5.
2, 3, 7, 8, 12, 13, 17, 18, 22, 23, 27, 28, 32, 33, 37, 38, 42, 43, 47, 48, 52, 53, 57, 58, 62, 63, 67, 68, 72, 73, 77, 78, 82, 83, 87, 88, 92, 93, 97, 98, 102, 103, 107, 108, 112, 113, 117, 118, 122, 123, 127, 128, 132, 133, 137, 138, 142, 143, 147, 148, 152, 153
Offset: 1
References
- Richard Crandall and Carl Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see Exercise 3.24, p. 154.
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..10000
- Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
Crossrefs
Programs
-
Haskell
a047221 n = 5 * ((n - 1) `div` 2) + 3 - n `mod` 2 a047221_list = 2 : 3 : map (+ 5) a047221_list -- Reinhard Zumkeller, Nov 27 2012
-
Magma
[ n : n in [1..165] | n mod 5 eq 2 or n mod 5 eq 3 ];
-
Mathematica
{2,3}+#&/@(5 Range[0,30])//Flatten (* Harvey P. Dale, Jan 22 2023 *)
-
PARI
Vec(x*(2+x+2*x^2)/((1+x)*(1-x)^2) + O(x^80)) \\ Michel Marcus, Jun 30 2015
Formula
a(n) = 5*(n-1) - a(n-1) (with a(1)=2). - Vincenzo Librandi, Aug 05 2010
a(n) = (10*n - 3*(-1)^n - 5)/4.
G.f.: x*(2+x+2*x^2)/((1+x)*(1-x)^2).
a(n)^2 = 5*A118015(a(n)) + 4.
a(n) = 5 * (floor(n-1)/2) + 3 - n mod 2. - Reinhard Zumkeller, Nov 27 2012
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(1-2/sqrt(5))*Pi/5. - Amiram Eldar, Dec 07 2021
E.g.f.: 2 + ((5*x - 5/2)*exp(x) - (3/2)*exp(-x))/2. - David Lovler, Aug 23 2022
From Amiram Eldar, Nov 22 2024: (Start)
Product_{n>=1} (1 - (-1)^n/a(n)) = 1.
Product_{n>=1} (1 + (-1)^n/a(n)) = 1/phi (A094214). (End)
Extensions
More terms from Larry Reeves (larryr(AT)acm.org), Apr 08 2002
Closed formula, g.f. and link added by Bruno Berselli, Nov 28 2010
Comments