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.

This page as a plain text file.
%I A298827 #63 Mar 02 2025 08:01:20
%S A298827 4,5,28,41,84,336,990,193,1260,5905,75918,10065,318860,2391485,
%T A298827 14348908,20390382,5031420,31624326,5985168,1743333144,8569036,
%U A298827 668070480,547062516,141214768241,167874004756,1270932914165,385131186110,2837770056420,784347169884,475536631360,149093578413164,139370386996590
%N A298827 a(n) is the smallest positive integer k such that 3^n+2 divides 3^(n+k)+2.
%C A298827 3^n+2 divides 3^(n+a(n)*m)+2 for all nonnegative integers m.
%C A298827 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
%H A298827 Robert Israel, <a href="/A298827/b298827.txt">Table of n, a(n) for n = 1..175</a>
%e A298827 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).
%e A298827 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.
%p A298827 seq(numtheory:-order(3, 3^n+2), n=1..100); # _Robert Israel_, Feb 05 2018
%t A298827 Array[Block[{k = 1}, While[! Divisible[3^(# + k) + 2, 3^# + 2], k++]; k] &, 12] (* _Michael De Vlieger_, Feb 05 2018 *)
%t A298827 Table[MultiplicativeOrder[3, 3^n + 2], {n, 32}] (* _Jean-François Alcover_, Feb 06 2018 *)
%o A298827 (Python)
%o A298827 def fmod(n, mod):
%o A298827     return (pow(3, n, mod) + 2) % mod
%o A298827 def f(n):
%o A298827     return pow(3, n) + 2
%o A298827 #terms is the number of terms to generate
%o A298827 terms = 20
%o A298827 for x in range(1, terms + 1):
%o A298827     div = f(x)
%o A298827     y = x + 1
%o A298827     while fmod(y, div) != 0:
%o A298827         y += 1
%o A298827     print(y - x)
%o A298827 (Python)
%o A298827 from sympy import n_order
%o A298827 def A298827(n):
%o A298827     return n_order(3,3**n+2) # _Chai Wah Wu_, Jan 29 2018
%o A298827 (Magma) [Modorder(3,3^n+2): n in [1..29]]; // _Jon E. Schoenfield_, Jan 28 2018
%o A298827 (PARI) a(n) = znorder(Mod(3, 3^n+2)); \\ _Michel Marcus_, Jan 29 2018
%Y A298827 Cf. A168607.
%K A298827 nonn
%O A298827 1,1
%A A298827 _Luke W. Richards_, Jan 27 2018
%E A298827 a(22)-a(32) from _Robert Israel_, Feb 05 2018