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 10 results.

A001917 (p-1)/x, where p = prime(n) and x = ord(2,p), the smallest positive integer such that 2^x == 1 (mod p).

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 2, 1, 6, 1, 2, 3, 2, 1, 1, 1, 1, 2, 8, 2, 1, 8, 2, 1, 2, 1, 3, 4, 18, 1, 2, 1, 1, 10, 3, 1, 2, 1, 1, 1, 2, 2, 1, 2, 1, 6, 1, 3, 8, 2, 10, 5, 16, 2, 1, 2, 3, 4, 3, 1, 3, 2, 2, 1, 11, 16, 1, 1, 4, 2, 2, 1, 1, 2, 1, 9, 2, 2, 1, 1, 10, 6, 6, 1, 2, 6, 1, 2, 1, 2, 2, 1, 3, 2, 1, 2, 1, 1, 1, 1, 1, 2
Offset: 2

Views

Author

Keywords

Comments

Also number of cycles in permutations constructed from siteswap juggling pattern 1234...p.
Also the number of irreducible polynomial factors for the polynomial (x^p-1)/(x-1) over GF(2), where p is the n-th prime. - V. Raman, Oct 04 2012
The sequence is unbounded: for any value of M, there exists an element of the sequence divisible by M. See the proof by David Speyer below. - Shreevatsa R, May 24 2013

References

  • M. Kraitchik, Recherches sur la Théorie des Nombres. Gauthiers-Villars, Paris, Vol. 1, 1924, Vol. 2, 1929, see Vol. 1, p. 131.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, pp. 7-10.
  • W. Meissner, Über die Teilbarkeit von 2^p-2 durch das Quadrat der Primzahl p = 1093, Sitzungsberichte Königlich Preussischen Akadamie Wissenschaften Berlin, 35 (1913), 663-667.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A006694 gives cycle counts of such permutations constructed for all odd numbers.
Cf. A014664.

Programs

  • Magma
    [ (p-1)/Modorder(2, p) where p is NthPrime(n): n in [2..100] ]; // Klaus Brockhaus, Dec 09 2008
    
  • Maple
    with(numtheory); [seq((ithprime(n)-1)/order(2,ithprime(n)),n=2..130)];
    with(group); with(numtheory); gen_rss_perm := proc(n) local a, i; a := []; for i from 1 to n do a := [op(a), ((2*i) mod (n+1))]; od; RETURN(a); end; count_of_disjcyc_seq := [seq(nops(convert(gen_rss_perm(ithprime(j)-1),'disjcyc')),j=2..)];
  • Mathematica
    a6694[n_] := Sum[ EulerPhi[d] / MultiplicativeOrder[2, d], {d, Divisors[2n + 1]}] - 1; a[n_] := a6694[(Prime[n]-1)/2]; Table[ a[n], {n, 2, 104}] (* Jean-François Alcover, Dec 14 2011, after Vladimir Shevelev *)
    Table[p = Prime[n]; (p - 1)/MultiplicativeOrder[2, p], {n, 2, 100}] (* T. D. Noe, Apr 11 2012 *)
    ord[n_]:=Module[{x=1},While[PowerMod[2,x,n]!=1,x++];(n-1)/x]; ord/@ Prime[ Range[ 2,110]] (* Harvey P. Dale, Jun 25 2014 *)
  • PARI
    {for(n=2, 100, p=prime(n); print1((p-1)/znorder(Mod(2, p)), ","))} \\ Klaus Brockhaus, Dec 09 2008
    
  • Python
    from sympy import prime, n_order
    def A001917(n):
        p = prime(n)
        return 1 if n == 2 else (p-1)//n_order(2,p) # Chai Wah Wu, Jan 15 2020

Formula

From Vladimir Shevelev, May 26 2008: (Start)
a(n) = A006694((p_n-1)/2) where p_n is the n-th odd prime.
Conjecture: k*a(n) = A006694(((p_n)^k-1)/2). (End)

Extensions

Additional comments from Antti Karttunen, Jan 05 2000
More terms from N. J. A. Sloane, Dec 24 2009

A001133 Primes p such that the multiplicative order of 2 modulo p is (p-1)/3.

Original entry on oeis.org

43, 109, 157, 229, 277, 283, 307, 499, 643, 691, 733, 739, 811, 997, 1021, 1051, 1069, 1093, 1459, 1579, 1597, 1627, 1699, 1723, 1789, 1933, 2179, 2203, 2251, 2341, 2347, 2749, 2917, 3163, 3181, 3229, 3259, 3373, 4027, 4339, 4549, 4597, 4651, 4909, 5101, 5197, 5323, 5413, 5437, 5653, 6037
Offset: 1

