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-6 of 6 results.

A057979 a(n) = 1 for even n and (n-1)/2 for odd n.

Original entry on oeis.org

1, 0, 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
Offset: 0

Views

Author

Labos Elemer, Nov 13 2000

Keywords

Comments

a(n) = b(n)/c(n) where b(n) = A001405(n+1) - A001405(n), c(n) = gcd(A001405(n+1), A001405(n)).
Also the minimal number of disjoint edge-paths into which the complete graph on n edges can be partitioned - Felix Goldberg (felixg(AT)tx.technion.ac.il), Jan 19 2001
For n >= 2, number of partitions of n-2 into parts that are distinct mod 2. - Giovanni Resta, Feb 06 2006
Sequence starting with a(3) obeys the rule "smallest positive value such that the ordered pair (a(n-1),a(n)) has not occurred previously", or the rule "smallest positive value such that the ratio a(n-1)/a(n) has not occurred previously". The same subsequence has its ordinal transform equal to itself, shifted left. (The ordinal transform has as its n-th term the number of values in a(1),...,a(n) that are equal to a(n).) - Franklin T. Adams-Watters, Dec 13 2006
Numerators of floor(n/2)/n, n > 0. - Wesley Ivan Hurt, Jun 14 2013
Number of nonisomorphic outer planar graphs of order n >= 3, maximum degree 3, and largest possible size. The size is (3n-2)/2 when n is even and (3n-3)/2 when n is odd. - Christian Barrientos and Sarah Minion, Feb 27 2018

Examples

			For n=12, C(12,6) - C(11,5) = 924 - 462 = 462, gcd(C(12,6), C(11,5)) = 462, and the quotient is 1.
For n=13, C(13,6) - C(12,6) = 792, gcd(C(13,6), C(12,6)) = 132, and the quotient is 6.
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a057979 n = 1 - rest * (1 - n') where (n', rest) = divMod n 2
    a057979_list = concat $ transpose [repeat 1, [0..]]
    -- Reinhard Zumkeller, Aug 11 2014
    
  • Magma
    [Floor(n/2)^(n mod 2): n in [0..100]]; // Vincenzo Librandi, Mar 17 2015
    
  • Maple
    A057979:=n->(n+1)/4+(3-n)*(-1)^n/4; seq(A057979(k), k=0..100); # Wesley Ivan Hurt, Oct 14 2013
  • Mathematica
    With[{no=45},Riffle[Table[1,{no}],Range[0,no-1]]] (* Harvey P. Dale, Feb 18 2011 *)
  • PARI
    a(n)=if(n%2,n-1,2)/2 \\ Charles R Greathouse IV, Sep 02 2015
    
  • Python
    def A057979(n): return n>>1 if n&1 else 1 # Chai Wah Wu, Jan 04 2024

Formula

a(n) = (n+1)/4+(3-n)*(-1)^n/4. - Paul Barry, Mar 21 2003, corrected by Hieronymus Fischer, Sep 25 2007
a(n) = (a(n-2) + a(n-3)) / a(n-1).
From Paul Barry, Oct 21 2004: (Start)
G.f.: (1-x^2+x^3)/((1+x)^2(1-x)^2);
a(n) = 2*a(n-2) - a(n-4);
a(n) = 0^n + Sum_{k=0..floor((n-2)/2)} C(n-k-2,k) * C(1,n-2k-2). (End)
a(n) = gcd(n-1, floor((n-1)/2)). - Paul Barry, May 02 2005
a(n) = binomial((2n-3)/4-(-1)^n/4, (1-(-1)^n)/2). - Paul Barry, Jun 29 2006
G.f.: (x^3-x^2+1)/(1-x^2)^2 = 1 + x^2*G(0) where G(k) = 1 + x*(k+1)/(1 - x/(x + (k+1)/G(k+1) )); (continued fraction, 3-step). - Sergei N. Gladkovskii, Nov 29 2012
a(n) = binomial(floor(n/2), n mod 2). - Wesley Ivan Hurt, Oct 14 2013
a(n) = 1 - n mod 2 * (1 - floor(n/2)). - Reinhard Zumkeller, Aug 11 2014
a(n) = floor(n/2)^(n mod 2). - Wesley Ivan Hurt, Mar 16 2015
E.g.f.: ((2 + x)*cosh(x) - sinh(x))/2. - Stefano Spezia, 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

