OFFSET
2,1
COMMENTS
This sequence is generalizable :
Proposition: p^n divide (p^(n-1) + 1)^ p - 1.
Proof: Let a and p be two integers such that p>=2, and k = gcd(a, p). Then ak divides (a + 1)^p - 1 because (a+1)^p - 1 = [a^p + binomial(p,1)*a^(p-1) + … + binomial(p,p-2)*a^2] + pa == binomial(p,1)*n^(n-1) == 0 (mod p^n) with a = p^(n-1) and k = p.
a(n) is the least k such that k*3^n+1 is a cube. Thus, the cube is given by (3^(n-1)+1)^3. - Derek Orr, Mar 23 2014
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 2..200
Index entries for linear recurrences with constant coefficients, signature (13,-39,27).
FORMULA
G.f.: -x^2*(7-54*x+63*x^2) / ( (x-1)*(3*x-1)*(9*x-1) ). - R. J. Mathar, Oct 25 2011
a(n) = 13*a(n-1)-39*a(n-2)+27*a(n-3) for n>2. - Vincenzo Librandi, Mar 25 2014
EXAMPLE
a(2) = ((3 + 1)^3 - 1)/3^2 = 63/9 = 7.
MAPLE
A198410 := proc(n)
(3^(n-1)+1)^3 ;
(%-1)/3^n ;
end proc:
seq(A198410(n), n=2..20) ; # R. J. Mathar, Oct 25 2011
MATHEMATICA
Table[((3^(n - 1) + 1)^3 - 1)/3^n, {n, 2, 20}] (* Wesley Ivan Hurt, Mar 24 2014 *)
CoefficientList[Series[(7 - 54 x + 63 x^2)/((1 - x) (3 x - 1) (9 x - 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 25 2014 *)
LinearRecurrence[{13, -39, 27}, {7, 37, 271}, 30] (* Harvey P. Dale, Mar 04 2015 *)
PROG
(Magma) I:=[7, 37, 271]; [n le 3 select I[n] else 13*Self(n-1)-39*Self(n-2)+27*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Mar 25 2014
(PARI) a(n)=9^n/27+3^n/3+1 \\ Charles R Greathouse IV, Jun 11 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michel Lagneau, Oct 24 2011
STATUS
approved