Views

Author

Keywords

References

  • M. Kraitchik, Recherches sur la Théorie des Nombres. Gauthiers-Villars, Paris, Vol. 1, 1924, Vol. 2, 1929, see Vol. 1, p. 59.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(4597) | r eq 1 and Order(R!2) eq q where q,r is Quotrem(p,3) where R is ResidueClassRing(p) ]; // Klaus Brockhaus, Dec 02 2008
    
  • Mathematica
    Reap[For[p = 2, p < 10^4, p = NextPrime[p], If[MultiplicativeOrder[2, p] == (p-1)/3, Sow[p]]]][[2, 1]] (* Jean-François Alcover, Dec 10 2015 *)
  • PARI
    forprime(p=3,10^4,if(znorder(Mod(2,p))==(p-1)/3,print1(p,", "))); \\ Joerg Arndt, May 17 2013

Extensions

More terms and better definition from Don Reble, Mar 11 2006

A001134 Primes p such that the multiplicative order of 2 modulo p is (p-1)/4.

Original entry on oeis.org

113, 281, 353, 577, 593, 617, 1033, 1049, 1097, 1153, 1193, 1201, 1481, 1601, 1889, 2129, 2273, 2393, 2473, 3049, 3089, 3137, 3217, 3313, 3529, 3673, 3833, 4001, 4217, 4289, 4457, 4801, 4817, 4937, 5233, 5393, 5881, 6121, 6521, 6569, 6761, 6793, 6841, 7129, 7481, 7577, 7793, 7817, 7841, 8209
Offset: 1

Views

Author

Keywords

Comments

The multiplicative order of x modulo y is the smallest positive number m such that x^m is congruent to 1 mod y.

References

  • M. Kraitchik, Recherches sur la Théorie des Nombres. Gauthiers-Villars, Paris, Vol. 1, 1924, Vol. 2, 1929, see Vol. 1, p. 59.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(6761) | r eq 1 and Order(R!2) eq q where q,r is Quotrem(p,4) where R is ResidueClassRing(p) ]; // Klaus Brockhaus, Dec 02 2008
    
  • Mathematica
    Reap[For[p = 2, p <= 6761, p = NextPrime[p], If[ MultiplicativeOrder[2, p] == (p-1)/4, Sow[p]]]][[2, 1]] (* Jean-François Alcover, May 17 2013 *)
  • PARI
    forprime(p=3,10^4,if(znorder(Mod(2,p))==(p-1)/4,print1(p,", "))); \\ Joerg Arndt, May 17 2013
    
  • PARI
    oddres(n)=n>>valuation(n, 2)
    cyc(d)=my(k=1, t=1,y=(d-5)/(2*3)+1); while((t=oddres(t+d))>1 && k<=y, k++); k
    forstep(n=1, 241537, [16,8], if(cyc(n)==n>>3,print1(n", "))) ; \\ Charles R Greathouse IV, May 18 2013

Extensions

More terms and better definition from Don Reble, Mar 11 2006

A101208 Smallest odd prime p such that n = (p - 1) / ord_p(2).

Original entry on oeis.org

3, 7, 43, 113, 251, 31, 1163, 73, 397, 151, 331, 1753, 4421, 631, 3061, 257, 1429, 127, 6043, 3121, 29611, 1321, 18539, 601, 15451, 14327, 2971, 2857, 72269, 3391, 683, 2593, 17029, 2687, 42701, 11161, 13099, 1103, 71293, 13121, 17467, 2143, 83077, 25609, 5581
Offset: 1

Views

Author

Leigh Ellison (le(AT)maths.gla.ac.uk), Dec 14 2004

Keywords

Comments

First time n appears is given in A001917.
Smallest p (let it be the k-th prime) such that A001917(k) = n, or the smallest prime which has ratio n in base 2.
First cyclic number (in base 2) of n-th degree (or n-th order): the reciprocals of these numbers belong to one of n different cycles. Each cycle has (a(n) - 1)/n digits.
Conjecture: a(n) is defined for all n.
Recursive by indices: (See A054471)
1, 3, 43, 83077, ...
2, 7, 1163, ...
4, 113, 257189, ...
5, 251, 6846277, ...
6, 31, 683, ...
8, 73, 472019, ...
9, 397, 13619483, ...
10, 151, 349717, ...
...
The records for the ratio in base 2 are: 1, 2, 6, 8, 18, 24, 31, 38, 72, 105, 129, 630, 1285, 1542, 2048, ..., the primes are: 3, 7, 31, 73, 127, 601, 683, 1103, 1801, 2731, 5419, 8191, 43691, 61681, 65537, ...
(Updated by Eric Chen, Jun 01 2015)

