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.

User: Colm Mulcahy

Colm Mulcahy's wiki page.

Colm Mulcahy has authored 15 sequences. Here are the ten most recent ones:

A225232 The number of FO3C2 moves required to restore a packet of n playing cards to its original state (order and orientation).

Original entry on oeis.org

2, 4, 4, 12, 6, 24, 8, 40, 10, 60, 12, 84, 14, 112, 16, 144, 18, 180, 20, 220, 22, 264, 24, 312, 26, 364, 28, 420, 30, 480, 32, 544, 34, 612, 36, 684, 38, 760, 40, 840, 42, 924, 44, 1012, 46, 1104, 48, 1200, 50, 1300, 52, 1404, 54, 1512, 56, 1624, 58, 1740, 60, 1860, 62, 1984
Offset: 3

Author

Colm Mulcahy, May 03 2013

Keywords

Comments

Each FO3C2 move Flips Over the top 3 cards as a unit and then Cuts 2 cards from the top to bottom. - Mulcahy

References

  • Colm Mulcahy, Mathematical Card Magic: Fifty-Two New Effects, A K Peters, 2013, chapter 9.

Crossrefs

The even numbered terms are A046092.
Cf. A106232.

Programs

  • PARI
    a(n)={
        if(n<6,return(if(n>3,4,2)));
        n--;
        my(deck=vector(n,i,i),original=deck,steps);
        while(1,
            steps+=2;
            deck=concat(deck[5..n],-[deck[2],deck[1],deck[4],deck[3]]);
            if(deck==original,return(steps))
        )
    }; \\ Charles R Greathouse IV, May 03 2013
    
  • PARI
    a(n)=if(n%2,n-1,n*(n-2)/2) \\ Charles R Greathouse IV, May 06 2013
    
  • PARI
    Vec(2*x^3*(x^2-2*x-1)/((x-1)^3*(x+1)^3) + O(x^100)) \\ Colin Barker, Jun 04 2014

Formula

Assume n >=3. For odd n we have a(n) = n-1 and for even n we have a(n) = (n-2)n/2. Equivalently, a(2k+1) = 2k and a(2k) = 2k(k-1).
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6). - Colin Barker, Jun 04 2014
G.f.: 2*x^3*(x^2-2*x-1) / ((x-1)^3*(x+1)^3). - Colin Barker, Jun 04 2014

Extensions

a(10), a(12)-a(64) from Charles R Greathouse IV, May 03 2013

A221564 The number of FO4C3 moves required to restore a packet of n playing cards to its original state (order and orientation), where each move Flips Over the top four (4) as a unit and then Cuts three (3) cards from the top to bottom.

Original entry on oeis.org

2, 4, 4, 4, 12, 12, 6, 24, 24, 8, 40, 40, 10, 60, 60, 12, 84, 84, 14, 112, 112, 16, 144, 144, 18, 180, 180, 20, 220, 220, 22, 264, 264, 24, 312, 312, 26, 364, 364, 28, 420, 420, 30, 480, 480, 32, 544, 544, 34, 612, 612, 36, 684, 684, 38, 760, 760, 40, 840, 840
Offset: 4

Author

Colm Mulcahy, May 04 2013

Keywords

Comments

Conjecture: a(3k+1) = 2k.
The top card remains on top but is flipped over with each move. The remaining cards split into three cycles either of length 2*floor((n-1)/3) or 2*ceiling((n-1)/3). - Andrew Howroyd, Apr 27 2020

Crossrefs

Cf. A225232.

Programs

  • PARI
    a(n)={2*((n-1)\3)*if(n%3==1, 1, (n-1)\3+1)} \\ Andrew Howroyd, Apr 27 2020
    
  • PARI
    Vec(2*x^4*(1 + 2*x + 2*x^2 - x^3) / ((1 - x)^3*(1 + x + x^2)^3) + O(x^40)) \\ Colin Barker, Apr 29 2020

Formula

