OFFSET
1,1
COMMENTS
For any m >= 0, if F(m) = 2^(2^m) + 1 has a factor of the form b = a(n)*2^k + 1 with odd k >= m + 2 and n >= 1, then the cofactor of F(m) is equal to F(m)/b = j*2^k + 1, where j is congruent to 1 mod 10 if n == 0 or 1 mod 4, or j is congruent to 9 mod 10 if n == 2 or 3 mod 4. That is, the integer a(n) + j must be divisible by 10.
LINKS
Wikipedia, Fermat number
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
a(n) = a(n-4) + 30.
G.f.: x*(9 + 2*x + 10*x^2 + 8*x^3 + x^4)/((1 + x)*(1 + x^2)*(1 - x)^2).
EXAMPLE
39 belongs to this sequence and d = 39*2^13 + 1 is a divisor of F(11) = 2^(2^11) + 1, so 10 | (39 + (F(11)/d - 1)/2^13).
MATHEMATICA
LinearRecurrence[{1, 0, 0, 1, -1}, {9, 11, 21, 29, 39}, 60]
CoefficientList[ Series[(9 + 2x + 10x^2 + 8x^3 + x^4)/((-1 + x)^2 (1 + x + x^2 + x^3)), {x, 0, 54}], x] (* Robert G. Wilson v, Feb 08 2018 *)
PROG
(Magma) [n: n in [0..411] | n mod 30 in {9, 11, 21, 29}];
(PARI) Vec(x*(9 + 2*x + 10*x^2 + 8*x^3 + x^4)/((1 + x)*(1 + x^2)*(1 - x)^2 + O(x^55)))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Arkadiusz Wesolowski, Feb 05 2018
STATUS
approved