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.
%I A173299 #23 Feb 20 2024 09:23:22 %S A173299 1,2,5,7,19,13,71,97,265,181,989,1351,3691,2521,13775,18817,51409, %T A173299 35113,191861,262087,716035,489061,2672279,3650401,9973081,6811741, %U A173299 37220045,50843527,138907099,94875313,518408351,708158977,1934726305,1321442641 %N A173299 Numerators of fractions x^n + y^n, where x + y = 1 and x^2 + y^2 = 2. %C A173299 x and y are given by -A152422 and 1-A152422. - _R. J. Mathar_, Mar 01 2010 %C A173299 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 %H A173299 Vincenzo Librandi, <a href="/A173299/b173299.txt">Table of n, a(n) for n = 1..200</a> %F A173299 a(n) = numerator of ((1 + sqrt(3))/2)^n + ((1 - sqrt(3))/2)^n. %e A173299 a(3) = 5 because x^3 + y^3 is 2.5 and 2.5 is 5/2. %p A173299 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 %t A173299 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 *) %o A173299 (PARI) { a(n) = numerator( 2 * polcoeff( lift( Mod((1+x)/2,x^2-3)^n ), 0) ) } %o A173299 (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 %o A173299 (Python) %o A173299 from fractions import Fraction %o A173299 def a173299_gen(a, b): %o A173299 while True: %o A173299 yield a.numerator %o A173299 b, a = b + Fraction(a, 2), b %o A173299 g = a173299_gen(1, 2) %o A173299 print([next(g) for _ in range(34)]) # _Nick Hobson_, Feb 20 2024 %Y A173299 Cf. A173300 (denominators). %K A173299 nonn,frac %O A173299 1,2 %A A173299 _J. Lowell_, Feb 15 2010 %E A173299 Formula, more terms, and PARI script from _Max Alekseyev_, Feb 24 2010 %E A173299 More terms from _Klaus Brockhaus_ and _R. J. Mathar_, Mar 01 2010