A084133 Duplicate of A005667.
1, 3, 19, 117, 721, 4443, 27379, 168717, 1039681, 6406803, 39480499, 243289797
Offset: 0
Keywords
Links
- Tanya Khovanova, Non Recursions
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.
G.f. = 2 + x + 3*x^2 + 4*x^3 + 7*x^4 + 11*x^5 + 18*x^6 + 29*x^7 + ...
a000032 n = a000032_list !! n a000032_list = 2 : 1 : zipWith (+) a000032_list (tail a000032_list) -- Reinhard Zumkeller, Aug 20 2011
[Lucas(n): n in [0..120]];
with(combinat): A000032 := n->fibonacci(n+1)+fibonacci(n-1); seq(simplify(2^n*(cos(Pi/5)^n+cos(3*Pi/5)^n)), n=0..36)
a[0] := 2; a[n] := Nest[{Last[#], First[#] + Last[#]} &, {2, 1}, n] // Last Array[2 Fibonacci[# + 1] - Fibonacci[#] &, 50, 0] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 26 2006 *) Table[LucasL[n], {n, 0, 36}] (* Zerinvary Lajos, Jul 09 2009 *) LinearRecurrence[{1, 1}, {2, 1}, 40] (* Harvey P. Dale, Sep 07 2013 *) LucasL[Range[0, 20]] (* Eric W. Weisstein, Aug 07 2017 *) CoefficientList[Series[(-2 + x)/(-1 + x + x^2), {x, 0, 20}], x] (* Eric W. Weisstein, Sep 21 2017 *)
{a(n) = if(n<0, (-1)^n * a(-n), if( n<2, 2-n, a(n-1) + a(n-2)))};
{a(n) = if(n<0, (-1)^n * a(-n), polsym(x^2 - x - 1, n)[n+1])};
{a(n) = real((2 + quadgen(5)) * quadgen(5)^n)};
a(n)=fibonacci(n+1)+fibonacci(n-1) \\ Charles R Greathouse IV, Jun 11 2011
polsym(1+x-x^2, 50) \\ Charles R Greathouse IV, Jun 11 2011
def A000032_gen(): # generator of terms a, b = 2, 1 while True: yield a a, b = b, a+b it = A000032_gen() A000032_list = [next(it) for in range(50)] # _Cole Dykstra, Aug 02 2022
from sympy import lucas def A000032(n): return lucas(n) # Chai Wah Wu, Sep 23 2023
[(i:=3)+(j:=-1)] + [(j:=i+j)+(i:=j-i) for in range(100)] # _Jwalin Bhatt, Apr 02 2025
[lucas_number2(n,1,-1) for n in range(37)] # Zerinvary Lajos, Jun 25 2008
s = {2}; gm = 1; Do[p = Prime[n]; g = Prime[n + 1] - p; If[g > gm, Print[p]; AppendTo[s, p]; gm = g], {n, 2, 1000000}]; s (* Jean-François Alcover, Mar 31 2011 *) Module[{nn=10^7,pr,df},pr=Prime[Range[nn]];df=Differences[pr];DeleteDuplicates[ Thread[ {Most[ pr],df}],GreaterEqual[#1[[2]],#2[[2]]]&]][[All,1]] (* The program generates the first 26 terms of the sequence. *) (* Harvey P. Dale, Sep 24 2022 *)
a(n)=local(p,g);if(n<2,2*(n>0),p=a(n-1);g=nextprime(p+1)-p;while(p=nextprime(p+1),if(nextprime(p+1)-p>g,break));p) /* Michael Somos, Feb 07 2004 */
p=q=2;g=0;until( g<(q=nextprime(1+p=q))-p && print1(q-g=q-p,","),) \\ M. F. Hasler, Dec 13 2007
a005250 n = a005250_list !! (n-1) a005250_list = f 0 a001223_list where f m (x:xs) = if x <= m then f m xs else x : f x xs -- Reinhard Zumkeller, Dec 12 2012
nn=10^7;Module[{d=Differences[Prime[Range[nn]]],ls={1}},Table[If[d[[n]]> Last[ls],AppendTo[ls,d[[n]]]],{n,nn-1}];ls] (* Harvey P. Dale, Jul 23 2012 *) DeleteDuplicates[Differences[Prime[Range[10^7]]],GreaterEqual] (* The program generates the first 26 terms of the sequence. *) (* Harvey P. Dale, May 12 2022 *)
p=q=2;g=0;until( g<(q=nextprime(1+p=q))-p & print1(g=q-p,","),) \\ M. F. Hasler, Dec 13 2007
p=2; g=0;m=g; forprime(q=3,10^13,g=q-p;if(g>m,print(g", ",p,", ",q);m=g);p=q) \\ John W. Nicholson, Dec 18 2016
G.f. = x + 6*x^2 + 37*x^3 + 228*x^4 + 1405*x^5 + 8658*x^6 + 53353*x^7 + ...
[n le 2 select n-1 else 6*Self(n-1)+Self(n-2): n in [1..25]]; // Vincenzo Librandi, Feb 23 2013
evalf(sqrt(10),200); convert(%,confrac,fractionlist); fractionlist; A005668:=-z/(-1+6*z+z**2); - Simon Plouffe in his 1992 dissertation. a := n -> `if`(n<2,n,6^(n-1)*hypergeom([1-n/2,(1-n)/2], [1-n], -1/9)): seq(simplify(a(n)), n=0..23); # Peter Luschny, Jun 28 2017
LinearRecurrence[{6,1}, {0,1}, 30] (* Vincenzo Librandi, Feb 23 2013 *) a[ n_] := (-I)^(n - 1) ChebyshevU[ n - 1, 3 I]; (* Michael Somos, May 28 2014 *) a[ n_] := MatrixPower[ {{0, 1}, {1, 6}}, n + 1][[1, 1]]; (* Michael Somos, May 28 2014 *) Fibonacci[Range[0,30],6] (* G. C. Greubel, Jun 06 2019 *) Join[{0},Convergents[Sqrt[10],30]//Denominator] (* Harvey P. Dale, Dec 28 2022 *)
{a(n) = ([0, 1; 1, 6]^(n+1)) [1, 1]}; /* Michael Somos, May 28 2014 */
{a(n) = (-I)^(n-1) * polchebyshev( n-1, 2, 3*I)}; /* Michael Somos, May 28 2014 */
from sage.combinat.sloane_functions import recur_gen3; it = recur_gen3(0,1,6,6,1,0); [next(it) for i in range(1,22)] # Zerinvary Lajos, Jul 09 2008
[lucas_number1(n,6,-1) for n in range(0, 21)]# Zerinvary Lajos, Apr 24 2009
f[n_] := Block[{d, i, m = 0}, Reap@ For[i = 1, i <= n, i++, d = Prime[i + 1] - Prime@ i; If[d > m, m = d; Sow@ i, False]] // Flatten // Rest]; f@ 1000000 (* Michael De Vlieger, Mar 24 2015 *)
A005672:=z**3/(z**2+z-1)/(-1+2*z**2); # conjectured by Simon Plouffe in his 1992 dissertation with (combinat):a[ -1]:=0:a[1]:=0:a[2]:=1:for n from 2 to 50 do a[n]:=fibonacci(n-1)+2*a[n-2] od: seq(a[n-1], n=0..31); # Zerinvary Lajos, Mar 17 2008
a(4) = 6*a(3)+a(2) = 6*234+38 = 1442.
I:=[2,6]; [n le 2 select I[n] else 6*Self(n-1)+Self(n-2): n in [1..30]]; // Vincenzo Librandi, Sep 19 2016
RecurrenceTable[{a[0] == 2, a[1] == 6, a[n] == 6 a[n-1] + a[n-2]}, a, {n, 30}] (* Vincenzo Librandi, Sep 19 2016 *) LinearRecurrence[{6,1}, {2,6}, 30] (* G. C. Greubel, Nov 07 2018 *)
x='x+O('x^30); Vec(2*(1-3*x)/(1-6*x-x^2)) \\ G. C. Greubel, Nov 07 2018
3.162277660168379331998893544... = 3 + 1/(6 + 1/(6 + 1/(6 + 1/(6 + ...)))).
[6-3*(Binomial(2*n,n) mod 2): n in [0..100]]; // Vincenzo Librandi, Jan 03 2016
Digits := 100: convert(evalf(sqrt(N)),confrac,90,'cvgts'):
ContinuedFraction[Sqrt[10],300] (* Vladimir Joseph Stephan Orlovsky, Mar 04 2011 *) PadRight[{3},120,{6}] (* Harvey P. Dale, Aug 25 2024 *)
contfrac(sqrt(10)) \\ For illustration.
A040006(n)=if(n,6,3) \\ M. F. Hasler, Nov 02 2019
I:=[2, 5, 22, 49]; [n le 4 select I[n] else 10*Self(n-2)-Self(n-4): n in [1..30]]; // Vincenzo Librandi, Jun 10 2015
Table[Numerator[FromContinuedFraction[ContinuedFraction[Sqrt[6],n]]],{n,1,50}] (* Vladimir Joseph Stephan Orlovsky, Mar 16 2011 *) LinearRecurrence[{0, 10, 0, -1}, {2, 5, 22, 49}, 50] (* Vincenzo Librandi, Jun 10 2015 *)
A41006=contfracpnqn(c=contfrac(sqrt(6)), #c)[1, ][^-1] \\ Discard possibly incorrect last element. NB: a(n)=A41006[n+1]! M. F. Hasler, Nov 01 2019
\\ For correct index & more terms: A041006(n)={n<#A041006|| A041006=extend(A041006, [2, 10; 4, -1], n\.8); A041006[n+1]} extend(A, c, N)={for(n=#A+1, #A=Vec(A, N), A[n]=[A[n-i]|i<-c[, 1]]*c[, 2]); A} \\ M. F. Hasler, Nov 01 2019
Comments