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

A305151 a(n) = (2n+1) - A294673(n), the amount by which A294673 is less than the maximum possible for n.

Original entry on oeis.org

0, 0, 0, 3, 0, 0, 4, 10, 5, 7, 14, 0, 17, 7, 0, 25, 0, 0, 17, 0, 0, 15, 33, 11, 34, 0, 0, 19, 13, 35, 41, 56, 0, 31, 0, 11, 31, 60, 57, 27, 0, 0, 76, 27, 0, 31, 53, 0, 85, 0, 17, 37, 0, 79, 91, 74, 0, 85, 25, 0, 40, 87, 100, 119, 93, 0, 111, 0, 117, 109, 94, 83, 97, 31, 17, 51, 102, 0
Offset: 0

Views

Author

P. Michael Hutchins, May 26 2018

Keywords

Comments

Motivation: A294673(n), which is always <= 2n+1, equals n in most cases. This sequence abstracts out that commonality to leave a cleaner signal.

Crossrefs

Cf. A294673.

Programs

  • PARI
    a(n) = (2*n+1) - znorder(Mod(if(n%2, 2, -2), 4*n+3)); \\ Michel Marcus, May 26 2018

A163778 Odd terms in A054639.

Original entry on oeis.org

3, 5, 9, 11, 23, 29, 33, 35, 39, 41, 51, 53, 65, 69, 81, 83, 89, 95, 99, 105, 113, 119, 131, 135, 155, 173, 179, 183, 189, 191, 209, 221, 231, 233, 239, 243, 245, 251, 261, 273, 281, 293, 299, 303, 309, 323, 329, 359, 371, 375, 393, 411, 413, 419, 429
Offset: 1

Views

Author

Peter R. J. Asveld, Aug 11 2009

Keywords

Comments

Previous name was: The A_1-primes (Archimedes_1 primes).
We have: (1) N is an A_1-prime iff N is odd, p=2N+1 is a prime number and only one of +2 and -2 generates Z_p^* (the multiplicative group of Z_p); (2) N is an A_1-prime iff p=2N+1 is a prime number and exactly one of the following holds: (a) N == 1 (mod 4) and +2 generates Z_p^* but -2 does not, (b) N == 3 (mod 4) and -2 generates Z_p^* but +2 does not.
The A_1-primes are the odd T- or Twist-primes (the T-primes are the same as the Queneau-numbers, A054639). For the related A_0-, A^+_1- and A^-_1-primes, see A163777, A163779 and A163780. Considered as a set, the present sequence is the union of the A^+_1-primes (A163779) and the A^-_1-primes (A163780). It is also equal to the difference of A054639 and the A_0-primes (A163777).

Crossrefs

Programs

  • Mathematica
    follow[s_, f_] := Module[{t, k}, t = f[s]; k = 1; While[t>s, k++; t = f[t]]; If[s == t, k, 0]];
    okQ[n_] := n>1 && n == follow[1, Function[j, Ceiling[n/2] + (-1)^j*Ceiling[ (j-1)/2]]];
    A163778 = Select[Range[1000], okQ] (* Jean-François Alcover, Jun 07 2018, after Andrew Howroyd *)
  • PARI
    Follow(s, f)={my(t=f(s), k=1); while(t>s, k++; t=f(t)); if(s==t, k, 0)}
    ok(n)={n>1 && n==Follow(1, j->ceil(n/2) + (-1)^j*ceil((j-1)/2))}
    select(ok, [1..1000]) \\ Andrew Howroyd, Nov 11 2017
    
  • PARI
    ok(n)={n>1 && n%2==1 && isprime(2*n+1) && znorder(Mod(2, 2*n+1)) == if(n%4==3, n, 2*n)}
    select(ok, [1..1000]) \\ Andrew Howroyd, Nov 11 2017

Extensions

a(33)-a(55) from Andrew Howroyd, Nov 11 2017
New name from Joerg Arndt, Mar 23 2018

A019567 Order of the Mongean shuffle permutation of 2n cards: a(n) is least number m for which either 2^m + 1 or 2^m - 1 is divisible by 4n + 1.

Original entry on oeis.org

1, 2, 3, 6, 4, 6, 10, 14, 5, 18, 10, 12, 21, 26, 9, 30, 6, 22, 9, 30, 27, 8, 11, 10, 24, 50, 12, 18, 14, 12, 55, 50, 7, 18, 34, 46, 14, 74, 24, 26, 33, 20, 78, 86, 29, 90, 18, 18, 48, 98, 33, 10, 45, 70, 15, 24, 60, 38, 29, 78, 12, 84, 41, 110, 8, 84, 26, 134, 12, 46, 35, 36, 68, 146
Offset: 0

Views

Author

John Bullitt (metta(AT)world.std.com), N. J. A. Sloane and J. H. Conway

Keywords

Comments

Write down 1, then 2 to left, 3 to right, 4 to left, ..., getting [ 2n,2n-2,...,4,2,1,3,5,...,2n-1 ]; the sequence 2,3,6,4,6,10,14,5,18,10,12,21,26,9,... gives order of permutation sending 1 to 2n, 2 to 2n-2, ..., 2n to 2n-1.
Equivalently, the sequence 2,3,6,4,6,10,14,5,18,10,12,21,26,9,... gives the number of Mongean shuffles needed to return a deck of 2n cards (n=1,2,3,...) to its original order.
It appears that a(n) = order((-1)^(n+1)*2 in Z_{2n+1}) / f with f=1 when n==2 (mod 3) and for n = 0, 19, 21, 30,33, 52, 55, 61, 63, 70, ..., f=2 else. I don't know how to characterize the "exceptional" n's. - M. F. Hasler, Mar 31 2019

