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.

Showing 1-3 of 3 results.

A376118 Cryptarithmically unique palindromic primes.

Original entry on oeis.org

11, 11141414111, 11999199911, 13111311131, 1110110110111, 1141411141411, 1611116111161, 3113113113113, 3222223222223, 3533355533353, 7444477744447, 7767777777677, 7887787877887, 7999979799997, 9494994994949, 9779999999779, 118818181818811, 131133131331131, 944499494994449, 10000010101000001
Offset: 1

Views

Author

Dmytro Inosov, Sep 11 2024

Keywords

Comments

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.
All terms except 11 have an odd number of digits (cf. A002385).
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.
The smallest term with 3 distinct digits is 11155511521212511555111.

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.
		

Crossrefs

Intersection of A374238 and A002113.
Subsequence of A002385.
Supersequence of A004022 (prime repunits).
Cf. A358497.

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

A374267 Perfect squares whose pattern of identical digits is unique among the squares.

Original entry on oeis.org

1444, 7744, 14884, 19881, 29929, 37636, 40401, 44944, 46656, 55696, 66564, 69696, 116964, 133225, 136161, 144400, 166464, 190969, 202500, 219961, 224676, 225625, 261121, 276676, 277729, 300304, 339889, 407044, 438244, 473344, 511225, 525625, 544644, 553536, 555025, 556516, 585225
Offset: 1

Views

Author

Dmytro Inosov, Jul 02 2024

Keywords

Comments

The digit pattern for any natural number n is uniquely defined by the canonical form A358497(n), which enumerates digits in order of their first occurrence in n, from left to right.
Each perfect square in this sequence has a unique digit pattern in the sense that no other square has the same pattern.
A cryptarithm (alphametic) expresses a digit pattern in letters, where each distinct letter is to map to a distinct digit.If a cryptarithmetic problem calls for a perfect square, then the squares in this sequence are unique solutions, so we call them cryptarithmically unique.

Examples

			The first cryptarithmically unique square is 38^2=1444. This means that no other square has the same digit pattern "ABBB".
Counterexample: 144=12^2 is not in this sequence because 400=20^2 is also a perfect square with the same digit pattern "ABB". Equivalently, A358497(144)=A358497(400)=122.
The alphametic puzzle SEA^2 = BIKINI has a solution 437^2 = 190969 (K=0, B=1, E=3, S=4, N=6, A=7, I=9). This solution is unique because 190969 is a term in this sequence.
		

Crossrefs

Subsequence of A000290 (squares).
Cf. A374268 (bases of cryptarithmically unique squares).
Cf. A374238 (cryptarithmically unique primes).

Programs

  • Mathematica
    NumOfDigits = 4; (* Maximal integer length to be searched for *)
    A358497[k_] := With[{pI = Values@PositionIndex@IntegerDigits@k}, MapIndexed[#1 -> Mod[#2[[1]], 10] &, pI, {2}] // Flatten // SparseArray // FromDigits];
    Extract[Extract[Select[Tally[Table[{#, A358497[#]} &[i^2], {i, 1, 10^NumOfDigits - 1}], #1[[2]] == #2[[2]] &], #[[2]] == 1 &], {All, 1}], {All, 1}]

Formula

a(n) = A374268(n)^2.

A376084 Number of cryptarithmically unique primes with n decimal digits.

Original entry on oeis.org

0, 1, 0, 0, 0, 0, 2, 1, 3, 18, 105
Offset: 1

Views

Author

Dmytro Inosov, Sep 09 2024

Keywords

Comments

a(n) gives the number of n-digit primes p for which no other prime shares the same digit pattern, A358497(p).
a(n) is the count of terms in A374238 of length n.
a(n) shows anomalously small values for n divisible by 3 because certain digit patterns cannot result in primes based on divisibility rules: Whenever every digit occurs a number of times that is divisible by 3, the sum of digits is also divisible by 3, and therefore the number cannot be prime. For example, for n=12 all patterns consisting of 2 distinct digits A and B with the number of both A's and B's divisible by 3 (such as "AABABAAAABAA" and alike) cannot produce primes and therefore do not contribute to the total count. As a result, a(n) is not monotonic.
It is conjectured that a(n) is asymptotic to A006879(n) as n->oo based on the combinatorial probability estimate under the assumption that asymptotically for large n, the fraction of primes among integers that share a given digit pattern would be the same as among all integers with n digits, given by p(n)=1/(n*ln10) according to the prime number theorem. Since the number of integers sharing the same digit pattern cannot exceed 9*9!, the probability for a randomly chosen prime of length n to be cryptarithmically unique >= (1-p(n))^(9*9!-1), which is asymptotic to 1 as n->oo.
The following terms are conjectured based on the assumption that at these lengths A374238 does not contain terms with 4 or more distinct digits, which follows from the vanishing probability of such terms estimated with combinatorial arguments:
a(12)=24,
a(13)=668,
a(14)=1129,
a(15)=1306,
a(16)=4263,
a(17)=17320,
a(18)=6734,
a(19)=81794.
Further conjectured terms: a(20)=125975, a(21)=180471, a(22)=852579. - Michael S. Branicky, Oct 16 2024

Examples

			a(2)=1 because the only cryptarithmically unique prime (A374238) with 2 digits is 11. Indeed, any other 2-digit natural number with the same pattern "AA" is divisible by 11, whereas no 2-digit prime with the pattern "AB" of two nonequal digits is cryptarithmically unique because there are 20 primes that share the same pattern (all 2-digit primes except 11).
a(3)=0 because there are no cryptarithmically unique primes (A374238) with 3 digits.
a(7)=2 because there are exactly two cryptarithmically unique primes with 7 digits, which are 3333311 and 7771717.
		

Crossrefs

Cf. A374238 (cryptarithmically unique primes), A004022 (prime repunits), A358497, A376918.

Formula

a(n) <= A376918(n).
a(n) <= A006879(n).
lim_{n->oo} a(n)/A006879(n)=1 (conjectured).
Showing 1-3 of 3 results.