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.

Previous Showing 11-20 of 26 results. Next

A040005 Continued fraction for sqrt(8).

Original entry on oeis.org

2, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4
Offset: 0

Views

Author

Keywords

Examples

			2.828427124746190097603377448... = 2 + 1/(1 + 1/(4 + 1/(1 + 1/(4 + ...)))). - _Harry J. Smith_, Jun 02 2009
		

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 276.

Crossrefs

Cf. A010466 (decimal expansion).
Essentially the same as A010685.

Programs

  • Maple
    Digits := 100: convert(evalf(sqrt(N)),confrac,90,'cvgts'):
  • Mathematica
    ContinuedFraction[Sqrt[8],300] (* Vladimir Joseph Stephan Orlovsky, Mar 04 2011 *)
  • PARI
    { allocatemem(932245000); default(realprecision, 16000); x=contfrac(sqrt(8)); for (n=0, 20000, write("b040005.txt", n, " ", x[n+1])); } \\ Harry J. Smith, Jun 02 2009

Formula

From Amiram Eldar, Nov 12 2023: (Start)
Multiplicative with a(2^e) = 4, and a(p^e) = 1 for an odd prime p.
Dirichlet g.f.: zeta(s) * (1 + 3/2^s). (End)
G.f.: (2 + x + 2*x^2)/(1 - x^2). - Stefano Spezia, Jul 26 2025

A094015 Expansion of (1+4*x)/(1-8*x^2).

Original entry on oeis.org

1, 4, 8, 32, 64, 256, 512, 2048, 4096, 16384, 32768, 131072, 262144, 1048576, 2097152, 8388608, 16777216, 67108864, 134217728, 536870912, 1073741824, 4294967296, 8589934592, 34359738368, 68719476736, 274877906944
Offset: 0

Views

Author

Paul Barry, Apr 21 2004

Keywords

Comments

Row sums of triangle A135838. - Gary W. Adamson, Dec 01 2007
Row sums of triangle A152842. - Reinhard Zumkeller, May 01 2014

Crossrefs

