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!)
A181530 Greatest k <= n such that 3^n + 3^k - 1 is prime, or 0 if no such prime exists. 2

%I #29 Sep 08 2022 08:45:54

%S 1,2,3,3,3,5,7,8,6,8,8,12,7,6,12,15,8,13,13,20,18,20,23,22,20,8,27,26,

%T 22,26,21,30,27,20,35,26,28,28,35,38,39,22,37,38,12,45,39,36,3,30,49,

%U 49,48,37,28,56,42,53,17,58,36,62,59,55,40,26,64,68,58,61

%N Greatest k <= n such that 3^n + 3^k - 1 is prime, or 0 if no such prime exists.

%H Pierre CAMI, <a href="/A181530/b181530.txt">Table of n, a(n) for n = 1..2000</a>

%e For n = 4, 3^4 + 3^4 - 1 = 161 = 7*23, 3^4 + 3^3 - 1 = 107 so a(4) = 3.

%e For n = 154, for k = 0, 1, 2, 3, ..., 154, the numbers 3^154 + 3^k - 1 are respectively divisible by 3, 5531, 73, 5, 7, 19001, 6553, 5, 239, 3541, 7, 5, 33247, 71, 19, 5, 7, 29, 1973, 5, 436467739, 71161, 7, 5, 4283, 37, 73, 5, 7, 11177, 13721, 5, 19, 29207, 7, 5, 64849, 4001, 73, 5, 7, 31, 227009113, 5, 139, 29, 7, 5, 71, 107102231, 19, 5, 7, 10765021647412056860623883, 521, 5, 241, 1448445976112887644909473, 7, 5, 5657, 37, 73, 5, 7, 110661029, 65963, 5, 19, 20411, 7, 5, 331, 29, 73, 5, 7, 7671791, 269, 5, 563, 211, 7, 5, 6553, 113, 19, 5, 7, 425679689, 1301, 5, 334244063, 53, 7, 5, 15254167, 37, 73, 5, 7, 29, 3391, 5, 19, 7727, 7, 5, 4799, 2269, 73, 5, 7, 1822597729, 47, 5, 242496218184092003, 38971, 7, 5, 9994245487379630507640393493999, 9104413, 19, 5, 7, 3581, 1039, 5, 181, 29, 7, 5, 2472681219552827727900539, 37, 73, 5, 7, 47, 99986141, 5, 19, 1237, 7, 5, 55817, 53, 73, 5, 7, 1033, 9187, 5, 199, 71, 7. So a(154) = 0.

%o (PARI) a(n) = my(k=n); while (!isprime(3^n + 3^k - 1), k--; if (k==0, return (0))); k; \\ _Michel Marcus_, Sep 16 2019

%o (Magma) sol:=[];for n in [1..70] do k:=n; while not IsPrime(3^n+3^k-1) and k gt 0 do k:=k-1; end while; if k ge 0 then Append(~sol,k); else Append(~sol,0);end if; end for; sol; // _Marius A. Burtea_, Sep 16 2019

%K nonn

%O 1,2

%A _Pierre CAMI_, Jan 29 2011

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 May 11 04:10 EDT 2024. Contains 372388 sequences. (Running on oeis4.)