OFFSET
1,2
COMMENTS
Record values of k for n = 1,2,3,4,6, i.e., for primes 3,5,11,17,41. What is the next record value of k if it exists ?
From Robert Israel, Sep 27 2024: (Start)
Dickson's conjecture implies that the sequence should be unbounded. However, terms > 39 are expected to be extremely rare. For 7 <= n <= 3*10^6 the only term > 9 is a(740969) = 10. (End)
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
MAPLE
Primes:= select(isprime, {seq(i, i=3..4000, 2)}):
Twins:= Primes intersect map(`-`, Primes, 2):
f:= proc(n) local i;
for i from 1 do if not isprime(n+i*(i+1)) then return i-1 fi od
end proc:
map(f, Twins); # Robert Israel, Sep 27 2024
MATHEMATICA
s[n_] := If[PrimeQ[n] && PrimeQ[n + 2], Module[{i = 1}, While[PrimeQ[n + i*(i + 1)], i++]; i - 1], Nothing]; Array[s, 3500] (* Amiram Eldar, Aug 27 2024 *)
PROG
(PARI) \\ uses A001359 PARI code
a(n) = my(p=A001359(n)); for (k=1, oo, for (i=1, k, if (!isprime(p+i*(i + 1)), return(k-1)))); \\ Michel Marcus, Aug 27 2024
(PARI) f(p) = for (k=1, oo, for (i=1, k, if (!isprime(p+i*(i + 1)), return(k-1))));
lista(nn) = my(v = select(x->isprime(x+2), primes(nn))); apply(f, v); \\ Michel Marcus, Aug 27 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Aug 27 2024
STATUS
approved