a(3*n+1) = 2*n; a(3*n) = a(3*n-1) = 2*n*(n-1). - Andrew Howroyd, Apr 27 2020
From Colin Barker, Apr 29 2020: (Start)
G.f.: 2*x^4*(1 + 2*x + 2*x^2 - x^3) / ((1 - x)^3*(1 + x + x^2)^3).
a(n) = 3*a(n-3) - 3*a(n-6) + a(n-9) for n>12.
(End)

Extensions

a(16) corrected and terms a(17) and beyond from Andrew Howroyd, Apr 27 2020

A202475 Decimal expansion of the real number x between 3 and 4 where 2^x = x!.

Original entry on oeis.org

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

Author

Colm Mulcahy, Dec 19 2011

Keywords

Comments

2^3 > 3! but 2^4 < 4!. Since the exponential and generalized factorial (Gamma) functions are continuous, it follows that 2^x = x! ( = gamma(x+1) ) for some x between 3 and 4. It's about 3.45986564404500.

Examples

			3.459865644044999134187861081068981202775184599...
		

Programs

  • Mathematica
    RealDigits[x/.FindRoot[2^x==x!,{x,3,4},WorkingPrecision->120]][[1]] (* Harvey P. Dale, Jan 22 2016 *)
  • PARI
    solve(x=3, 4, 2^x-gamma(x+1)) \\ Michel Marcus, Aug 03 2013

Extensions

More terms from D. S. McNeil, Dec 19 2011

A161172 a(n) is the order (or period) of the "Yummie" permutation applied to a set of n objects.

Original entry on oeis.org

1, 2, 3, 3, 5, 5, 6, 7, 15, 20, 11, 24, 24, 14, 6, 28, 17, 120, 55, 180, 21, 18, 60, 42, 90, 153, 140, 429, 56, 152, 60, 70, 483, 3640, 180, 272, 72, 1260, 180, 252, 174, 1260, 36, 442, 1404, 660, 47, 496, 240, 481, 48, 98, 570, 572
Offset: 1

Author

Colm Mulcahy, Jun 04 2009

Keywords

Comments

The Yummie permutation is done as follows. Start with a packet of n cards (numbered 1 to n from top to bottom), and deal them into two piles, first to a spectator (pile A), and then to yourself (pile B), saying "You, me," silently to yourself over and over. Then, pick up pile B and deal again, first to the spectator, thereby adding to the existing pile A, and then to yourself, forming a new pile B. Repeat, picking up the diminished pile B, and dealing "You, me" as before. Eventually, just one card remains in pile B; place it on top of pile A. The sequence of cards in pile A determines the Yummie permutation ("You, me" said fast sounds like "Yummie").

Examples

			a(9) = 15, because when the Yummie permutation is applied to {1,2,3,4,5,6,7,8,9} we get {6,2,4,8,9,7,5,3,1}, which corresponds to the product of a disjoint five cycle and a three cycle, and hence has order 15.
		

Crossrefs

Programs

  • PARI
    P(n,i)={if(i%2, n-(i\2), P(n\2, (n-i)\2+1))}
    Follow(s, f)={my(t=f(s), k=1); while(t>s, k++; t=f(t)); if(s==t, k, 0)}
    Cycles(n)={my(L=List()); for(i=1, n, my(k=Follow(i, j->P(n, j))); if(k, listput(L,k))); vecsort(Vec(L))}
    a(n)={lcm(Cycles(n))} \\ Andrew Howroyd, Apr 28 2020

A161173 a(n) is the order (or period) of the "Cat's" permutation applied to a list of n objects.

Original entry on oeis.org

1, 1, 3, 4, 2, 4, 6, 10, 6, 10, 14, 12, 30, 36, 24, 14, 12, 56, 18, 66, 10, 60, 14, 110, 198, 126, 48, 133, 210, 78, 105, 18, 18, 110, 660, 396, 93, 552, 120, 616, 276, 345, 43, 108, 1122, 204, 702, 1904, 138, 598, 2310, 1080, 132, 330
Offset: 1

Author

Colm Mulcahy, Jun 04 2009, Jun 07 2009

Keywords

Comments

