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.

A382179 Numbers k such that for each digit of k, 2*k*(digit) + 1 is prime.

Original entry on oeis.org

1, 3, 6, 9, 11, 14, 15, 22, 24, 25, 27, 28, 33, 44, 54, 63, 75, 78, 81, 88, 99, 111, 119, 131, 141, 153, 168, 173, 219, 249, 252, 255, 279, 282, 322, 325, 333, 357, 363, 414, 441, 459, 474, 491, 538, 553, 558, 565, 611, 666, 674, 699, 794, 797, 828, 831, 832, 858, 895, 924, 947, 955
Offset: 1

Views

Author

Jakub Buczak, Mar 17 2025

Keywords

Comments

The decision to use the expression 2*k*(digit) instead of k*(digit) is based on the fact that k*(odd) + 1 is never prime. By multiplying k*(digit) by 2, we ensure that any number, regardless of its digits, can appear in the sequence. Additionally, numbers containing the digit 0 are never terms, as 2*k*(0) + 1 is never prime.
When k is restricted to the smallest term with n distinct digits, only 7 terms exist (see A382198).
If the smallest term k is further restricted to a prime number p with n distinct digits, the conditions become significantly more restrictive (see A382127).

Examples

			63 is a term because 2*63*6 + 1 and 2*63*3 + 1 are both prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[2500], AllTrue[2 * # * IntegerDigits[#] + 1, PrimeQ] &] (* Amiram Eldar, Mar 17 2025 *)
  • PARI
    isok(k) = my(d=Set(digits(k))); for (i=1, #d, if (!isprime(2*k*d[i]+1), return(0));); return(1); \\ Michel Marcus, Mar 17 2025
    
  • Python
    from sympy import isprime
    def ok(n): return all(isprime(2*n*d+1) for d in map(int, set(str(n))))
    print([k for k in range(956) if ok(k)]) # Michael S. Branicky, Mar 17 2025

A382127 Smallest prime p with n distinct digits, such that for each digit of p, 2*p*(digit) + 1 is prime.

Original entry on oeis.org

3, 131, 173, 4391, 4746616799
Offset: 1

Views

Author

Jakub Buczak, Mar 16 2025

Keywords

Comments

The sequence is proven to be finite by definition and by nature, containing only up to 7 terms (though it is uncertain if all 7 exist). This is because in base 10 there are 10 digits, excluding 0 that's 9. There are always 2 digits d_1 and d_2, such that 2*p*d_1 + 1 and 2*p*d_2 + 1 has an ending digit of 5. The (d_1,d_2) for the ending digits of p are: 1->(2,7), 3->(4,9), 7->(1,6), 9->(3,8). We exclude any prime with a digit 0, because 2*p*(0) + 1 is never prime.
The form 2*p*(digit) + 1 ensures a chance of primality, as p*(odd) + 1 is always composite.
Under 2*p*(digit) + 1, every term with a digit 1 is also a Sophie-Germain prime (see A005384).

Examples

			a(2) = 131, because 131 has exactly 2 distinct digits (1,3), and 2*131*1 + 1 and 2*131*3 + 1 are both prime.
		

Crossrefs

Subsequence of A382199.

Programs

  • PARI
    isok(k, n) = my(d=Set(digits(k))); if (#d != n, return(0)); for (i=1, #d, if (!isprime(2*k*d[i]+1), return(0)); ); return(1);
    a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p; \\ Michel Marcus, Mar 18 2025
  • Python
    from sympy import isprime
    from itertools import count
    def a(n):
        return next(p for p in count(2) if isprime(p) and len(set(str(p)))==n and '0' not in str(p) and all(isprime(2*p*int(d)+1) for d in set(str(p))))
    

Extensions

a(5) from Michel Marcus, Mar 18 2025

A382199 Primes p such that for each digit of p, 2*p*(digit) + 1 is prime.

Original entry on oeis.org

3, 11, 131, 173, 491, 797, 947, 1931, 3583, 4391, 6173, 7937, 32323, 49919, 64499, 79997, 83383, 149111, 232333, 296269, 366161, 477947, 611333, 616169, 616961, 635563, 667673, 969179, 1111991, 1779779, 2232523, 2662669, 2922229, 3444341, 5333353, 5599999, 6853663, 6919691, 6929929
Offset: 1

Views

Author

Michel Marcus, Mar 18 2025

Keywords

Crossrefs

Subsequence of primes of A382179.

Programs

  • PARI
    isok(k) = if (isprime(k), my(d=Set(digits(k))); for (i=1, #d, if (!isprime(2*k*d[i]+1), return(0))); return(1)); \\ Michel Marcus, Mar 18 2025
Showing 1-3 of 3 results.