OFFSET
1,1
COMMENTS
The entries are prime, or divisible by 3, or divisible by prime of the form 3*m+1.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
From R. J. Mathar, Aug 26 2009: (Start)
a(n) = a(n-1) +2*a(n-2) -2*a(n-3) -a(n-4) +a(n-5).
G.f.: x*(-3-4*x-6*x^2+x^4)/((1+x)^2*(x-1)^3).
a(n) = 3*(2*n-1+2*n^2)/4 -(-1)^n*(1+2*n)/4 = A062717(n+1)-1. (End)
Sum_{n>=1} 1/a(n) = 1 + (tan((2+sqrt(7))*Pi/6) - cot((1+sqrt(7))*Pi/6))*Pi/(2*sqrt(7)). - Amiram Eldar, Feb 24 2023
MATHEMATICA
Select[Range[4000], IntegerQ[Sqrt[6 # + 7 ]] &] (* or *) LinearRecurrence[{1, 2, -2, -1, 1}, {3, 7, 19, 27, 47}, 50] (* Harvey P. Dale, Apr 29 2011 *)
PROG
(Magma) [n: n in [1..4000] | IsSquare(6*n+7)]; // Vincenzo Librandi, Oct 12 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Aug 10 2009
EXTENSIONS
Edited by R. J. Mathar, Aug 26 2009
STATUS
approved