login
a(n) is the least number k such that k - 5^i is prime for i = 1..n.
0

%I #23 May 31 2022 06:48:53

%S 7,28,132,666,3234,17514,100674,501228,2062662,211097334,2597411082,

%T 34473310284,214852200444,394471192794

%N a(n) is the least number k such that k - 5^i is prime for i = 1..n.

%C a(15) > 5*10^12. - _David A. Corneth_, May 30 2022

%e a(3) = 132 because 132 - 5^1 = 127, 132 - 5^2 = 107 and 132 - 5^3 = 7 are all prime, and 132 is the least number with this property.

%p g:= proc(n) local p,x,i;

%p p:= 1:

%p do

%p p:= nextprime(p);

%p x:= p + 5^n;

%p if andmap(isprime, [seq(x-5^i,i=1..n-1)]) then return x fi

%p od

%p end proc:

%p map(g, [$1..10]);

%o (Python)

%o from sympy import isprime, nextprime

%o def a(n):

%o p = 2

%o while True:

%o k, p = 5**n + p, nextprime(p)

%o if all(isprime(k-5**i) for i in range(1, n)):

%o return k

%o print([a(n) for n in range(1, 10)]) # _Michael S. Branicky_, May 30 2022

%Y Cf. A000351, A175222.

%K nonn,more

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, May 30 2022

%E a(11)-a(14) from _David A. Corneth_, May 30 2022