The Cat's permutation is done as follows. Start with a packet of n cards (numbered 1 to n from top to bottom), and deal them into two piles, first to yourself (pile B), and then to a spectator (pile A), saying "Me, you," silently to yourself over and over. Pick up pile B and deal again, first to yourself, forming a new pile B, and then to the spectator, thereby adding to the existing pile A. Repeat, picking up the diminished pile B, and dealing "Me, you" as before. Eventually, just one card remains in pile B; place it on top of pile A. The sequence of the cards in pile A determines the Cat's permutation ("Me, you" said fast sounds like something a cat says).
Values for n = 4, 19 and 27 given in the 'period' column of the table for the Cat's deal in the Colm Mulachy link are incorrect. However, the corresponding cycle decompositions are correct. - Andrew Howroyd, Apr 28 2020

Examples

			a(9) = 6, because when the Cat's permutation is applied to {1,2,3,4,5,6,7,8,9} we get {9,1,5,3,7,8,6,4,2}, which corresponds to the product of a disjoint six cycle and a three cycle, and hence has order lcm(6,3)=6.
		

Crossrefs

Cf. A161172.

Programs

  • PARI
    P(n,i)={if(n==1, 1, if(i%2==0, n+1-i\2, P((n+1)\2, (n+1)\2-i\2)))}
    Follow(s, f)={my(t=f(s), k=1); while(t>s, k++; t=f(t)); if(s==t, k, 0)}
    Cycles(n)={my(L=List()); for(i=1, n, my(k=Follow(i, j->P(n, j))); if(k, listput(L,k))); vecsort(Vec(L))}
    a(n)={lcm(Cycles(n))} \\ Andrew Howroyd, Apr 28 2020

Extensions

Some terms corrected by Andrew Howroyd, Apr 28 2020

A138181 Largest Fibonacci number not exceeding the n-th prime.

Original entry on oeis.org

2, 3, 5, 5, 8, 13, 13, 13, 21, 21, 21, 34, 34, 34, 34, 34, 55, 55, 55, 55, 55, 55, 55, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 233, 233
Offset: 1

Author

Colm Mulcahy, Mar 04 2008

Keywords

Comments

a(n) = largest summand in the Zeckendorf representation of the n-th prime

Examples

			a(4)=5 because 5 is the largest Fibonacci number not exceeding 7 (the 4th prime)
		

Crossrefs

