OFFSET
1,2
COMMENTS
Letting f(n) = x^n + y^n, recurrence relation f(n) = f(n - 1) + f(n - 2)/2 implies a(n) / A173300(n) = A026150(n) / 2^(n - 1). - Nick Hobson, Jan 30 2024
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..200
FORMULA
a(n) = numerator of ((1 + sqrt(3))/2)^n + ((1 - sqrt(3))/2)^n.
EXAMPLE
a(3) = 5 because x^3 + y^3 is 2.5 and 2.5 is 5/2.
MAPLE
A173299 := proc(n) local x, y ; x := (1+sqrt(3))/2 ; y := (1-sqrt(3))/2 ; expand(x^n+y^n) ; numer(%) ; end proc: # R. J. Mathar, Mar 01 2010
MATHEMATICA
Module[{x=(1-Sqrt[3])/2, y}, y=1-x; Table[x^n+y^n, {n, 40}]]//Simplify// Numerator (* Harvey P. Dale, Aug 24 2019 *)
PROG
(PARI) { a(n) = numerator( 2 * polcoeff( lift( Mod((1+x)/2, x^2-3)^n ), 0) ) }
(Magma) Z<x>:=PolynomialRing(Integers()); N<r>:=NumberField(2*x^2-2*x-1); S:=[ r^n+(1-r)^n: n in [1..34] ]; [ Numerator(RationalField()!S[j]): j in [1..#S] ]; // Klaus Brockhaus, Mar 02 2010
(Python)
from fractions import Fraction
def a173299_gen(a, b):
while True:
yield a.numerator
b, a = b + Fraction(a, 2), b
g = a173299_gen(1, 2)
print([next(g) for _ in range(34)]) # Nick Hobson, Feb 20 2024
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
J. Lowell, Feb 15 2010
EXTENSIONS
Formula, more terms, and PARI script from Max Alekseyev, Feb 24 2010
More terms from Klaus Brockhaus and R. J. Mathar, Mar 01 2010
STATUS
approved