A001492 Clock chimes with a quarter-hour bell.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Periodic sequence with period 48. - Michel Marcus, Jul 16 2013

Crossrefs

Programs

  • PARI
    a(n)=if((n+1)%4,1,((n+1)/4-1)%12+1)

A007884 Chimes made by clock striking quarter-hours.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

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

Crossrefs

Programs

  • Mathematica
    Table[Flatten[Table[PadRight[{1,2,3},4,h],{h,12}]],{2}]//Flatten (* Harvey P. Dale, Jun 16 2023 *)
  • PARI
    a(n)= if((n+1)%4, (n+1)%4, ((n+1)/4-1)%12+1) \\ Michel Marcus, Jul 17 2013

A179820 a(n) = n-th triangular number mod (n+2).

Original entry on oeis.org

0, 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, 45
Offset: 0

Views

Author

Zak Seidov, Jul 28 2010

Keywords

Crossrefs

Essentially the same as A133622.

Programs

  • Mathematica
    Table[Mod[n(n+1)/2,n+2],{n,0,200}]
    LinearRecurrence[{0,2,0,-1},{0,1,3,1,4},110] (* or *) Join[{0,1},Riffle[Range[3,50],1]] (* Harvey P. Dale, Apr 02 2024 *)

Formula

a(0)=0, afterwards if n is odd then a(n)=1 else a(n)=(n+4)/2
a(0)=0, afterwards a(n)=1 for odd n and n/2+2 for even n.
a(n)= +2*a(n-2) -a(n-4), n>4. a(n) = (6+n*((-1)^n+1)+2*(-1)^n)/4, n>0. G.f.: -x*(-1-3*x+x^2+2*x^3) / ( (x-1)^2*(1+x)^2 ). [From R. J. Mathar, Aug 03 2010]

A289742 Sizes of wrenches (or spanners) using imperial units.

Original entry on oeis.org

1, 4, 5, 16, 3, 8, 7, 16, 1, 2, 9, 16, 5, 8, 11, 16, 3, 4, 13, 16, 7, 8, 15, 16, 1, 1, 17, 16, 9, 8, 19, 16, 5, 4, 21, 16, 11, 8, 23, 16, 3, 2, 25, 16, 13, 8, 27, 16, 7, 4, 29, 16, 15, 8, 31, 16, 2, 1, 33, 16, 17, 8, 35, 16, 9, 4, 37, 16, 19, 8, 39, 16, 5, 2
Offset: 1

Views

Author

Robert Cailliau, Jul 11 2017

Keywords

Comments

Found on sets of wrenches (US) or spanners (UK) for nut sizes in imperial units. List gives pairs (numerator, denominator) for the reduced fractions that specify the sizes.

Examples

			The fractions are 1/4, 5/16, 3/8, 7/16, 1/2, etc.
		

Crossrefs

Cf. A007879.

Programs

  • Mathematica
    {Numerator[#],Denominator[#]}&/@NestList[#+1/16&,1/4,50]//Flatten (* Harvey P. Dale, Oct 13 2018 *)

Formula

The sizes, which come in integer multiples of 1/16 inch, are equal to 4/16", 5/16", 6/16", ... but as it is customary to reduce fractions, these sizes are embossed on the wrenches as 1/4, 5/16, 3/8, .... This reduction leads to a set of numbers that are not as simple as those on metric wrenches (where the sequence is simply 6mm, 7mm, 8mm, 9mm, ...) and can make it more difficult to find the next larger or smaller wrench if the current one does not fit. So far nobody has ever been able to find the next number when I give the first 7 terms. It is similar in fun value to the clock chiming sequence A007879.

Extensions

More terms from Harvey P. Dale, Oct 13 2018
Edited by Jon E. Schoenfield, Jul 18 2021
Showing 1-6 of 6 results.