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.

A298827 a(n) is the smallest positive integer k such that 3^n+2 divides 3^(n+k)+2.

Original entry on oeis.org

4, 5, 28, 41, 84, 336, 990, 193, 1260, 5905, 75918, 10065, 318860, 2391485, 14348908, 20390382, 5031420, 31624326, 5985168, 1743333144, 8569036, 668070480, 547062516, 141214768241, 167874004756, 1270932914165, 385131186110, 2837770056420, 784347169884, 475536631360, 149093578413164, 139370386996590
Offset: 1

Views

Author

Luke W. Richards, Jan 27 2018

Keywords

Comments

3^n+2 divides 3^(n+a(n)*m)+2 for all nonnegative integers m.
Jon E. Schoenfield noted that a(n) coincides with the multiplicative order of 3 modulo 3^n+2. This is true because 3^(n+a(n)) == 3^n mod 3^n+2 and since 3^n and 3^n+2 are coprime, 3^a(n) == 1 mod 3^n+2 and the multiplicative order is the smallest positive such number. - Chai Wah Wu, Jan 29 2018

Examples

			For n = 1, f(1) = 3^1 + 2 = 5, where f(x) = 3^x + 2. Given the last digits of f(x) form a recurring sequence of 5, 1, 9, 3 [, 5, 1, 9, 3] then whenever x = 1 mod 4, f(x) will be a multiple of f(1).
For n = 2, f(2) = 3^2 + 2 = 11. a(2) = 5. So any x = 2 mod 5 will be a multiple of 11. For instance, 27 = 2 mod 5, and f(27) = 3^27 + 2 = 7625597474989 = 11 * 693236134999.
		

Crossrefs

Cf. A168607.

Programs

  • Magma
    [Modorder(3,3^n+2): n in [1..29]]; // Jon E. Schoenfield, Jan 28 2018
    
  • Maple
    seq(numtheory:-order(3, 3^n+2), n=1..100); # Robert Israel, Feb 05 2018
  • Mathematica
    Array[Block[{k = 1}, While[! Divisible[3^(# + k) + 2, 3^# + 2], k++]; k] &, 12] (* Michael De Vlieger, Feb 05 2018 *)
    Table[MultiplicativeOrder[3, 3^n + 2], {n, 32}] (* Jean-François Alcover, Feb 06 2018 *)
  • PARI
    a(n) = znorder(Mod(3, 3^n+2)); \\ Michel Marcus, Jan 29 2018
  • Python
    def fmod(n, mod):
        return (pow(3, n, mod) + 2) % mod
    def f(n):
        return pow(3, n) + 2
    #terms is the number of terms to generate
    terms = 20
    for x in range(1, terms + 1):
        div = f(x)
        y = x + 1
        while fmod(y, div) != 0:
            y += 1
        print(y - x)
    
  • Python
    from sympy import n_order
    def A298827(n):
        return n_order(3,3**n+2) # Chai Wah Wu, Jan 29 2018
    

Extensions

a(22)-a(32) from Robert Israel, Feb 05 2018