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

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

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

Original entry on oeis.org

1, 0, 2, 3, 5, 3, 8, 9, 11, 14, 15, 9, 4, 21, 23, 26, 29, 5, 11, 35, 6, 39, 41, 44, 24, 50, 17, 53, 27, 56, 63, 65, 68, 69, 74, 25, 39, 81, 83, 86, 89, 45, 95, 8, 98, 99, 105, 111, 113, 57, 116, 119, 60, 125, 128, 131, 134, 15, 69, 140, 141, 146, 17, 155, 39
Offset: 1

Views

Author

T. D. Noe, Apr 11 2012

Keywords

Crossrefs

Programs

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

Formula

From Jianing Song, May 13 2024: (Start)
a(n) = A062117(n)/gcd(2, A062117(n)).
a(n) <= (prime(n) - 1)/2. Those prime(n) for which a(n) = (prime(n) - 1)/2 are listed in A364867. (End)

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

Original entry on oeis.org

0, 2, 4, 1, 10, 4, 8, 6, 11, 28, 5, 12, 20, 14, 23, 52, 58, 20, 22, 35, 3, 13, 82, 11, 16, 100, 17, 106, 12, 28, 7, 130, 68, 46, 148, 5, 52, 54, 83, 172, 178, 60, 95, 32, 196, 33, 70, 37, 226, 76, 29, 119, 8, 50, 16, 131, 268, 45, 92, 70, 94, 292, 34, 155, 52
Offset: 1

Views

Author

T. D. Noe, Apr 11 2012

Keywords

Crossrefs

Cf. A053451 (order of 8 mod 2n+1), A019338 (full reptend primes in base 8).

Programs

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

Formula

a(n) = A014664(n)/gcd(3, A014664(n)). - Jianing Song, May 13 2024

A372800 Smallest prime p such that the multiplicative order of 16 modulo p is 2*n, or 0 if no such prime exists.

Original entry on oeis.org

3, 5, 31, 17, 151, 109, 631, 113, 127, 1181, 331, 433, 13963, 1709, 3331, 1217, 2687, 397, 1103, 241, 2143, 1013, 18539, 1777, 2351, 4421, 2971, 673, 3191, 3061, 683, 257, 58147, 1429, 38431, 1657, 11471, 22573, 49999, 3121, 17467, 33013, 252583, 1321, 23671, 51797, 26227, 4513
Offset: 1

Views

Author

Jianing Song, May 13 2024

Keywords

Comments

First prime p such that the expansion of 1/p has period (p-1)/(2*n) in base 16. Also the first prime p such that {k/p : 1 <= k <= p-1} has 2*n different cycles when written out in base 16.
Since ord(a^m,k) = ord(a,k)/gcd(m,ord(a,k)) for gcd(a,k) = 1, we have that (p-1)/ord(16,p) = ((p-1)/ord(2,p)) * gcd(4,ord(2,p)) is always even. Here ord(a,k) is the multiplicative order of a modulo k.

Examples

			In the following examples let () denote the reptend. The prime numbers themselves and the fractions are written out in decimal.
The base-16 expansion of 1/3 is 0.(5), so the reptend has length 1 = (3-1)/2. Also, the base-16 expansions of 1/3 = 0.(5) and 2/3 = 0.(A) have two cycles 5 and A. 3 is the smallest such prime, so a(1) = 3.
The base-16 expansion of 1/5 is 0.(3), so the reptend has length 1 = (5-1)/4. Also, the base-16 expansions of 1/5 = 0.(3), 2/5 = (0.6), 3/5 = 0.(9) and 4/5 = 0.(C) have four cycles 3, 6, 9 and A. 5 is the smallest such prime, so a(2) = 5.
The base-16 expansion of 1/31 is 0.(08421), so the reptend has length 5 = (31-1)/6. Also, the base-16 expansions of 1/31, 2/31, ..., 30/31 have six cycles 08421, 18C63, 294A5, 39CE7, 5AD6B and 7BDEF. 31 is the smallest such prime, so a(3) = 31.
		

Crossrefs

Cf. A372801.

Programs

  • Mathematica
    a[n_] := a[n] = For[p = 2, True, p = NextPrime[p], If[MultiplicativeOrder[16, p] == (p-1)/(2n), Return[p]]];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 100}] (* Jean-François Alcover, Nov 24 2024 *)
  • PARI
    a(n,{base=16}) = forprime(p=2, oo, if((base%p) && znorder(Mod(base,p)) == (p-1)/(n * if(issquare(base), 2, 1)), return(p)))
Showing 1-4 of 4 results.