login
A057199
The first nontrivial (k>n+2) palindromic prime in both bases n and n+2 or -1 if it does not exist.
2
5, 1667, 7517, 34853363, 116755331881, 20537111057, 373
OFFSET
2,1
COMMENTS
a(9) > 5.5*10^22, a(10) = 181, a(11) = 161292069901, a(12) = 773. - Giovanni Resta, Feb 28 2013
From Chai Wah Wu, Sep 16 2019: (Start)
a(13)-a(100) = 56941, 337, 169445909, 433, 578839, 541, 106121443, 661, 582983, 4519, 682764227, 937, 689851, 1093, 741551113, 7177, 2828257, 12043, 24785688133, 8167, 3350657, 6737, 78730410146989, 2053, 26105363, 2281, 8354404853, 2521, 6204901, 10169, 14829078601, 3037, 11169317, 3313, ?, 27611, 18718787, 9103, 771909202297, 21067, 25391137, 74167, ?, 37363, 90483233, 26107, 736007755807927, 5581, 22104937, 5953, 276580159573, 6337, 28246531, 6733, 200524263889, 54751, 131969267, 7561, ?, 7993, 135040879, 19687, 1451803410833, 8893, 462569659, 46807, 792717779333, 22963, 451983979, 10333, ?, 10837, 81892231, 11353, 1873894723213, 59407, 393477817, 12421, 10617265587037, 12973, 663428993, 13537, ?, 51749, 507537761, 34303, 16515848080133, 76507.
It seems that when n is of the form 12*m + 11, a(n) tends to be large (if it exists at all).
For n > 2, a(n) >= n^2+5n+1 if it exists. Proof: Let a(n) = k. k must have at least 2 digits in base n since k > n+2. If k has 2 digits, then k = an+a which is composite for a > 1. If a = 1, then k = n+1 < n+2. Thus k must have at least 3 digits in base n. If k is a palindrome in base n written as 1x1 where x < 5, then k in base n+2 is a 2 digit palindrome which again would be composite as k > n+3 for n > 2.
Suppose n > 6 is even. Then a(n) >= 3*n^2/2 + 3*n + 1 if it exists. If 3*n^2/2 + 3*n + 1 is prime, then a(n) = 3*n^2/2 + 3*n + 1. Proof: by the above, a(n) must be of the form 1x1 in base n = 1y1 in base n+2 with 4 < x < n and y > 0. This corresponds to nx = 4(n+1)+(n+2)y. Solving this linear Diophantine equation in x and y shows that x = n/2 + 3 and y = n/2 - 2 which implies that 1x1 in base n = 3*n^2/2 + 3*n + 1.
This also implies that the prime star numbers A083577(n) for n > 3 is a subsequence.
Conjecture: a(n) <> -1 for all n.
(End)
EXAMPLE
a(3) = 1667 because it is the first prime > 5 which is a palindrome in both base 3 and 5.
MATHEMATICA
f[n_] := Block[{k = n + 3}, While[a = IntegerDigits[k, n]; b = IntegerDigits[k, n + 2]; ! PrimeQ[k] || a != Reverse[a] || b != Reverse[b], k++]; k]; Do[ Print[{n, f[n] // Timing}], {n, 2, 10}]
CROSSREFS
Sequence in context: A262628 A375693 A237914 * A198246 A122465 A203683
KEYWORD
nonn,base,more
AUTHOR
Robert G. Wilson v, Sep 16 2000
EXTENSIONS
a(6)-a(8) from Giovanni Resta, Feb 28 2013
STATUS
approved