A382666 Smallest k such that 7^(7^n) - k is prime.
2, 2, 6, 512, 3918, 48966
Offset: 0
Examples
a(2) = 6 because 7^(7^2) - 6 = 256923577521058878088611477224235621321601 is prime.
Programs
-
Mathematica
lst={};Do[Do[p=7^(7^n)-k;If[PrimeQ[p],AppendTo[lst,k];Break[]],{k,2,11!}],{n,7}];lst Table[k=1;Monitor[Parallelize[While[True,If[PrimeQ[7^(7^n)-k],Break[]];k++];k],k],{n,0,7}] y[n_] := Module[{x = 7^(7^n)}, x - NextPrime[x, -1]]; Array[y, 7]
-
PARI
a(n) = my(x = 7^(7^n)); x - precprime(x-1);
-
Python
from sympy import prevprime def a(n): base = 7**(7**n) return base - prevprime(base) # Jakub Buczak, May 04 2025
Extensions
a(5) from Michael S. Branicky, Apr 14 2025
Comments