login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A097523
a(n) = least k such that k - prime(n) and k + prime(n) are both prime.
1
5, 8, 8, 10, 18, 16, 20, 22, 30, 32, 36, 42, 48, 46, 50, 56, 72, 66, 70, 78, 76, 84, 90, 92, 100, 132, 108, 120, 114, 116, 130, 138, 140, 142, 162, 156, 160, 168, 170, 176, 210, 186, 198, 196, 200, 202, 222, 226, 230, 232, 246, 252, 246, 258, 264, 294, 272, 276
OFFSET
1,1
FORMULA
a(n) = A087711(A000040(n)). - Robert Israel, Jul 26 2015
EXAMPLE
Prime(10) = 29; both 32 - 29 = 3 and 32 + 29 = 61 are prime, and 32 is the smallest integer for which this is the case, so a(10) = 32.
MAPLE
f:= proc(n) local p, k;
p:= ithprime(n);
for k from p+1 by 2 do
if isprime(k+p) and isprime(k-p) then return k fi
od
end proc:
f(1):= 5:
map(f, [$1..100]); # Robert Israel, Jul 26 2015
MATHEMATICA
f[n_] := Block[{k = Prime[n], p = Prime[n]}, While[ !PrimeQ[k - p] || !PrimeQ[k + p], k++ ]; k]; Table[ f[n], {n, 60}] (* Robert G. Wilson v, Aug 28 2004 *)
CROSSREFS
Sequence in context: A198606 A031165 A113729 * A250123 A335298 A251687
KEYWORD
easy,nonn
AUTHOR
Pierre CAMI, Aug 27 2004
EXTENSIONS
Corrected by Robert G. Wilson v, Aug 28 2004
STATUS
approved

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy