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 67 results. Next

A135546 Let p be the n-th prime and let g be the order of 2 mod p (see A014664). Then if g is even, a(n) = p*(2^(g/2) - 1), otherwise a(n) = 2^g - 1.

Original entry on oeis.org

3, 15, 7, 341, 819, 255, 9709, 2047, 475107, 31, 9699291, 41943, 5461, 8388607, 3556769739, 31675383749, 65498251203, 575525617597, 34359738367, 511, 549755813887, 182518930210733, 2047, 1627389855, 113715890591104923, 2251799813685247, 963770320257286037
Offset: 2

Views

Author

N. J. A. Sloane, Feb 24 2008

Keywords

Comments

Karpenkov asks how often is it the case that if p is the n-th prime (n >= 2) then A038553(p) = a(n)? The first failure is at p = 37. Is it true that a(n) is always divisible by A038553(p)?

Crossrefs

Programs

  • Maple
    (First load the b-file for A014664 as the array b1.)
    a := proc(i) local p,g; p:=ithprime(i); g:=b1[i-1]; if g mod 2 = 0 then p*(2^(g/2)-1) else 2^g-1; fi; end;
  • Mathematica
    g[n_]:=MultiplicativeOrder[2, Prime[n]];a[n_]:=If[EvenQ[g[n]],Prime[n]*(2^(g[n]/2)-1),2^g[n]-1];Table[a[n],{n,2,28}] (* James C. McMahon, Apr 16 2025 *)

A309816 a(n) is the 2-adic valuation of A014664(n).

Original entry on oeis.org

1, 2, 0, 1, 2, 3, 1, 0, 2, 0, 2, 2, 1, 0, 2, 1, 2, 1, 0, 0, 0, 1, 0, 4, 2, 0, 1, 2, 2, 0, 1, 2, 1, 2, 0, 2, 1, 0, 2, 1, 2, 0, 5, 2, 0, 1, 0, 1, 2, 0, 0, 3, 1, 4, 0, 2, 0, 2, 1, 1, 2, 1, 0, 2, 2, 1, 0, 1, 2, 3, 0, 0, 2, 1, 0, 2, 2, 3, 2, 1, 2, 0, 3, 0, 1, 5, 2
Offset: 2

Views

Author

Felix Fröhlich, Aug 18 2019

Keywords

Comments

Let p and q be distinct odd primes. Then there exists an integer i such that 2^i == -1 (mod p*q) if and only if a(u) = a(v) and a(u), a(v) > 0, where u and v are the indices of p and q in A000040, respectively (cf. Anderson, Preece, 2008, Lemma 1.4).

Examples

			For n = 7: A014664(7) = 8 and the 2-adic valuation of 8 is 3, since 2^3 = 8, so a(7) = 3.
		

Crossrefs

Programs

  • PARI
    a(n) = valuation(znorder(Mod(2, prime(n))), 2);
    
  • Python
    from sympy import n_order, prime
    def A309816(n): return (~(m:=n_order(2,prime(n))) & m-1).bit_length() # Chai Wah Wu, Nov 10 2023

A002326 Multiplicative order of 2 mod 2n+1.

Original entry on oeis.org

1, 2, 4, 3, 6, 10, 12, 4, 8, 18, 6, 11, 20, 18, 28, 5, 10, 12, 36, 12, 20, 14, 12, 23, 21, 8, 52, 20, 18, 58, 60, 6, 12, 66, 22, 35, 9, 20, 30, 39, 54, 82, 8, 28, 11, 12, 10, 36, 48, 30, 100, 51, 12, 106, 36, 36, 28, 44, 12, 24, 110, 20, 100, 7, 14, 130, 18, 36, 68, 138, 46, 60, 28
Offset: 0

Views

Author

Keywords

Comments