Programs

  • Haskell
    a094015 = sum . a152842_row  -- Reinhard Zumkeller, May 01 2014
    
  • Magma
    [2*8^Floor((n-1)/2)*(3+(-1)^n): n in [0..30]]; // G. C. Greubel, Nov 22 2021
    
  • Maple
    a:=n->mul(3-(-1)^j,j=1..n):seq(a(n),n=0..25); # Zerinvary Lajos, Dec 13 2008
  • Mathematica
    Table[8^Floor[n/2]*Mod[4^n, 5], {n, 0, 30}] (* G. C. Greubel, Nov 22 2021 *)
  • Sage
    [8^(n//2)*(4^n%5) for n in (0..30)] # G. C. Greubel, Nov 22 2021

Formula

a(n) = 2^(3*n/2)*(1 + sqrt(2) + (-1)^n*(1 - sqrt(2)))/2.
a(n) = (1/4)*(3 + (-1)^n)*8^floor((n+1)/2). - Paul Barry, Jul 14 2004
a(n) = (1 + sqrt(2))*(2*sqrt(2))^n/2 + (1 - sqrt(2))*(-2*sqrt(2))^n/2. Third binomial transform is A002315 (NSW numbers). - Paul Barry, Jul 17 2004
a(n) = 2^A007494(n). - Paul Barry, Aug 18 2007
a(n) = A016116(n+1)*A000079(n). - R. J. Mathar, Jul 08 2009
a(n+3) = a(n+2)*a(n+1)/a(n). - Reinhard Zumkeller, Mar 04 2011
a(n) = 8^floor(n/2)*A010685(n). - G. C. Greubel, Nov 22 2021

A010698 Period 2: repeat (2,8).

Original entry on oeis.org

2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2
Offset: 0

Views

Author

Keywords

Comments

This is the regular (simple) continued fraction for (2+sqrt(5))/2 = A176055. - Antonia Redondo Buitrago, Jul 30 2009

Programs

Formula

a(n) = -3*(-1)^n+5. - Paolo P. Lava, Oct 20 2006
G.f.: 2(1+4x)/((1-x)(1+x)). a(n) = 2*A010685(n). - R. J. Mathar, Oct 20 2008
a(n) = (A010674(n)+1)*2. - Martin Ettl, Nov 09 2012

A274913 Square array read by antidiagonals upwards in which each new term is the least positive integer distinct from its neighbors.

Original entry on oeis.org

1, 2, 3, 1, 4, 1, 2, 3, 2, 3, 1, 4, 1, 4, 1, 2, 3, 2, 3, 2, 3, 1, 4, 1, 4, 1, 4, 1, 2, 3, 2, 3, 2, 3, 2, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3
Offset: 1

Views

Author

Omar E. Pol, Jul 11 2016

Keywords

Comments

This is also a triangle read by rows in which each new term is the least positive integer distinct from its neighbors.
In the square array we have that:
Antidiagonal sums give the positive terms of A008851.
Odd-indexed rows give A010684.
Even-indexed rows give A010694.
Odd-indexed columns give A000034.
Even-indexed columns give A010702.
Odd-indexed antidiagonals give the initial terms of A010685.
Even-indexed antidiagonals give the initial terms of A010693.
Main diagonal gives A010685.
This is also a triangle read by rows in which each new term is the least positive integer distinct from its neighbors.
In the triangle we have that:
Row sums give the positive terms of A008851.
Odd-indexed columns give A000034.
Even-indexed columns give A010702.
Odd-indexed diagonals give A010684.
Even-indexed diagonals give A010694.
Odd-indexed rows give the initial terms of A010685.
Even-indexed rows give the initial terms of A010693.
Odd-indexed antidiagonals give the initial terms of A010684.
Even-indexed antidiagonals give the initial terms of A010694.

Examples

			The corner of the square array begins:
1, 3, 1, 3, 1, 3, 1, 3, 1, 3, ...
2, 4, 2, 4, 2, 4, 2, 4, 2, ...
1, 3, 1, 3, 1, 3, 1, 3, ...
2, 4, 2, 4, 2, 4, 2, ...
1, 3, 1, 3, 1, 3, ...
2, 4, 2, 4, 2, ...
1, 3, 1, 3, ...
2, 4, 2, ...
1, 3, ...
2, ...
...
The sequence written as a triangle begins:
1;
2, 3;
1, 4, 1;
2, 3, 2, 3;
1, 4, 1, 4, 1;
2, 3, 2, 3, 2, 3;
1, 4, 1, 4, 1, 4, 1;
2, 3, 2, 3, 2, 3, 2, 3;
1, 4, 1, 4, 1, 4, 1, 4, 1;
2, 3, 2, 3, 2, 3, 2, 3, 2, 3;
...
		

Crossrefs

Programs

  • Mathematica
    Table[1 + Boole@ EvenQ@ # + 2 Boole@ EvenQ@ k &[n - k + 1], {n, 14}, {k, n}] // Flatten (* Michael De Vlieger, Nov 14 2016 *)

Formula

a(n) = A274912(n) + 1.

A283393 a(n) = gcd(n^2-1, n^2+9).

Original entry on oeis.org

1, 10, 1, 2, 5, 2, 5, 2, 1, 10, 1, 10, 1, 2, 5, 2, 5, 2, 1, 10, 1, 10, 1, 2, 5, 2, 5, 2, 1, 10, 1, 10, 1, 2, 5, 2, 5, 2, 1, 10, 1, 10, 1, 2, 5, 2, 5, 2, 1, 10, 1, 10, 1, 2, 5, 2, 5, 2, 1, 10, 1, 10, 1, 2, 5, 2, 5, 2, 1, 10, 1, 10, 1, 2, 5, 2, 5, 2, 1, 10, 1, 10, 1, 2, 5, 2, 5, 2, 1, 10
Offset: 0

Views

Author

Bruno Berselli, Mar 07 2017

Keywords

Comments

Periodic with period 10.
Similar sequences with formula gcd(n^2-1, n^2+k):
k= 1: 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, ... (A000034)
k= 3: 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, ... (A010685)
k= 5: 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, ... (A129203, start 6)
k= 7: 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, ... (A010689)
k= 9: 1, 10, 1, 2, 5, 2, 5, 2, 1, 10, 1, 10, 1, ... (this sequence)
k=11: 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, ... (A129197, start 12)
Connection between the values of a(n) and the last digit of n:
. if n ends with 0, 2 or 8, then a(n) = 1;
. if n ends with 1 or 9, then a(n) = 10;
. if n ends with 3, 5 or 7, then a(n) = 2;
. if n ends with 4 or 6, then a(n) = 5.
Also, continued fraction expansion of (57 + sqrt(4579))/114.

Crossrefs

Programs

  • Magma
    &cat [[1, 10, 1, 2, 5, 2, 5, 2, 1, 10]^^10];
    
  • Mathematica
    Table[PolynomialGCD[n^2 - 1, n^2 + 9], {n, 0, 100}]
    LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 10, 1, 2, 5, 2, 5, 2, 1, 10}, 100]
  • Maxima
    makelist(gcd(n^2-1, n^2+9), n, 0, 100);
    
  • PARI
    Vec((1 + 10*x + x^2 + 2*x^3 + 5*x^4 + 2*x^5 + 5*x^6 + 2*x^7 + x^8 + 10*x^9)/(1 - x^10) + O(x^100)) \\ Colin Barker, Mar 08 2017
  • Python
    [1, 10, 1, 2, 5, 2, 5, 2, 1, 10]*10
    
  • Sage
    [gcd(n^2-1, n^2+9) for n in range(100)]
    

Formula

G.f.: (1 + 10*x + x^2 + 2*x^3 + 5*x^4 + 2*x^5 + 5*x^6 + 2*x^7 + x^8 + 10*x^9)/(1 - x^10).

A083589 Expansion of 1/((1-4*x)*(1-x^4)).

Original entry on oeis.org

1, 4, 16, 64, 257, 1028, 4112, 16448, 65793, 263172, 1052688, 4210752, 16843009, 67372036, 269488144, 1077952576, 4311810305, 17247241220, 68988964880, 275955859520, 1103823438081, 4415293752324, 17661175009296, 70644700037184
Offset: 0

Views

Author

Paul Barry, May 02 2003

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[1/((1-4x)(1-x^4)),{x,0,30}],x] (* or *) LinearRecurrence[ {4,0,0,1,-4},{1,4,16,64,257},31] (* Harvey P. Dale, Sep 13 2011 *)
  • PARI
    a(n)=(4^(n+4)+64)\255 \\ Charles R Greathouse IV, Jul 09 2013

