%I #12 Sep 25 2022 21:38:03
%S 0,2,0,0,0,3,0,2,5,5,2,2,409,19,163,7,6553,131,2621,5,857,971,419,83,
%T 1677721,5443,71,1342177,43,709,107,83,4294967,89,171798691,3597383,
%U 6871947673,3743895347,779069,54975581,511627,99023,4398046511,79609,18604441,883
%N Largest prime substring in 2^n (or 0 if none exist).
%H Michael S. Branicky, <a href="/A046268/b046268.txt">Table of n, a(n) for n = 0..2000</a>
%e 2^37 = 1{3743895347}2, so a(37) = 3743895347.
%o (Python)
%o from sympy import isprime
%o def a(n):
%o s = str(2**n)
%o ss = (int(s[i:j]) for i in range(len(s)) for j in range(i+1, len(s)+1))
%o return max((k for k in ss if isprime(k)), default=0)
%o print([a(n) for n in range(46)]) # _Michael S. Branicky_, Sep 20 2022
%Y Cf. A046260.
%K nonn
%O 0,2
%A _Patrick De Geest_, Jun 15 1998
%E a(44) and beyond from _Michael S. Branicky_, Sep 20 2022
|