Crossrefs

Cf. A001122, A115591, A001133, A001134, A001135, A001136, A152307, A152308, A152309, A152310, A152311, which are sequences of primes p where the period of the reciprocal in base 2 is (p-1)/n for n=1 to 11.

Programs

  • Mathematica
    f[n_Integer] := Block[{k = 1, p}, While[p = k*n + 1; ! PrimeQ[p] || p != 1 + n*MultiplicativeOrder[2, p] || p = 2, k++]; p]; Array[f, 128] (* Eric Chen, Jun 01 2015 *)
  • PARI
    a(n) = {p=3; ok = 0; until(ok, if (n == (p-1)/znorder(Mod(2, p)), ok = 1, p = nextprime(p+1));); return (p);} \\ Michel Marcus, Jun 27 2013

A152307 Primes p such that the multiplicative order of 2 modulo p is (p-1)/7.

Original entry on oeis.org

1163, 1709, 2003, 3109, 3389, 3739, 5237, 5531, 5867, 7309, 9157, 9829, 10627, 10739, 11117, 11243, 11299, 11411, 11467, 13259, 18803, 20147, 20483, 21323, 21757, 27749, 27763, 29947, 30773, 31123, 31627, 32803, 33461, 33587, 34469
Offset: 1

Views

Author

Klaus Brockhaus, Dec 02 2008

Keywords

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(34469) | r eq 1 and Order(R!2) eq q where q,r is Quotrem(p,7) where R is ResidueClassRing(p) ];
    
  • Mathematica
    Select[Prime[Range[4000]],MultiplicativeOrder[2,#]==(#-1)/7&] (* Harvey P. Dale, Oct 10 2024 *)
  • PARI
    Vec(select(p->((p!=2) && (znorder(Mod(2, p)) == (p-1)/7)), primes(10000))) \\ Michel Marcus, Feb 09 2015

A152308 Primes p such that the multiplicative order of 2 modulo p is (p-1)/8.

Original entry on oeis.org

73, 89, 233, 937, 1217, 1249, 1289, 1433, 1553, 1609, 1721, 1913, 2441, 2969, 3257, 3449, 4049, 4201, 4273, 4297, 4409, 4481, 4993, 5081, 5297, 5689, 6089, 6449, 6481, 6689, 6857, 7121, 7529, 7993, 8081, 8609, 8969, 9137, 9281, 9769, 10337, 10369
Offset: 1

Views

Author

Klaus Brockhaus, Dec 02 2008

Keywords

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(10369) | r eq 1 and Order(R!2) eq q where q,r is Quotrem(p,8) where R is ResidueClassRing(p) ];
    
  • Mathematica
    okQ[p_] := MultiplicativeOrder[2, p] == (p-1)/8;
    Select[Prime[Range[2000]], okQ] (* Jean-François Alcover, Nov 23 2024 *)
  • PARI
    Vec(select(p->((p!=2) && (znorder(Mod(2, p)) == (p-1)/8)), primes(10000))) \\ Michel Marcus, Feb 09 2015

A152309 Primes p such that the multiplicative order of 2 modulo p is (p-1)/9.

Original entry on oeis.org

397, 7867, 10243, 10333, 12853, 13789, 14149, 14293, 14563, 15643, 17659, 18379, 18541, 21277, 21997, 23059, 23203, 26731, 27739, 29179, 29683, 31771, 34147, 35461, 35803, 36541, 37747, 39979, 40213, 40429, 41131, 41491, 44029, 44101
Offset: 1

Views

Author

Klaus Brockhaus, Dec 02 2008

Keywords

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(44101) | r eq 1 and Order(R!2) eq q where q,r is Quotrem(p,9) where R is ResidueClassRing(p) ];
    
  • Mathematica
    okQ[p_] := MultiplicativeOrder[2, p] == (p-1)/9;
    Select[Prime[Range[10000]], okQ] (* Jean-François Alcover, Nov 23 2024 *)
  • PARI
    Vec(select(p->((p!=2) && (znorder(Mod(2, p)) == (p-1)/9)), primes(10000))) \\ Michel Marcus, Feb 09 2015