Formula

a(0)=1, a(n) = 4*a(n-1) if n is not a multiple of 4, otherwise a(n) = 4*a(n-1) + 1. - Vincenzo Librandi, Mar 19 2011
a(n) = 4^(n+4)/255 -1/12 +(-1)^n/20 +(-1)^floor(n/2)*A010685(n)/34. - R. J. Mathar, Mar 19 2011
a(0)=1, a(1)=4, a(2)=16, a(3)=64, a(4)=257, a(n) = 4*a(n-1) + a(n-4) - 4*a(n-5). - Harvey P. Dale, Sep 13 2011
a(n) = floor(64*(2^(2*(n+1))+1)/255). - Tani Akinari, Jul 09 2013

A166517 a(n) = (3 + 5*(-1)^n + 6*n)/4.

Original entry on oeis.org

2, 1, 5, 4, 8, 7, 11, 10, 14, 13, 17, 16, 20, 19, 23, 22, 26, 25, 29, 28, 32, 31, 35, 34, 38, 37, 41, 40, 44, 43, 47, 46, 50, 49, 53, 52, 56, 55, 59, 58, 62, 61, 65, 64, 68, 67, 71, 70, 74, 73, 77, 76, 80, 79, 83, 82, 86, 85, 89, 88, 92, 91, 95, 94, 98, 97, 101, 100, 104, 103, 107
Offset: 0

Views

Author

Vincenzo Librandi, Oct 16 2009

Keywords

Comments

A sequence defined by a(1)=1, a(n)=k*n-a(n-1), k a constant parameter, has recurrence a(n)= 3*a(n-1) -3*a(n-2) +a(n-3). Its generating function is x*(1+2*(k-1)*x+(1-k)*x^2)/((1+x)*(1-x)^2). The closed form is a(n) = k*n/2+k/4+(-1)^n*(3*k/4-1). This applies with k=3 to this sequence here, and for example to sequences A165033, and A166519-A166525. - R. J. Mathar, Oct 17 2009
From Paul Curtz, Feb 20 2010: (Start)
Also: A001651, terms swapped by pairs.
a(n) mod 9 defines a period-6 sequence which is a permutation of A141425. (End)

Crossrefs