In other words, least m > 0 such that 2n+1 divides 2^m-1.
Number of riffle shuffles of 2n+2 cards required to return a deck to initial state. A riffle shuffle replaces a list s(1), s(2), ..., s(m) with s(1), s((i/2)+1), s(2), s((i/2)+2), ... a(1) = 2 because a riffle shuffle of [1, 2, 3, 4] requires 2 iterations [1, 2, 3, 4] -> [1, 3, 2, 4] -> [1, 2, 3, 4] to restore the original order.
Concerning the complexity of computing this sequence, see for example Bach and Shallit, p. 115, exercise 8.
It is not difficult to prove that if 2n+1 is a prime then 2n is a multiple of a(n). But the converse is not true. Indeed, one can prove that a(2^(2t-1))=4t. Thus if n=2^(2t-1), where, for any m > 0, t=2^(m-1) then 2n is a multiple of a(n) while 2n+1 is a Fermat number which, as is well known, is not always a prime. It is an interesting problem to describe all composite numbers for which 2n is divisible by a(n). - Vladimir Shevelev, May 09 2008
For an algorithm of calculation of a(n) see author's comment in A179680. - Vladimir Shevelev, Jul 21 2010
From V. Raman, Sep 18 2012, Dec 10 2012: (Start)
If 2n+1 is prime, then the polynomial (x^(2n+1)+1)/(x+1) factors into 2n/a(n) polynomials of the same degree a(n) over GF(2).
If (x^(2n+1)+1)/(x+1) is irreducible over GF(2), then 2n+1 is prime, and 2 is a primitive root (mod 2n+1) (cf. A001122).
For all n > 0, a(n) is the degree of the largest irreducible polynomial factor for the polynomial (x^(2n+1)+1)/(x+1) over GF(2). (End)
a(n) is a factor of phi(2n+1) (A000010(2n+1)). - Douglas Boffey, Oct 21 2013
Conjecture: if p is an odd prime then a((p^3-1)/2) = p * a((p^2-1)/2). Because otherwise a((p^3-1)/2) < p * a((p^2-1)/2) iff a((p^3-1)/2) = a((p-1)/2) for a prime p. Equivalently p^3 divides 2^(p-1)-1, but no such prime p is known. - Thomas Ordowski, Feb 10 2014
A generalization of the previous conjecture: For each k>=2, if p is an odd prime then a(((p^(k+1))-1)/2) = p * a((p^k-1)/2). Computer testing of this generalized conjecture shows that there is no counterexample for k and p both up to 1000. - Ahmad J. Masad, Oct 17 2020

Examples

			From _Vladimir Shevelev_, Oct 03 2017: (Start)
Our algorithm for the calculation of a(n) in the author's comment in A179680 (see also the Sage program below) could be represented in the form of a "finite continued fraction". For example let n = 8, 2*n+1 = 17. We have
    1 + 17
    ------- + 17
       2
    ------------- + 17
           2
    ------------------- + 17
              2
    -------------------------- = 1
                 32
Here the denominators are the A006519 of the numerators: A006519(1+17) = 2, A006519(9+17) = 2, A006519(13+17) = 2, A006519(15+17) = 32. Summing the exponents of these powers of 2, we obtain the required result: a(8) = 1 + 1 + 1 + 5 = 8. Indeed, we have (((1*32 - 17)*2 - 17)*2 - 17)*2 - 17 = 1. So 32*2*2*2 - 1 == 0 (mod 17), 2^8 - 1 == 0 (mod 17). In the general case, note that all "partial fractions" (which indeed are integers) are odd residues modulo 2*n+1 in the interval [1, 2*n-1]. It is easy to prove that the first 1 appears not later than in the n-th step. (End)
		

References

  • E. Bach and Jeffrey Shallit, Algorithmic Number Theory, I.
  • T. Folger, "Shuffling Into Hyperspace," Discover, 1991 (vol 12, no 1), pages 66-67.
  • M. Gardner, "Card Shuffles," Mathematical Carnival chapter 10, pages 123-138. New York: Vintage Books, 1977.
  • L. Lunelli and M. Lunelli, Tavola di congruenza a^n == 1 mod K per a=2,5,10, Atti Sem. Mat. Fis. Univ. Modena 10 (1960/61), 219-236 (1961).
  • J. H. Silverman, A Friendly Introduction to Number Theory, 3rd ed., Pearson Education, Inc, 2006, p. 146, Exer. 21.3
  • 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. A024222, A006694 (number of cyclotomic cosets).
Cf. A014664 (order of 2 mod n-th prime).
Cf. A001122 (primes for which 2 is a primitive root).
Cf. A216838 (primes for which 2 is not a primitive root).
Bisections give A274298, A274299.
Partial sums: A359147.

