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.

Showing 1-10 of 16 results. Next

A152271 a(n)=1 for even n and (n+1)/2 for odd n.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1, 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20, 1, 21, 1, 22, 1, 23, 1, 24, 1, 25, 1, 26, 1, 27, 1, 28, 1, 29, 1, 30, 1, 31, 1, 32, 1, 33, 1, 34, 1, 35, 1, 36, 1, 37, 1, 38, 1, 39, 1, 40, 1, 41, 1, 42, 1, 43, 1, 44
Offset: 0

Views

Author

Philippe Deléham, Dec 01 2008

Keywords

Comments

A000012 and A000027 interleaved. - Omar E. Pol, Mar 12 2012
Run lengths in A128218. - Reinhard Zumkeller, Jun 20 2015
a(n+1) is the number of reversible binary strings of length n+1 with Hamming weight 1 or 2 such that the 1's are separated by an even number of 0's. - Christian Barrientos, Jan 28 2019
Simple continued fraction of -1 + BesselJ(1,2)/BesselJ(2,2) = 1/(1 + 1/(1 + 1/(1 + 1/(2 + 1/(1 + 1/(3 + 1/(1 + 1/(4 + 1/(1 + ... ))))))))). - Peter Bala, Oct 06 2023

Examples

			G.f. = 1 + x + x^2 + 2*x^3 + x^4 + 3*x^5 + x^6 + 4*x^7 + x^8 + ... - _Michael Somos_, Mar 26 2022
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a152271 = a057979 . (+ 2)
    a152271_list = concat $ transpose [repeat 1, [1..]]
    -- Reinhard Zumkeller, Aug 11 2014
    
  • Mathematica
    Table[If[EvenQ[n],1,(n+1)/2],{n,0,120}] (* or *) LinearRecurrence[{0,2,0,-1},{1,1,1,2},120] (* or *) Riffle[Range[60],1,{1,-1,2}] (* Harvey P. Dale, Jan 20 2018 *)
  • PARI
    Vec((1+x-x^2)/(1-2*x^2+x^4)+O(x^99)) \\ Charles R Greathouse IV, Jan 12 2012
    
  • PARI
    a(n)=gcd(n+1,(n+1)\2) \\ Charles R Greathouse IV, Mar 13 2012
    
  • Python
    def A152271(n): return n+1>>1 if n&1 else 1 # Chai Wah Wu, Jan 04 2024

Formula

a(n) = 2*a(n-2) - a(n-4) with a(0)=a(1)=a(2)=1 and a(3)=2.
a(n) = (a(n-2) + a(n-3))/a(n-1).
G.f.: (1 + x - x^2)/(1 - 2*x^2 + x^4).
a(n) = A057979(n+2).
a(n)*a(n+1) = floor((n+2)/2) = A008619(n). - Paul Barry, Feb 27 2009
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k,k)*0^floor((n-2k)/2). - Paul Barry, Feb 27 2009
a(n) = gcd(floor((n+1)/2), (n+1)). - Enrique Pérez Herrero, Mar 13 2012
G.f.: U(0) where U(k) = 1 + x*(k+1)/(1 - x/(x + (k+1)/U(k+1))) ; (continued fraction, 3-step). - Sergei N. Gladkovskii, Oct 04 2012
E.g.f.: ((2 + x)*cosh(x) + sinh(x))/2. - Stefano Spezia, Mar 26 2022
a(n) = (-1)^n * a(-2-n) for all n in Z. - Michael Somos, Mar 26 2022

A133622 a(n) = 1 if n is odd, a(n) = n/2+1 if n is even.

Original entry on oeis.org

1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1, 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20, 1, 21, 1, 22, 1, 23, 1, 24, 1, 25, 1, 26, 1, 27, 1, 28, 1, 29, 1, 30, 1, 31, 1, 32, 1, 33, 1, 34, 1, 35, 1, 36, 1, 37, 1, 38, 1, 39, 1, 40, 1, 41, 1, 42, 1, 43, 1, 44, 1
Offset: 1

Views

Author

Hieronymus Fischer, Sep 30 2007

Keywords

Comments

