cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A376118 Cryptarithmically unique palindromic primes.

This page as a plain text file.
%I A376118 #54 Nov 28 2024 10:53:42
%S A376118 11,11141414111,11999199911,13111311131,1110110110111,1141411141411,
%T A376118 1611116111161,3113113113113,3222223222223,3533355533353,
%U A376118 7444477744447,7767777777677,7887787877887,7999979799997,9494994994949,9779999999779,118818181818811,131133131331131,944499494994449,10000010101000001
%N A376118 Cryptarithmically unique palindromic primes.
%C A376118 Each prime in this sequence is simultaneously a palindrome in base 10 and has a unique decimal digit pattern A358497(a(n)) in the sense that no other prime has the same pattern.
%C A376118 All terms except 11 have an odd number of digits (cf. A002385).
%C A376118 Number of terms < 100^k: 1, 1, 1, 1, 1, 4, 16, 19, (92), (249), (416), (1093)... . The numbers in brackets are conjectured based on the calculated terms with 1, 2, or 3 distinct digits and the vanishing combinatorial probability of terms with 4 or more distinct digits at these lengths.
%C A376118 The smallest term with 3 distinct digits is 11155511521212511555111.
%H A376118 Dmytro Inosov, <a href="/A376118/b376118.txt">Table of n, a(n) for n = 1..20</a>
%H A376118 Dmytro Inosov, <a href="/A376118/a376118.txt">Table of n, a(n) for n = 1..1093</a>
%e A376118 11141414111 is a term since it's a palindromic prime and no other prime has the same pattern "AAABABABAAA" of repeating digits.
%e A376118 Counterexample: the palindromic prime 131 is not a term since another prime 151 has the same pattern "ABA" of repeating digits.
%t A376118 NumOfDigits = 13; (* Maximal integer length to be searched for *)
%t A376118 (* A function that calculates the canonical form A358497[n] *)
%t A376118 A358497[k_] := FromDigits@a358497C[k]
%t A376118 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]}]]];
%t A376118 (* Extracting cryptarithmically uniqie terms from palindromic primes *)
%t A376118 UniquePalPrimes = {11};
%t A376118 Do[PalindromicPrimes = {}; CryptUnique = {};
%t A376118   Do[If[PrimeQ[#], AppendTo[PalindromicPrimes,{#, A358497[#]}]]&[n*10^(IntegerLength[n]-1) +
%t A376118      FromDigits@Rest@Reverse@IntegerDigits[n]], {n, 10^(k-1), 10^k-1}];
%t A376118   CryptUnique = Extract[Extract[Select[Tally[PalindromicPrimes, #1[[2]]==#2[[2]] &], #[[2]]==1 &], {All,1}], {All,1}];
%t A376118   UniquePalPrimes = Join[UniquePalPrimes, CryptUnique];
%t A376118   (* Prints the number of results and the list of results for every integer length *)
%t A376118   Print[{2k-1, Length[CryptUnique], CryptUnique}], {k, 2, (NumOfDigits+1)/2}];
%t A376118 UniquePalPrimes
%Y A376118 Intersection of A374238 and A002113.
%Y A376118 Subsequence of A002385.
%Y A376118 Supersequence of A004022 (prime repunits).
%Y A376118 Cf. A358497.
%K A376118 nonn,base
%O A376118 1,1
%A A376118 _Dmytro Inosov_, Sep 11 2024