Programs

  • GAP
    List([0..100],n->OrderMod(2,2*n+1)); # Muniru A Asiru, Feb 01 2019
    
  • Haskell
    import Data.List (findIndex)
    import Data.Maybe (fromJust)
    a002326 n = (+ 1) $ fromJust $
                findIndex ((== 0) . (`mod` (2 * n + 1))) $ tail a000225_list
    -- Reinhard Zumkeller, Apr 22 2013
    
  • Magma
    [ 1 ] cat [ Modorder(2, 2*n+1): n in [1..72] ]; // Klaus Brockhaus, Dec 03 2008
    
  • Maple
    a := n -> `if`(n=0, 1, numtheory:-order(2, 2*n+1)):
    seq(a(n), n=0..72);
  • Mathematica
    Table[MultiplicativeOrder[2, 2*n + 1], {n, 0, 100}] (* Robert G. Wilson v, Apr 05 2011 *)
  • PARI
    a(n)=if(n<0,0,znorder(Mod(2,2*n+1))) /* Michael Somos, Mar 31 2005 */
    
  • Python
    from sympy import n_order
    [n_order(2, 2*n+1) for n in range(73)] # Hermann Stamm-Wilbrandt, Jul 27 2021
  • Sage
    # From Peter Luschny, Oct 06 2017: (Start)
    [Mod(2,n).multiplicative_order() for n in (0..145) if gcd(n,2) == 1]
    # Algorithm from Vladimir Shevelev as described in A179680 and presented in Example.
    def A002326VS(n):
        s, m, N = 0, 1, 2*n + 1
        while True:
            k = N + m
            v = valuation(k, 2)
            s += v
            m = k >> v
            if m == 1: break
        return s
    [A002326VS(n) for n in (0..72)] # (End)
    

Formula

a((3^n-1)/2) = A025192(n). - Vladimir Shevelev, May 09 2008
Bisection of A007733: a(n) = A007733(2*n+1). - Max Alekseyev, Jun 11 2009
a((b(n)-1)/2) = n for odd n and even n such that b(n/2) != b(n), where b(n) = A005420(n). - Thomas Ordowski, Jan 11 2014
Note that a(2^n-1) = n+1 and a(2^n) = 2*(n+1). - Thomas Ordowski, Jan 16 2014
a(n) = A056239(A292239(n)) = A048675(A292265(n)). - Antti Karttunen, Oct 04 2017

Extensions

More terms from David W. Wilson, Jan 13 2000
More terms from Benoit Cloitre, Apr 11 2003

A002371 Period of decimal expansion of 1/(n-th prime) (0 by convention for the primes 2 and 5).

Original entry on oeis.org

0, 1, 0, 6, 2, 6, 16, 18, 22, 28, 15, 3, 5, 21, 46, 13, 58, 60, 33, 35, 8, 13, 41, 44, 96, 4, 34, 53, 108, 112, 42, 130, 8, 46, 148, 75, 78, 81, 166, 43, 178, 180, 95, 192, 98, 99, 30, 222, 113, 228, 232, 7, 30, 50, 256, 262, 268, 5, 69, 28, 141, 146, 153, 155, 312, 79, 110
Offset: 1

Views

Author

Keywords

Comments