a(n) is the count of terms a(n+1) present so far in the sequence, with a(n+1) included in the count; example: a(1) = 1 "says" that there is 1 term "2" so far in the sequence; a(2) = 2 "says" that there are 2 terms "1" so far in the sequence... etc. This comment was inspired by A039617. - Eric Angelini, Mar 03 2020

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a133622 n = (1 - m) * n' + 1 where (n', m) = divMod n 2
    a133622_list = concat $ transpose [[1, 1 ..], [2 ..]]
    -- Reinhard Zumkeller, Feb 20 2015
    
  • Maple
    seq([1,n][],n=2..100); # Robert Israel, May 27 2016
  • Mathematica
    Riffle[Range[2,50],1,{1,-1,2}] (* Harvey P. Dale, Jan 19 2013 *)
  • PARI
    a(n)=if(n%2,1,n/2+1) \\ Charles R Greathouse IV, Sep 02 2015

Formula

a(n)=1+(binomial(n+1,2)mod n)=1+(binomial(n+1,n-1)mod n).
a(n)=binomial(n+2,2) mod n = binomial(n+2,n) mod n for n>2.
a(n)=1+(1+(-1)^n)*n/4.
a(n)=1+(A000217(n) mod n).
a(n)=a(n-2)+1, if n is even, a(n)=a(n-2) if n is odd.
a(n)=a(n-2)+1-(n mod 2)=a(n-2)+(1+(-1)^n)/2 for n>2.
a(n)=(a(n-3)+a(n-2))/a(n-1) for n>3.
G.f.: g(x)=x(1+2x-x^2-x^3)/(1-x^2)^2.
G.f.: (Q(0)-1-x)/x^2, where Q(k)= 1 + (k+1)*x/(1 - x/(x + (k+1)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 23 2013
a(n) = 2*a(n-2)-a(n-4) for n > 4. - Chai Wah Wu, May 26 2016
E.g.f.: exp(x) - 1 + x*sinh(x)/2. - Robert Israel, May 27 2016

A067992 a(0)=1 and, for n > 0, a(n) is the smallest positive integer such that the ratios min(a(k)/a(k-1), a(k-1)/a(k)) for 0 < k <= n are all distinct.

Original entry on oeis.org

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

Views

Author

John W. Layman, Feb 06 2002

Keywords

Comments

Every positive rational number appears exactly once as the ratio of adjacent terms (in either order). Conjecture: adjacent terms are always relatively prime. - Franklin T. Adams-Watters, Sep 13 2006

Examples

			The sequence of all rational numbers between 0 and 1 obtained by taking ratios of sorted consecutive terms begins: 1/2, 2/3, 1/3, 1/4, 3/4, 3/5, 1/5, 1/6, 5/6, 2/5, 2/7, 1/7, 1/8, 3/8, 3/7, 4/7, 4/5, 5/7, 6/7. - _Gus Wiseman_, Aug 30 2018
		

Crossrefs

See A066720 for a somewhat similar sequence.

Programs

  • Mathematica
    Nest[Function[seq,Append[seq,NestWhile[#+1&,1,MemberQ[Divide@@@Sort/@Partition[seq,2,1],Min[Last[seq]/#,#/Last[seq]]]&]]],{1},100] (* Gus Wiseman, Aug 30 2018 *)
  • PARI
    seen = Set([]); other(p) = for (v=1, oo, my (r = min(v,p)/max(v,p)); if (!set search(seen, r), seen = set union(seen, Set([r])); return (v)))
    for (n=0, 88, v = if (n==0, 1, other(v)); print1 (v ", ")) \\ Rémy Sigrist, Aug 07 2017

Formula

a(6)=3, since 1/4 and 2/4 = 1/2 have already occurred as ratios of adjacent terms.

A007879 Chimes made by clock striking the hour and half-hour.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12
Offset: 0

Views

Author

Jan Wolitzky

Keywords

Comments

Periodic sequence with period 24. - Michel Marcus, Jul 17 2013

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1+x-x^2-x^24-13x^25+x^26+12x^27)/((1-x^24)(1-x^2)^2),{x,0,71}],x] (* Stefano Spezia, Mar 27 2022 *)
  • PARI
    a(n)= 1 + ((n-1)*(1-(-1)^n)/4) % 12 \\ Michel Marcus, Jul 17 2013

Formula

From Hieronymus Fischer, Sep 25 2007: (Start)
G.f.: 1/(1-x^2)+x(12x^26-13x^24+1)/((1-x^24)(1-x^2)^2).
G.f.: (1+x-x^2-x^24-13x^25+x^26+12x^27)/((1-x^24)(1-x^2)^2).
a(n) = 1 + ((n-1)*(1-(-1)^n)/4) mod 12.
a(n) = 1 + ((n-1)*(n mod 2)/2) mod 12. (End)

A059222 Minimal number of disjoint edge-paths into which the graph of the n-ary cube can be partitioned.

Original entry on oeis.org

1, 1, 4, 1, 16, 1, 64, 1, 256, 1, 1024, 1, 4096, 1, 16384, 1, 65536, 1, 262144, 1, 1048576, 1, 4194304, 1, 16777216, 1, 67108864, 1, 268435456, 1, 1073741824, 1, 4294967296, 1, 17179869184, 1, 68719476736, 1, 274877906944, 1, 1099511627776, 1, 4398046511104
Offset: 1

Views

Author

Felix Golderg (felixg(AT)tx.technion.ac.il), Jan 19 2001

Keywords

Comments

The formula for this sequence is easily derived from a generalization of Euler's famous "Eulerian Path" theorem (see Theorem 11.2.4 in p. 419 of the reference).

Examples

			a(5)=16 because 2^(5-1)=16. Consequently, the minimal number of disjoint edge-paths into which the 5-ary cube can be partitioned is 16.
		

References

  • R. A. Brualdi, Introductory Combinatorics, 3rd ed. Prentice-Hall, 1999.

Crossrefs

Cf. A057979.

Programs

  • Mathematica
    Table[If[EvenQ[n],1,2^(n-1)],{n,80}] (* or *) Riffle[2^(2Range[0,50]),1] (* Harvey P. Dale, Nov 02 2011 *)

Formula

a(n) = 1 if n is even and 2^(n-1) if n is odd.
G.f. -x*(-1-x+x^2+4*x^3) / ( (x-1)*(2*x+1)*(2*x-1)*(1+x) ). - R. J. Mathar, Apr 25 2013
E.g.f.: cosh(x)*(1 + sinh(x)) - 1. - Stefano Spezia, Mar 26 2022

Extensions

More terms from Harvey P. Dale, Nov 02 2011

A133265 Diagonal of the A135356 triangle.

Original entry on oeis.org

2, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80
Offset: 0

Views

Author

Paul Curtz, Dec 20 2007

Keywords

Comments

Regular continued fraction expansion of 2*sin(1/2)/( cos(1/2) - sin(1/2) ) = 2.40822 34423 35827 84841 ... = 2 + 1/(2 + 1/(2 + 1/(4 + 1/(2 + 1/(6 + 1/(2 + 1/(8 + 1/(2 + ... )))))))). Cf. A019425. - Peter Bala, Feb 15 2015

Crossrefs

Cf. A019425.

Programs

  • Magma
    [(n+3+(n-1)*(-1)^(n+1))/2: n in [0..80]]; // Vincenzo Librandi, Aug 30 2011
    
  • Maple
    A133265 := n -> (n+2+(n-2)*(-1)^n)/2: # Peter Luschny, Aug 30 2011
  • Mathematica
    Table[(n + 3 + (n - 1) (-1)^(n + 1))/2, {n, 0, 79}] (* or *)
    Table[Mod[(2 n + 5), (n (3 + (-1)^n) - (-1)^n + 7)/2], {n, 0, 79}] (* or *)
    CoefficientList[Series[2 (1 + x - x^2)/((1 - x)^2*(1 + x)^2), {x, 0, 79}], x] (* Michael De Vlieger, Nov 18 2016 *)
  • PARI
    Vec(2*(1 + x - x^2) / ((1 - x)^2 * (1 + x)^2) + O(x^100)) \\ Colin Barker, Nov 17 2016

Formula

2*(A057979 without 1, 0, first two terms).
a(n) = (n+3+(n-1)*(-1)^(n+1))/2. - Vincenzo Librandi, Aug 30 2011
a(n) = (2*n + 5) mod (n*(3 + (-1)^n) - (-1)^n + 7)/2. - Lechoslaw Ratajczak, Nov 17 2016
From Colin Barker, Nov 17 2016: (Start)
a(n) = 2*a(n-2) - a(n-4) for n>3.
G.f.: 2*(1 + x - x^2) / ((1 - x)^2 * (1 + x)^2).
(End)

A134519 Numbers remaining when the natural numbers (A000027) are arranged into a triangle and only the beginning and end terms of each row are retained.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 10, 11, 15, 16, 21, 22, 28, 29, 36, 37, 45, 46, 55, 56, 66, 67, 78, 79, 91, 92, 105, 106, 120, 121, 136, 137, 153, 154, 171, 172, 190, 191, 210, 211, 231, 232, 253, 254, 276, 277, 300, 301, 325, 326, 351, 352, 378, 379, 406, 407, 435, 436, 465, 466
Offset: 1

Views

Author

Rick L. Shepherd, Oct 29 2007

Keywords

Comments

Equivalently, this is TriRet(A000027,{1}) = TriRem(A000027,{2,3,4,...}), using the operations defined in A134509. Bisections are A000217-{0} and A000124-{1}. A055802 and A114220 appear to be this sequence with two and three additional leading terms, respectively.

Crossrefs

Cf. A084263: A000217(m) + (1 + (-1)^m)/2.
Cf. A117142: A000217(floor(m/2)+1) - (1 + (-1)^m)/2.

Programs

  • GAP
    a:=[];; for n in [1..60] do if n mod 2=0 then Add(a,(16+4*n+2*n^2)/16); else Add(a,(3+4*n+n^2)/8); fi; od; a; # Muniru A Asiru, Dec 21 2018
    
  • Magma
    T:=func; [T(Floor((n+1)/2))+(1+(-1)^n)/2: n in [1..60]]; // Bruno Berselli, Aug 20 2019
  • Maple
    seq(coeff(series(-x*(x^4-x^3-x^2+x+1)/((x-1)^3*(x+1)^2),x,n+1), x, n), n = 1 .. 60); # Muniru A Asiru, Dec 21 2018
  • Mathematica
    Table[Sum[If[EvenQ[k], 1, (k - 1)/2], {k, 0, n}], {n, 60}] (* Jon Maiga, Dec 21 2018 *)
    LinearRecurrence[{1,2,-2,-1,1},{1,2,3,4,6},60] (* Harvey P. Dale, Oct 13 2024 *)

Formula

From Colin Barker, Jul 17 2013: (Start)
a(n) = (16 + 4*n + 2*n^2)/16 for n even, a(n) = (3 + 4*n + n^2)/8 for n odd.
G.f.: -x*(x^4 - x^3 - x^2 + x + 1) / ((x - 1)^3*(x + 1)^2). (End)
a(n) = Sum_{k=0..n-1} A057979(k). - Jon Maiga, Dec 21 2018
a(n) = A000217(floor(n+1)/2) + (1 + (-1)^n)/2. - Bruno Berselli, Aug 20 2019

A175686 a(n) = binomial(n-j-1,j) + binomial(n-j,j-1) with j= floor((n-1)/2).

Original entry on oeis.org

0, 1, 1, 2, 3, 4, 7, 7, 14, 11, 25, 16, 41, 22, 63, 29, 92, 37, 129, 46, 175, 56, 231, 67, 298, 79, 377, 92, 469, 106, 575, 121, 696, 137, 833, 154, 987, 172, 1159, 191, 1350, 211, 1561, 232, 1793, 254, 2047, 277, 2324, 301, 2625, 326, 2951, 352, 3303, 379
Offset: 0

Author

Roger L. Bagula, Dec 04 2010

Keywords

Comments

The column m=1 in the array A175685, where the sum over the binomials reduces to only two terms.

Crossrefs

Programs

  • Mathematica
    Table[Sum[Binomial[n - j - 1, j], {j, Floor[(n - 1)/2] - 1, Floor[(
        n - 1)/2]}], {n, 0, 30}]
    CoefficientList[Series[-(x^3-x^2-x)(x^4-x^2+1)/(x^2-1)^4, {x, 0, 30}],x] (* Benedict W. J. Irwin, Oct 31 2016 *)
    Table[(42+20n+6n^2+n^3+(-1)^n(-42+20n-6n^2+n^3))/96, {n, 0, 30}] (* Benedict W. J. Irwin, Oct 31 2016 *)
    LinearRecurrence[{0,4,0,-6,0,4,0,-1},{0,1,1,2,3,4,7,7},60] (* Harvey P. Dale, Jul 29 2018 *)
  • PARI
    concat(0, Vec(x*(1+x-x^2)*(1-x^2+x^4)/((1-x)^4*(1+x)^4) + O(x^100))) \\ Colin Barker, Oct 31 2016

Formula

a(n) = A057979(n+1) + binomial(n-j,j-1) with j = A004526(n-1), n>0.
From Benedict W. J. Irwin, Oct 31 2016: (Start)
G.f.: -(x^3 - x^2 - x)*(x^4 - x^2 + 1)/(x^2 - 1)^4.
E.g.f.: ((6*x + 3*x^2)*cosh(x) + (42 + 21*x + 6*x^2 + x^3)*sinh(x))/48.
a(n) = (42 + 20*n + 6*n^2 + n^3 + (-1)^n*(-42 + 20*n - 6*n^2 + n^3))/96. (End)
a(n) = 4*a(n-2)-6*a(n-4)+4*a(n-6)-a(n-8) for n>7. - Colin Barker, Oct 31 2016

Extensions

More terms from Colin Barker, Oct 31 2016

A335943 Lexicographically earliest sequence of positive terms such that for any distinct m and n, the fractional parts of a(m)/a(m+1) and of a(n)/a(n+1) are distinct.

Original entry on oeis.org

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

Author

Rémy Sigrist, Jul 01 2020

Keywords

Comments

For any k > 1, k appears up to A000010(k) times.
This sequence has similarities with A057979 and A088177, where we consider the ratio and the product of consecutive terms, respectively.

Examples

			The first terms, alongside the fractional part of a(n)/a(n+1), are:
  n   a(n)  frac(a(n)/a(n+1))
  --  ----  -----------------
   1     1          0
   2     1         1/2
   3     2         2/3
   4     3         3/4
   5     4         1/3
   6     3         3/5
   7     5         1/4
   8     4         4/5
   9     5         5/6
  10     6         1/5
		

Crossrefs

See A335944 for a similar sequence.

Programs

  • PARI
    See Links section.

A160444 Expansion of g.f.: x^2*(1 + x - x^2)/(1 - 2*x^2 - 2*x^4).

Original entry on oeis.org

0, 1, 1, 1, 2, 4, 6, 10, 16, 28, 44, 76, 120, 208, 328, 568, 896, 1552, 2448, 4240, 6688, 11584, 18272, 31648, 49920, 86464, 136384, 236224, 372608, 645376, 1017984, 1763200, 2781184, 4817152, 7598336, 13160704, 20759040, 35955712, 56714752
Offset: 1

Author

Willibald Limbrunner (w.limbrunner(AT)gmx.de), May 14 2009

Keywords

Comments

This sequence is the case k=3 of a family of sequences with recurrences a(2*n+1) = a(2*n) + a(2*n-1), a(2*n+2) = k*a(2*n-1) + a(2*n), a(1)=0, a(2)=1. Values of k, for k >= 0, are given by A057979 (k=0), A158780 (k=1), A002965 (k=2), this sequence (k=3). See "Family of sequences for k" link for other connected sequences.
It seems that the ratio of two successive numbers with even, or two successive numbers with odd, indices approaches sqrt(k) for these sequences as n-> infinity.
This algorithm can be found in a historical figure named "Villardsche Figur" of the 13th century. There you can see a geometrical interpretation.

Programs

  • Magma
    I:=[0,1,1,1]; [n le 4 select I[n] else 2*(Self(n-2) +Self(n-4)): n in [1..40]]; // G. C. Greubel, Feb 18 2023
    
  • Mathematica
    LinearRecurrence[{0,2,0,2}, {0,1,1,1}, 40] (* G. C. Greubel, Feb 18 2023 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A160444
        if (n<5): return ((n+1)//3)
        else: return 2*(a(n-2) + a(n-4))
    [a(n) for n in range(1, 41)] # G. C. Greubel, Feb 18 2023

Formula

a(n) = 2*a(n-2) + 2*a(n-4).
a(2*n+1) = A002605(n).
a(2*n) = A026150(n-1).

Extensions

Edited by R. J. Mathar, May 14 2009
Showing 1-10 of 16 results. Next