Programs

  • Magma
    [(3 +5*(-1)^n+6*n)/4: n in [0..80]]; // Vincenzo Librandi, Sep 13 2013
  • Mathematica
    CoefficientList[Series[(2 x^2 - x + 2)/((1 + x) (x - 1)^2), {x, 0, 80}], x] (* Harvey P. Dale, Mar 25 2011 *)
    Table[(3 + 5 (-1)^n + 6 n) / 4, {n, 0, 100}] (* Vincenzo Librandi, Sep 13 2013 *)

Formula

a(n) = 3*n - a(n-1).
From Paul Curtz, Feb 20 2010: (Start)
a(n+1)-a(n) = (-1)^(n+1)*A010685(n).
Second differences: |a(n+2)-2*a(n+1)+a(n)| = A010716(n).
a(2*n) + a(2*n+1) = A016945(n) = 6*n+3.
a(2*n) = A016945(n).
a(2*n+1) = A016777(n). (End)
G.f. ( 2-x+2*x^2 ) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Mar 08 2011
E.g.f.: (1/4)*exp(-x)*(5 + 3*exp(2*x) + 6*x*exp(2*x)). - G. C. Greubel, May 15 2016
Sum_{n>=0} (-1)^(n+1)/a(n) = Pi/(3*sqrt(3)) (A073010). - Amiram Eldar, Feb 24 2023

Extensions

a(0)=2 added by Paul Curtz, Feb 20 2010

A140359 a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3).

Original entry on oeis.org

1, 1, 6, 11, 26, 51, 106, 211, 426, 851, 1706, 3411, 6826, 13651, 27306, 54611, 109226, 218451, 436906, 873811, 1747626, 3495251, 6990506, 13981011, 27962026, 55924051, 111848106, 223696211, 447392426, 894784851, 1789569706, 3579139411
Offset: 0

Views

Author

Paul Curtz, Jun 24 2008

Keywords

Comments

This is the sequence A(1,1;1,2;3) of the family of sequences [a,b:c,d:k] considered by G. Detlefs, and treated as A(a,b;c,d;k) in the W. Lang link given below. - Wolfdieter Lang, Oct 18 2010

Crossrefs

Programs

  • Magma
    [(5*2^(n+1) -9 + 5*(-1)^n)/6: n in [0..50]]; // G. C. Greubel, Oct 10 2017
  • Mathematica
    Table[(5*2^(n+1) -9 + 5*(-1)^n)/6, {n, 0, 50}] (* G. C. Greubel, Oct 10 2017 *)
    LinearRecurrence[{2,1,-2},{1,1,6},40] (* Harvey P. Dale, Mar 24 2021 *)
  • PARI
    for(n=0,50, print1((5*2^(n+1) -9 + 5*(-1)^n)/6, ", ")) \\ G. C. Greubel, Oct 10 2017
    

Formula

a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3).
a(n+1) - a(n) = 5*A001045(n), Jacobsthal numbers.
a(n+1) - 2*a(n) = (-1)^(n+1)* A010685(n).
From R. J. Mathar, Jul 10 2008: (Start)
O.g.f.: (1-x+3*x^2)/((x-1)*(2*x-1)*(1+x)).
a(n) = (5*2^(n+1) - 9 + 5*(-1)^n)/6. (End)
a(n) = a(n-1) + 2*a(n-2) +3, n>1 - Gary Detlefs, Jun 20 2010

Extensions

Extended by R. J. Mathar, Jul 10 2008

A171478 a(n) = 6*a(n-1) - 8*a(n-2) + 2 for n > 1; a(0) = 1, a(1) = 8.

Original entry on oeis.org

1, 8, 42, 190, 806, 3318, 13462, 54230, 217686, 872278, 3492182, 13974870, 55911766, 223671638, 894735702, 3579041110, 14316361046, 57265837398, 229064136022, 916258116950, 3665035613526, 14660148745558, 58640607565142
Offset: 0

Views

Author

Klaus Brockhaus, Dec 09 2009

Keywords

Comments

Second binomial transform of A168648.
Partial sums of A080960.

Crossrefs

Cf. A168648 ((10*2^n+2*(-1)^n)/3, a(0)=1), A080960 (third binomial transform of A010685), A171472, A171473.

