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!)
A295639 Smallest k not divisible by 3 such that k*3^n + 1 is prime. 3
2, 2, 4, 2, 2, 2, 8, 8, 2, 8, 28, 10, 64, 4, 4, 2, 2, 10, 20, 26, 56, 8, 104, 16, 34, 14, 14, 20, 26, 2, 26, 26, 14, 22, 26, 16, 22, 50, 4, 62, 64, 68, 88, 70, 56, 34, 146, 32, 50, 20, 314, 8, 40, 2, 70, 22, 2, 8, 40, 2, 64, 14, 136, 100, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The ratio (Sum_(n=1..t) a(n)) / (Sum_(n=1..t) n) tends to log(3) as t increases.
Differs from A239676 when A239676(n) is a multiple of 3. - Michel Marcus, Nov 25 2017
LINKS
MAPLE
f:= proc(n) local i, j, k, t;
t:= 3^n;
for i from 0 do
for j in [2, 4] do
if isprime((6*i+j)*t+1) then return 6*i+j fi
od od
end proc:
map(f, [$1..100]); # Robert Israel, Dec 14 2017
MATHEMATICA
f[n_] := Block[{k = 2}, While[If[Mod[k, 3] == 0, k+=2]; ! PrimeQ[k*3^n + 1], k+=2]; k]; Array[f, 65] (* Robert G. Wilson v, Dec 12 2017 *)
PROG
(PARI) a(n) = {k = 1; while (!isprime(k*3^n+1), k++; if (! (k%3), k++)); k; } \\ Michel Marcus, Nov 25 2017
CROSSREFS
Sequence in context: A348044 A328400 A239676 * A182982 A090047 A245525
KEYWORD
nonn
AUTHOR
Pierre CAMI, Nov 25 2017
STATUS
approved

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 April 23 10:29 EDT 2024. Contains 371905 sequences. (Running on oeis4.)