login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A298827 a(n) is the smallest positive integer k such that 3^n+2 divides 3^(n+k)+2. 2

%I #59 Sep 08 2022 08:46:20

%S 4,5,28,41,84,336,990,193,1260,5905,75918,10065,318860,2391485,

%T 14348908,20390382,5031420,31624326,5985168,1743333144,8569036,

%U 668070480,547062516,141214768241,167874004756,1270932914165,385131186110,2837770056420,784347169884,475536631360,149093578413164,139370386996590

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

%C 3^n+2 divides 3^(n+a(n)*m)+2 for all nonnegative integers m.

%C 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 Robert Israel, <a href="/A298827/b298827.txt">Table of n, a(n) for n = 1..175</a>

%e 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 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 seq(numtheory:-order(3, 3^n+2), n=1..100); # _Robert Israel_, Feb 05 2018

%t Array[Block[{k = 1}, While[! Divisible[3^(# + k) + 2, 3^# + 2], k++]; k] &, 12] (* _Michael De Vlieger_, Feb 05 2018 *)

%t Table[MultiplicativeOrder[3, 3^n + 2], {n, 32}] (* _Jean-François Alcover_, Feb 06 2018 *)

%o (Python)

%o def fmod(n, mod):

%o ....return (pow(3, n, mod) + 2) % mod

%o def f(n):

%o ....return pow(3, n) + 2

%o #terms is the number of terms to generate

%o terms = 20

%o for x in range(1,terms + 1):

%o ....div = f(x)

%o ....y = x + 1

%o ....while fmod(y, div) != 0:

%o ........y += 1

%o ....print(y - x)

%o (Python)

%o from sympy import n_order

%o def A298827(n):

%o return n_order(3,3**n+2) # _Chai Wah Wu_, Jan 29 2018

%o (Magma) [Modorder(3,3^n+2): n in [1..29]]; // _Jon E. Schoenfield_, Jan 28 2018

%o (PARI) a(n) = znorder(Mod(3, 3^n+2)); \\ _Michel Marcus_, Jan 29 2018

%Y Cf. A168607.

%K nonn

%O 1,1

%A _Luke W. Richards_, Jan 27 2018

%E a(22)-a(32) from _Robert Israel_, Feb 05 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 10:59 EDT 2024. Contains 371277 sequences. (Running on oeis4.)