A376118 Cryptarithmically unique palindromic primes.
11, 11141414111, 11999199911, 13111311131, 1110110110111, 1141411141411, 1611116111161, 3113113113113, 3222223222223, 3533355533353, 7444477744447, 7767777777677, 7887787877887, 7999979799997, 9494994994949, 9779999999779, 118818181818811, 131133131331131, 944499494994449, 10000010101000001
Offset: 1
Examples
11141414111 is a term since it's a palindromic prime and no other prime has the same pattern "AAABABABAAA" of repeating digits. Counterexample: the palindromic prime 131 is not a term since another prime 151 has the same pattern "ABA" of repeating digits.
Links
- Dmytro Inosov, Table of n, a(n) for n = 1..20
- Dmytro Inosov, Table of n, a(n) for n = 1..1093
Crossrefs
Programs
-
Mathematica
NumOfDigits = 13; (* Maximal integer length to be searched for *) (* A function that calculates the canonical form A358497[n] *) A358497[k_] := FromDigits@a358497C[k] a358497C = Compile[{{k, _Integer}}, Module[{firstpos = ConstantArray[0, 10], digits = IntegerDigits[k], indx = 0}, Table[If[firstpos[[digits[[j]] + 1]] == 0, firstpos[[digits[[j]] + 1]] = Mod[++indx, 10]]; firstpos[[digits[[j]] + 1]], {j, Length[digits]}]]]; (* Extracting cryptarithmically uniqie terms from palindromic primes *) UniquePalPrimes = {11}; Do[PalindromicPrimes = {}; CryptUnique = {}; Do[If[PrimeQ[#], AppendTo[PalindromicPrimes,{#, A358497[#]}]]&[n*10^(IntegerLength[n]-1) + FromDigits@Rest@Reverse@IntegerDigits[n]], {n, 10^(k-1), 10^k-1}]; CryptUnique = Extract[Extract[Select[Tally[PalindromicPrimes, #1[[2]]==#2[[2]] &], #[[2]]==1 &], {All,1}], {All,1}]; UniquePalPrimes = Join[UniquePalPrimes, CryptUnique]; (* Prints the number of results and the list of results for every integer length *) Print[{2k-1, Length[CryptUnique], CryptUnique}], {k, 2, (NumOfDigits+1)/2}]; UniquePalPrimes
Comments