A152310 Primes p such that the multiplicative order of 2 modulo p is (p-1)/10.

Original entry on oeis.org

151, 241, 431, 641, 911, 3881, 4751, 4871, 5441, 5471, 5641, 5711, 6791, 6871, 8831, 9041, 9431, 10711, 12721, 13751, 14071, 14431, 14591, 15551, 16631, 16871, 17231, 17681, 17791, 18401, 19031, 19471, 21401, 25111, 25391, 25561, 26921, 27031
Offset: 1

Views

Author

Klaus Brockhaus, Dec 02 2008

Keywords

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(27031) | r eq 1 and Order(R!2) eq q where q,r is Quotrem(p,10) where R is ResidueClassRing(p) ];
    
  • Mathematica
    okQ[p_] := MultiplicativeOrder[2, p] == (p-1)/10;
    Select[Prime[Range[10000]], okQ] (* Jean-François Alcover, Nov 23 2024 *)
  • PARI
    Vec(select(p->((p!=2) && (znorder(Mod(2, p)) == (p-1)/10)), primes(10000))) \\ Michel Marcus, Feb 09 2015

A152311 Primes p such that the multiplicative order of 2 modulo p is (p-1)/11.

Original entry on oeis.org

331, 1013, 4643, 12101, 12893, 16061, 17117, 23893, 25763, 25939, 28403, 30493, 32429, 32957, 34739, 36389, 38149, 39139, 42043, 44771, 45541, 46861, 53923, 57773, 59621, 60611, 81533, 85229, 87187, 89123, 92357, 96493, 100981, 105227
Offset: 1

Views

Author

Klaus Brockhaus, Dec 02 2008

Keywords

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(105227) | r eq 1 and Order(R!2) eq q where q,r is Quotrem(p,11) where R is ResidueClassRing(p) ];
    
  • Mathematica
    okQ[p_] := MultiplicativeOrder[2, p] == (p-1)/11;
    Select[Prime[Range[20000]], okQ] (* Jean-François Alcover, Nov 23 2024 *)
  • PARI
    Vec(select(p->((p!=2) && (znorder(Mod(2, p)) == (p-1)/11)), primes(20000))) \\ Michel Marcus, Feb 09 2015

A384184 Order of the permutation of {0,...,n-1} formed by successively swapping elements at i and 2*i mod n, for i = 0,...,n-1.

Original entry on oeis.org

1, 2, 1, 4, 2, 2, 2, 8, 3, 4, 5, 4, 6, 4, 6, 16, 4, 6, 9, 8, 4, 10, 28, 8, 10, 12, 9, 8, 14, 12, 12, 32, 5, 8, 70, 12, 18, 18, 24, 16, 10, 8, 7, 20, 210, 56, 126, 16, 110, 20, 60, 24, 26, 18, 120, 16, 9, 28, 29, 24, 30, 24, 60, 64, 6, 10, 33, 16
Offset: 1

Views

Author

Mia Boudreau, May 29 2025

Keywords

Comments

a(2*n) = 2*a(n) since the cycle lengths of the permutation with size 2*n is effectively that of size n twice, doubled. Thus, the LCM/order is doubled.

Examples

			For n = 11, the permutation is {0,3,4,7,8,1,2,9,10,5,6} and it has order a(11) = 5.
		

Crossrefs

Programs

  • Python
    from sympy.combinatorics import Permutation
    def a(n):
       L = list(range(n))
       for i in range(n):
           if (j:= (i << 1) % n) != i:
               L[i],L[j] = L[j],L[i]
       return Permutation(L).order() # Darío Clavijo, Jun 05 2025

Formula

a(2*n) = 2*a(n).
a(2^n) = 2^n.
Conjecture: a(2^n + 2^x) = 2^n * (x-n) if x > n.
a(2^n - 1) = A003418(n-1).
s(2^n + 1) = A000027(n).
a(2*n - 1) = A051732(n).
a(A004626(n)) % 2 = 1.
a(A065119(n)) = n/3.
a(A001122(n)) = (n-1) / 2.
a(A155072(n)) = (n-1) / 4.
a(A001133(n)) = (n-1) / 6.
a(A001134(n)) = (n-1) / 8.
a(A001135(n)) = (n-1) / 10.
a(A225759(n)) = (n-1) / 16.
Showing 1-10 of 10 results.