Programs

  • Mathematica
    With[{rf=Reverse[Fibonacci[Range[20]]]},Flatten[Table[Select[rf,#<=Prime[ n]&,1],{n,60}]]] (* Harvey P. Dale, May 25 2013 *)

Extensions

Corrected by Harvey P. Dale, May 25 2013

A138185 Smallest prime >= n-th Fibonacci number.

Original entry on oeis.org

2, 2, 2, 2, 3, 5, 11, 13, 23, 37, 59, 89, 149, 233, 379, 613, 991, 1597, 2591, 4201, 6779, 10949, 17713, 28657, 46381, 75029, 121403, 196429, 317827, 514229, 832063, 1346273, 2178313, 3524603, 5702897, 9227479, 14930387, 24157823, 39088193
Offset: 0

Author

Colm Mulcahy, Mar 04 2008

Keywords

Examples

			a(6) = 11 because 11 is the smallest prime not less than 8 (the 6th Fibonacci number).
		

Crossrefs

Cf. A138184.

Programs

  • Maple
    with(combinat): a:=proc(n) if isprime(fibonacci(n))=true then fibonacci(n) else nextprime(fibonacci(n)) end if end proc: seq(a(n),n=0..35); # Emeric Deutsch, Mar 31 2008
  • Mathematica
    fib[0] = 0; fib[1] = 1; fib[n_] := fib[n] = fib[n - 1] + fib[n - 2] nextprime[n_] := Module[{k = n},While[Not[PrimeQ[k]], k++ ]; k] Table[nextprime[fib[n]], {n, 0, 50}] (* Erich Friedman, Mar 26 2008 *)
    NextPrime/@(Fibonacci[Range[0,50]]-1) (* Harvey P. Dale, Nov 23 2011 *)

Extensions

More terms from Erich Friedman and Emeric Deutsch, Mar 26 2008
Changed the definition of Fibonacci number to F(0) = 0, F(1) = 1, which is the standard definition. - Harry J. Smith, Jan 06 2009

A138184 Largest prime not exceeding Fibonacci(n) = A000045(n).

Original entry on oeis.org

2, 3, 5, 7, 13, 19, 31, 53, 89, 139, 233, 373, 607, 983, 1597, 2579, 4177, 6763, 10939, 17707, 28657, 46351, 75017, 121379, 196387, 317797, 514229, 832003, 1346249, 2178283, 3524569, 5702867, 9227443, 14930341, 24157811, 39088157, 63245971
Offset: 3

Author

Colm Mulcahy, Mar 04 2008

Keywords

Examples

			a(8) = 19 because 19 is the largest prime not exceeding 21 = A000045(8).
		

Crossrefs

Programs

  • Maple
    A138184 := proc(n) prevprime(combinat[fibonacci](n)+1) ; end: seq(A138184(n),n=3..45) ; # R. J. Mathar, Apr 22 2008
  • Mathematica
    PrimePrev[n_]:=Module[{k=n},While[ !PrimeQ[k],k-- ];k];f[n_]:=Fibonacci[n];lst={};Do[AppendTo[lst,PrimePrev[f[n]]],{n,5!}];lst (* Vladimir Joseph Stephan Orlovsky, Feb 26 2010 *)

Formula

a(n) = A000040(A054782(n)). - R. J. Mathar, Apr 22 2008

Extensions

Edited and extended by R. J. Mathar, Apr 22 2008
Offset changed from 4 to 3 by Harry J. Smith, Jan 02 2009

A138183 Smallest Fibonacci number not less than the n-th prime.

Original entry on oeis.org

2, 3, 5, 8, 13, 13, 21, 21, 34, 34, 34, 55, 55, 55, 55, 55, 89, 89, 89, 89, 89, 89, 89, 89, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 377, 377
Offset: 1

Author

Colm Mulcahy, Mar 04 2008

Keywords

Examples

			a(4) = 8 because the 8 is the smallest Fibonacci number not less than 7 (the 4th prime).
		

Crossrefs

Programs

  • Mathematica
    With[{fibs=Fibonacci[Range[20]]},Table[SelectFirst[fibs,#>=n&],{n,Prime[ Range[60]]}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 22 2018 *)
  • PARI
    a(n) = {p = prime(n); i = 0; until ((f = fibonacci(i)) >= p, i++); f;} \\ Michel Marcus, Aug 31 2013

A138182 Smallest summand in the Zeckendorf representation of the n-th prime.

Original entry on oeis.org

2, 3, 5, 2, 3, 13, 1, 1, 2, 8, 2, 3, 2, 1, 13, 1, 1, 1, 1, 3, 5, 3, 2, 89, 8, 1, 1, 5, 2, 3, 1, 8, 1, 3, 5, 2, 13, 1, 2, 8, 1, 3, 13, 2, 1, 55, 1, 3, 2, 1, 233, 1, 8, 5, 3, 1, 2, 1, 2, 1, 3, 5, 1, 2, 1, 8, 1, 2, 1, 1, 2, 3, 3, 1, 2, 1, 1, 2, 3, 3, 8, 2, 2, 1, 2, 3, 1, 1, 8, 2, 1, 13, 21, 1, 1, 3, 1, 144, 2, 2
Offset: 1

Author

Colm Mulcahy, Mar 04 2008

Keywords

Examples

			a(5) = 3 because the Zeckendorf representation of the 5th prime is 11 = 3 + 8.
		

Crossrefs

Programs

  • Python
    from sympy import prime
    def A138182(n):
        m, tlist = prime(n), [1,2]
        while tlist[-1]+tlist[-2] <= m:
            tlist.append(tlist[-1]+tlist[-2])
        for d in tlist[::-1]:
            if d == m:
                return d
            elif d < m:
                m -= d # Chai Wah Wu, Jun 14 2018

Formula

a(n) = A139764(A000040(n)). [From R. J. Mathar, Oct 23 2010]

Extensions

a(8) replaced by 1. Sequence extended beyond a(18) - R. J. Mathar, Oct 23 2010