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!)
A340226 a(n) is the least k > 0 such that k*prime(n)-prime(n-1) and k*prime(n)-prime(n+1) are both prime. 2
2, 4, 4, 6, 6, 4, 42, 18, 6, 6, 10, 10, 6, 2, 120, 18, 12, 6, 6, 30, 6, 24, 70, 6, 18, 60, 6, 66, 52, 30, 6, 42, 18, 366, 2, 6, 6, 2, 18, 18, 12, 40, 30, 6, 2, 78, 66, 36, 66, 6, 42, 54, 2, 2, 36, 90, 60, 36, 18, 48, 6, 6, 46, 42, 90, 24, 4, 6, 126, 6, 60, 2, 150, 156, 30, 144, 30, 48, 30, 100, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
3,1
COMMENTS
All terms are even.
LINKS
EXAMPLE
For n = 4, 5, 7 and 11 are the third to fifth primes, 4*7-5 = 23 and 4*7-11 = 17 are prime, so a(4)=4.
MAPLE
f:= proc(n) local p, q, r, k;
p:= ithprime(n);
q:= ithprime(n-1); r:= ithprime(n+1);
for k from 2 by 2 do if isprime(k*p-q) and isprime(k*p-r) then return k fi od;
end proc:
map(f, [$3..100]);
MATHEMATICA
lkp[p_]:=Module[{a=NextPrime[p, -1], b=NextPrime[p], k=2}, While[Total[Boole[ PrimeQ[ k p-{a, b}]]]!=2, k=k+2]; k]; lkp/@Prime[Range[3, 90]] (* Harvey P. Dale, Feb 23 2023 *)
CROSSREFS
Cf. A340212.
Sequence in context: A266076 A074325 A058249 * A348769 A058043 A251546
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jan 01 2021
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 August 11 14:50 EDT 2024. Contains 375073 sequences. (Running on oeis4.)