Programs

  • GAP
    a:=[1,8];; for n in [3..25] do a[n]:=6*a[n-1]-8*a[n-2]+2; od; a; # Muniru A Asiru, Mar 22 2018
  • Magma
    [(10*4^n-9*2^n+2)/3: n in [0..30]]; // Vincenzo Librandi, Jul 18 2011
    
  • Maple
    a:= proc(n) option remember: if n = 0 then 1 elif n = 1 then 8 elif  n >= 2 then 6*procname(n-1) - 8*procname(n-2) + 2 fi; end:
    seq(a(n), n = 0..25); # Muniru A Asiru, Mar 22 2018
  • Mathematica
    RecurrenceTable[{a[0]==1,a[1]==8,a[n]==6a[n-1]-8a[n-2]+2},a,{n,30}] (* or *) LinearRecurrence[{7,-14,8},{1,8,42},30] (* Harvey P. Dale, May 04 2012 *)
  • PARI
    {m=23; v=concat([1, 8], vector(m-2)); for(n=3, m, v[n]=6*v[n-1]-8*v[n-2]+2); v}
    

Formula

a(n) = (10*4^n - 9*2^n + 2)/3.
G.f.: (1+x)/((1-x)*(1-2*x)*(1-4*x)).
a(0)=1, a(1)=8, a(2)=42, a(n) = 7*a(n-1) - 14*a(n-2) + 8*a(n-3). - Harvey P. Dale, May 04 2012
a(n) = A203241(n+1) + 2^n*(2^(n+1)-1), n>0. - J. M. Bergot, Mar 21 2018

A174571 a(4n)=n, a(4n+1)=4, a(4n+2)=1, a(4n+3)=4.

Original entry on oeis.org

0, 4, 1, 4, 1, 4, 1, 4, 2, 4, 1, 4, 3, 4, 1, 4, 4, 4, 1, 4, 5, 4, 1, 4, 6, 4, 1, 4, 7, 4, 1, 4, 8, 4, 1, 4, 9, 4, 1, 4, 10, 4, 1, 4, 11, 4, 1, 4, 12, 4, 1, 4, 13, 4, 1, 4, 14, 4, 1, 4, 15, 4, 1, 4, 16, 4, 1, 4, 17, 4, 1, 4, 18, 4, 1, 4, 19, 4, 1, 4, 20, 4, 1, 4
Offset: 0

Views

Author

Paul Curtz, Nov 29 2010

Keywords

Crossrefs

Cf. A010685.

Programs

  • Magma
    [(n mod 4) eq 0 select n/4 else Modexp(4,n,5): n in [0..90]]; // G. C. Greubel, Nov 23 2021
    
  • Mathematica
    Array[Which[OddQ@ Mod[#, 4], 4, Mod[#, 4] == 0, #/4, True, 1] &, 84, 0] (* or *)
    CoefficientList[Series[x*(4 +x +4*x^2 +x^3 -4*x^4 -x^5 -4*x^6)/(1-x^4)^2, {x, 0, 83}], x] (* Michael De Vlieger, Nov 06 2018 *)
    LinearRecurrence[{0,0,0,2,0,0,0,-1},{0,4,1,4,1,4,1,4},100] (* Harvey P. Dale, Dec 21 2024 *)
  • PARI
    A174571(n) = if(!(n%4),n/4,if(2==(n%4),1,4)); \\ Antti Karttunen, Nov 06 2018
    
  • Sage
    def A174571(n): return n/4 if (n%4==0) else power_mod(4,n,5)
    [A174571(n) for n in (0..90)] # G. C. Greubel, Nov 23 2021

Formula

a(n) = A010685(n) if 4 does not divide n.
a(n) = 2*a(n-4) - a(n-8).
G.f.: x*(4 + x + 4*x^2 + x^3 - 4*x^4 - x^5 - 4*x^6)/( (1-x)*(1+x)*(1+x^2) )^2.
a(n) = (36 +n +(n-28)*(-1)^n +2*(n -5 +(-1)^n)*cos(n*Pi/2) +(1+(-1)^n)*sin(n*Pi/2) )/16. - Wesley Ivan Hurt, May 07 2021
E.g.f.: (1/8)*(4*cosh(x) + (x+32)*sinh(x) - 4*cos(x) - x*sin(x)). - G. C. Greubel, Nov 23 2021
Previous Showing 11-20 of 26 results. Next