A046268 Largest prime substring in 2^n (or 0 if none exist).
0, 2, 0, 0, 0, 3, 0, 2, 5, 5, 2, 2, 409, 19, 163, 7, 6553, 131, 2621, 5, 857, 971, 419, 83, 1677721, 5443, 71, 1342177, 43, 709, 107, 83, 4294967, 89, 171798691, 3597383, 6871947673, 3743895347, 779069, 54975581, 511627, 99023, 4398046511, 79609, 18604441, 883
Offset: 0
Keywords
Examples
2^37 = 1{3743895347}2, so a(37) = 3743895347.
Links
- Michael S. Branicky, Table of n, a(n) for n = 0..2000
Programs
-
Python
from sympy import isprime def a(n): s = str(2**n) ss = (int(s[i:j]) for i in range(len(s)) for j in range(i+1, len(s)+1)) return max((k for k in ss if isprime(k)), default=0) print([a(n) for n in range(46)]) # Michael S. Branicky, Sep 20 2022
Formula
a(n) = A047814(2^n). - Pontus von Brömssen, Jan 16 2025
Extensions
a(44) and beyond from Michael S. Branicky, Sep 20 2022