a(n) is the minimum solution x of modular equation 10^x == 1 (mod p), where p = prime(n). - Carmine Suriano, Oct 10 2012
a(n) = smallest m such that 111...11 (m 1's) is divisible by the n-th prime, or 0 if no such m exists (with the exception that a(2) = 3 instead of 1). E.g., the 5th prime, 11, divides 11, so a(5) = 2. - N. J. A. Sloane, Oct 03 2013 [Comment corrected by Derek Orr, Jun 14 2014]
Numbers n such that A071126(n) = A000040(n) - 1. - Hugo Pfoertner, Mar 18 2003
Except for n = 1 and 3, a(n) divides A006093(n). - Robert Israel, Jul 15 2016

Examples

			A002371(11) = 15 because the 11th prime is 31, and 1/31 = 0.03225806451612903225806451612903225806452... has period 15. - _Richard F. Lyon_, Mar 29 2022
		

References

  • Albert H. Beiler, Recreations in the Theory of Numbers, 2nd ed. New York: Dover, 1966, pages 65, 309. ISBN 0-486-21096-0.
  • John H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, 1996, p. 162. ISBN 978-0-387-97993-9.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 15.
  • 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

See A048595 for another version. Cf. A006883, A007732, A051626, A071126, A000040, A002275, A097443.
Cf. A001913 (full repetend primes), A060257 (1/prime(n) has period prime(n) - 1).

Programs

  • Maple
    seq(subs(FAIL=0,numtheory:-order(10, ithprime(n))),n=1..100); # Robert Israel, Jul 15 2016
  • Mathematica
    Table[ Length[ RealDigits[1 / Prime[n]] [[1, 1]]], {n, 1, 70}]
    Table[If[IntegerQ[#], #, 0] &[MultiplicativeOrder[10, Prime[n]]], {n, 1, 70}] (* Jan Mangaldan, Jul 07 2020 *)
  • PARI
    a(n)=if(n<4,n==2,znorder(Mod(10, prime(n))))
    
  • Python
    from sympy import prime, n_order
    def A002371(n): return 0 if n == 1 or n == 3 else n_order(10,prime(n)) # Chai Wah Wu, Feb 07 2022

Formula

From Alexander Adamchuk, Jan 28 2007: (Start)
a(A000720(p)) = p - 1 for primes p in A001913.
a(A060257(n)) = prime(A060257(n)) - 1. (End)

Extensions

More terms from Arlin Anderson (starship1(AT)gmail.com)
Edited by Charles R Greathouse IV, Mar 24 2010

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

A062117 Order of 3 mod n-th prime.

Original entry on oeis.org

1, 0, 4, 6, 5, 3, 16, 18, 11, 28, 30, 18, 8, 42, 23, 52, 29, 10, 22, 35, 12, 78, 41, 88, 48, 100, 34, 53, 27, 112, 126, 65, 136, 138, 148, 50, 78, 162, 83, 172, 89, 45, 95, 16, 196, 198, 210, 222, 113, 57, 232, 119, 120, 125, 256, 131, 268, 30, 69, 280, 282, 292, 34
Offset: 1

Views

Author

Olivier Gérard, Jun 06 2001

Keywords

Examples

			The 3rd prime is 5 and mod 5, 3^4 = 1, so a(3) = 4.
		

Crossrefs

Cf. A019334 (full reptend primes in base 3).

Programs

  • GAP
    A000040:=Filtered([1..350],IsPrime);;
    List([1..Length(A000040)],n->OrderMod(3,A000040[n])); # Muniru A Asiru, Feb 07 2019
    
  • Mathematica
    Table[With[{p=Prime[n]},If[p==3,0,MultiplicativeOrder[3,p]]],{n,63}] (* Ray Chandler, Apr 06 2016 *)
  • PARI
    a(n,{base=3}) = my(p=prime(n)); if(base%p, znorder(Mod(base,p)), 0) \\ Jianing Song, May 13 2024
  • Python
    from sympy import n_order, prime
    def A062117(n): return n_order(3,prime(n)) if n != 2 else 0 # Chai Wah Wu, Nov 10 2023
    

A211241 Order of 5 mod n-th prime: least k such that prime(n) divides 5^k-1.

Original entry on oeis.org

1, 2, 0, 6, 5, 4, 16, 9, 22, 14, 3, 36, 20, 42, 46, 52, 29, 30, 22, 5, 72, 39, 82, 44, 96, 25, 102, 106, 27, 112, 42, 65, 136, 69, 37, 75, 156, 54, 166, 172, 89, 15, 19, 192, 196, 33, 35, 222, 226, 114, 232, 119, 40, 25, 256, 262, 67, 27, 276, 140, 282, 292
Offset: 1

Views

Author

T. D. Noe, Apr 11 2012

Keywords

Crossrefs

Cf. A019335 (full reptend primes in base 5).

Programs

  • GAP
    A000040:=Filtered([1..350],IsPrime);;
    List([1..Length(A000040)],n->OrderMod(5,A000040[n])); # Muniru A Asiru, Feb 06 2019
    
  • Mathematica
    nn = 5; Table[If[Mod[nn, p] == 0, 0, MultiplicativeOrder[nn, p]], {p, Prime[Range[100]]}]
  • PARI
    a(n,{base=5}) = my(p=prime(n)); if(base%p, znorder(Mod(base,p)), 0) \\ Jianing Song, May 13 2024

A112927 a(n) is the least prime such that the multiplicative order of 2 mod a(n) equals n, or a(n)=1 if no such prime exists.

Original entry on oeis.org

1, 3, 7, 5, 31, 1, 127, 17, 73, 11, 23, 13, 8191, 43, 151, 257, 131071, 19, 524287, 41, 337, 683, 47, 241, 601, 2731, 262657, 29, 233, 331, 2147483647, 65537, 599479, 43691, 71, 37, 223, 174763, 79, 61681, 13367, 5419, 431, 397, 631, 2796203, 2351, 97, 4432676798593, 251, 103, 53, 6361, 87211
Offset: 1

Views

Author

Vladimir Shevelev, Aug 25 2008

Keywords

Comments

If a(n) differs from 1, then a(n) is the minimal prime divisor of A064078(n);
a(n)=n+1 iff n+1 is prime from A001122; a(n)=2n+1 iff 2n+1 is prime from A115591.
If a(n) > 1 then a(n) is the index where n occurs first in A014664. - M. F. Hasler, Feb 21 2016
Bang's theorem (special case of Zsigmondy's theorem, see links): a(n)>1 for all n>6. - Jeppe Stig Nielsen, Aug 31 2020

Crossrefs

Cf. A112927 (base 2), A143663 (base 3), A112092 (base 4), A143665 (base 5), A379639 (base 6), A379640 (base 7), A379641 (base 8), A379642 (base 9), A007138 (base 10), A379644 (base 11), A252170 (base 12).

Programs

  • PARI
    A112927(n,f=factor(2^n-1)[,1])=!for(i=1,#f,znorder(Mod(2,f[i]))==n&&return(f[i])) \\ Use the optional 2nd arg to give a list of pseudoprimes to try when factoring of 2^n-1 is too slow. You may try factor(2^n-1,0)[,1]. - M. F. Hasler, Feb 21 2016

A082654 Order of 4 mod n-th prime: least k such that prime(n) divides 4^k-1, n >= 2.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 4, 9, 11, 14, 5, 18, 10, 7, 23, 26, 29, 30, 33, 35, 9, 39, 41, 11, 24, 50, 51, 53, 18, 14, 7, 65, 34, 69, 74, 15, 26, 81, 83, 86, 89, 90, 95, 48, 98, 99, 105, 37, 113, 38, 29, 119, 12, 25, 8, 131, 134, 135, 46, 35, 47, 146, 51, 155, 78, 158
Offset: 1

Views

Author

Gary W. Adamson, May 17 2003

Keywords

Comments

The period of the expansion of 1/p, base N (where N=4), is equivalent to determining for base integer 4, the period of the sequence 1, 4, 4^2, 4^3, ... mod p. Thus the cycle length for base 4, 1/7 = 0.021021021... (cycle length 3).
The cycle length, base 4, mod p, is equivalent to "clock cycles", given angle A, then the algebraic identity for the doubling angle, 2A.
Examples: Given cos A, f(x) for 2A = 2x^2 - 1, seed 2 Pi/7, i.e., (.623489801 == (arrow), -.222520934... == -.900968867...== .623489801...(cycle length 3). Given 2 cos A, the algebraic identity for 2 cos 2A, f(x) = x^2 - 2; e.g., given seed 2 cos A = 2 Pi/7, the 3 cycle is 1.246979604...== .445041867...== -1.801937736...== back to 1.24697... Likewise, the doubling function given sin^2 A, f(x) for sin^2 2A = 4x(1 - x), the logistic equation; getting cycle length of 3 using the seed sin^2 2 Pi/7. Similarly, the doubling function for tan 2A given tan A, where A = 2 Pi/7 gives 2x/(1 - x^2), cycle length of 3. The doubling function for cot 2A given cot A, with A = 2 Pi/7 gives (x^2 - 1)/2x, cycle length of 3. Note that (x^2 - 1)/2x = sinh(log(x)), and is also generated from using Newton's method on x^2 + 1 = 0.
Consider the odd pseudoprimes, composite numbers x such that 2^(x-1) = 1 mod x, that have prime(n) as a factor. It appears that all such x can be factored as prime(n) * (2 a(n) k + 1) for some integer k. For example, the first few pseudoprimes having the factor 31 are 31*11, 31*91, 31*141 and 3*151. The 11th prime is 31 and a(11) = 5. Therefore all the cofactors of 31 should have the form 10k+1, which is clearly true. - T. D. Noe, Jun 10 2003

Examples

			4th prime is 7 and mod 7, 4^3 = 1, but not 4^1 or 4^2, so a(4) = 3.
n = 4: prime(4) = 7, 2^6 - 1 = 63 = 3*21 == 0 (mod 21), but not 2^k - 1 for lower exponents k >= 1, therefore ord(2, 3*7) = 6 and a(4) = 3. - _Wolfdieter Lang_, Apr 10 2020
		

References

  • Albert H. Beiler, Recreations in the Theory of Numbers, Dover, 1964; Table 48, pages 98-99.
  • John H. Conway & R. K. Guy, The Book of Numbers, Springer-Verlag, 1996, pages 207-208, Periodic Points.

Crossrefs

Cf. A053447 (order of 4 mod 2n+1), A216371.

Programs

  • GAP
    A000040:=Filtered([1..350],IsPrime);;
    List([1..Length(A000040)],n->OrderMod(4,A000040[n])); # Muniru A Asiru, Feb 07 2019
  • Mathematica
    Join[{0}, Table[MultiplicativeOrder[4, Prime[n]], {n, 2, 100}]]
  • PARI
    a(n)=if(n>1, znorder(Mod(4,prime(n))), 0) \\ Charles R Greathouse IV, Sep 07 2016
    

Formula

a(1) = 0, and a(n) = order(4, prime(n)), also used exp_{prime(n)}(4), that is least exponent k >= 1 for which 4^k is congruent to 1 mod prime(n), for n >= 2. prime(n) = A000040(n). [rewritten by Wolfdieter Lang, Apr 10 2020]
From Wolfdieter Lang, Apr 10 2020: (Start)
a(n) = A003558(prime(n)), for n >= 2.
a(n) = (1/2)*order(2, 3*prime(n)), for n >= 3. [Proof uses 4^k - 1 = (1+3)^k - 1 == 0 (mod 3), for k >= 0.] (End)
From Jianing Song, May 13 2024: (Start)
a(n) = A014664(n)/gcd(2, A014664(n)).
a(n) <= (prime(n) - 1)/2. Those prime(n) for which a(n) = (prime(n) - 1)/2 are listed in A216371. (End)

Extensions

More terms from Reinhard Zumkeller, May 17 2003

A211242 Order of 6 mod n-th prime: least k such that prime(n) divides 6^k-1.

Original entry on oeis.org

0, 0, 1, 2, 10, 12, 16, 9, 11, 14, 6, 4, 40, 3, 23, 26, 58, 60, 33, 35, 36, 78, 82, 88, 12, 10, 102, 106, 108, 112, 126, 130, 136, 23, 37, 150, 156, 27, 83, 43, 178, 60, 19, 96, 14, 198, 105, 222, 226, 228, 232, 17, 20, 250, 256, 131, 134, 270, 276, 56, 141
Offset: 1

Views

Author

T. D. Noe, Apr 11 2012

Keywords

Crossrefs

Cf. A019336 (full reptend primes in base 6).

Programs

  • GAP
    A000040:=Filtered([1..350],IsPrime);;
    List([1..Length(A000040)],n->OrderMod(6,A000040[n])); # Muniru A Asiru, Feb 06 2019
    
  • Maple
    A211242 := proc(n)
        if n<= 2 then
            0 ;
        else
            numtheory[order](6,ithprime(n)) ;
        end if;
    end proc:
    seq(A211242(n),n=1..80) ; # R. J. Mathar, Jul 17 2024
  • Mathematica
    nn = 6; Table[If[Mod[nn, p] == 0, 0, MultiplicativeOrder[nn, p]], {p, Prime[Range[100]]}]
  • PARI
    a(n,{base=6}) = my(p=prime(n)); if(base%p, znorder(Mod(base,p)), 0) \\ Jianing Song, May 13 2024
Showing 1-10 of 67 results. Next