cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A167205 a(n) = (3^n+1)/(3-(-1)^n).

Original entry on oeis.org

1, 1, 5, 7, 41, 61, 365, 547, 3281, 4921, 29525, 44287, 265721, 398581, 2391485, 3587227, 21523361, 32285041, 193710245, 290565367, 1743392201, 2615088301, 15690529805, 23535794707, 141214768241, 211822152361, 1270932914165
Offset: 0

Views

Author

Jaume Oliver Lafont, Oct 30 2009

Keywords

Comments

This sequence is (3^n + 1) divided by the highest possible power of 2, which is 4 for odd n and 2 for even n. It is never divisible by 8 or any higher power of 2, which implies Levi ben Gerson's observation that (3^n + 1 = 2^k) has no solution for n > 1. Cf. the comments and links to A235365. - Joe Slater, Apr 02 2017

Crossrefs

Programs

  • GAP
    List([0..27],n->(3^n+1)/(3-(-1)^n)); # Muniru A Asiru, Mar 05 2018
  • Maple
    a:=n->(3^n+1)/(3-(-1)^n): seq(a(n),n=0..27); # Muniru A Asiru, Mar 05 2018
  • Mathematica
    CoefficientList[Series[(1+x-5x^2-3x^3)/((1+x)(1-x)(1+3x)(1-3x)), {x,0,30}],x] (* or *) LinearRecurrence[{0,10,0,-9},{1,1,5,7},30] (* Harvey P. Dale, Apr 25 2011 *)
  • PARI
    a(n) = (3^n+1)/(3-(-1)^n); \\ Altug Alkan, Mar 05 2018
    

Formula

a(n) = 10*a(n-2) - 9*a(n-4).
G.f.: (1 + x - 5*x^2 - 3*x^3)/((1+x)*(1-x)*(1+3*x)*(1-3*x)).
a(n) = numerator((1/4)^n + (3/4)^n), n > 0.