Examples

			Illustrating the initial terms:
   n  4n+1  2^m+1  2^m-1  m
   0    1            1    1
   1    5     5           2
   2    9     9           3
   3   13    5*13         6
   4   17     17          4
   5   21           3*21  6
   6   25   41*25        10
		

References

  • A. P. Domoryad, Mathematical Games and Pastimes, Pergamon Press, 1964; see pp. 134-135.
  • W. W. Rouse Ball, Mathematical Recreations and Essays, 11th ed. 1939, p. 311

Crossrefs

Programs

  • Maple
    A019567:=  proc(n)
        for m from 1 do
            if modp(2^m-1,4*n+1) =0 or modp(2^m+1,4*n+1)=0 then
                return m ;
            end if;
        end do;
    end proc: # N. J. A. Sloane, Jul 28 2007
  • Mathematica
    a[n_] := For[m=1, True, m++, If[AnyTrue[{-1, 1}, Divisible[2^m+#, 4n+1]&], Return[m]]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Aug 26 2019 *)
  • PARI
    A019567(n,z=Mod(2,4*n+1))=for(m=1,oo,bittest(5,lift(z^m+1))&&return(m)) \\ M. F. Hasler, Mar 31 2019

Formula

a(A163777(n)/2) = A163777(n). - Andrew Howroyd, Nov 11 2017

Extensions

Comments corrected by Mikko Nieminen, Jul 26 2007, who also provided the Domoryad reference
Definition edited by N. J. A. Sloane, Nov 09 2017

A238371 a(1)=1; for n > 1, a(n) = the number of "topped" Mongean shuffles to reorder a stack of n cards to its original order.

Original entry on oeis.org

1, 1, 3, 3, 5, 5, 4, 4, 9, 9, 11, 11, 9, 9, 5, 5, 12, 12, 12, 12, 7, 7, 23, 23, 8, 8, 20, 20, 29, 29, 6, 6, 33, 33, 35, 35, 20, 20, 39, 39, 41, 41, 28, 28, 12, 12, 36, 36, 15, 15, 51, 51, 53, 53, 36, 36, 44, 44, 24, 24, 20, 20, 7, 7, 65, 65, 36, 36, 69, 69, 60, 60, 42, 42, 15, 15, 20, 20, 52, 52, 81, 81, 83, 83, 9, 9, 60, 60
Offset: 1

Views

Author

R. J. Mathar, Feb 25 2014

Keywords

Comments

In the Mongean shuffle, the top card of the stack becomes the top of the new stack, the second of the old stack goes on top of the new stack, the third to the bottom of the new stack, alternating top and bottom of the new stack.
Here we define a shuffle where the top-bottom placements in the new stack alternate in the same way, but the second card of the old stack moves to the *bottom* of the stack.
A single shuffle is a permutation of 1, 2, 3, 4, 5, 6, ... -> ..., 7, 5, 3, 1, 2, 4, 6, ...
The fixed points, where n=a(n), seem to be in A163778.
(The "topped" classification is a nomenclature invented here, to be replaced if this variant appears elsewhere in the literature.)

Crossrefs

Cf. A019567 (Mongean shuffle), A294673 (a bisection).

Programs

  • Maple
    topMong := proc(L)
        ret := [op(1,L)] ;
        for k from 2 to nops(L) do
            if type(k,'even') then
                ret := [op(ret),op(k,L)] ;
            else
                ret := [op(k,L),op(ret)] ;
            end if;
        end do:
        ret ;
    end proc:
    A238371 := proc(n)
        local ca,org,tu ;
        ca := [seq(k,k=1..n)] ;
        org := [seq(k,k=1..n)] ;
        for tu from 1 do
            ca := topMong(ca) ;
            if ca = org then
                return tu;
            end if:
        end do:
    end proc:
    seq(A238371(n),n=2..88) ;
  • Mathematica
    topMong[L_] := Module[{ret = {L[[1]]}}, For[k = 2, k <= Length[L], k++, If[ EvenQ[k], ret = Append[ret, L[[k]]], ret = Prepend[ret, L[[k]]]]]; ret];
    A238371[n_] := Module[{ca, org, tu}, ca = org = Range[n]; For[tu = 1, True, tu++, ca = topMong[ca]; If[ca == org, Return[tu]]]];
    Array[A238371, 88] (* Jean-François Alcover, Jul 03 2018, after R. J. Mathar *)
  • PARI
    apply( A238371(n)=znorder(Mod(bitand(n,2)*2-2,n\2*4+3)), [0..99]) \\ M. F. Hasler, Mar 31 2019

Formula

a(A163778(n)) = A163778(n). - Andrew Howroyd, Nov 11 2017

A294434 a(0)=0; for n>0, a(n) = (A163778(n)-1)/2.

Original entry on oeis.org

0, 1, 2, 4, 5, 11, 14, 16, 17, 19, 20, 25, 26, 32, 34, 40, 41, 44, 47, 49, 52, 56, 59, 65, 67, 77, 86, 89, 91, 94, 95, 104, 110, 115, 116, 119, 121, 122, 125, 130, 136, 140, 146, 149, 151, 154, 161, 164, 179, 185, 187, 196, 205, 206, 209, 214, 215, 220, 221
Offset: 0

Views

Author

N. J. A. Sloane, Nov 16 2017

Keywords

Comments

Appears to be equal to the indices of maximal entries in A294673.

Crossrefs

Showing 1-5 of 5 results.