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.

Previous Showing 11-13 of 13 results.

A361530 Primes that can be written as the result of shuffling the decimal digits of two primes.

Original entry on oeis.org

23, 37, 53, 73, 113, 127, 131, 137, 139, 151, 157, 173, 179, 193, 197, 211, 223, 229, 233, 239, 241, 271, 283, 293, 311, 313, 317, 331, 337, 347, 353, 359, 367, 373, 379, 383, 389, 397, 421, 431, 433, 457, 523, 541, 547, 571, 593, 613, 617, 631, 673, 677, 719
Offset: 1

Views

Author

Robert C. Lyons, Mar 14 2023

Keywords

Comments

Each term is essentially an element of the shuffle product of the decimal digits of two primes (possibly equal).

Examples

			37 and 73 are in the sequence because they are both the result of shuffling 3 and 7.
127 is in the sequence because it is the result of shuffling 2 and the digits of 17.
1193 is in the sequence because it is the result of shuffling the digits of 13 and the digits of 19.
163 is not in the sequence because it is not the result of shuffling the digits of two primes. 163 is the result of permuting the digits of 3 and 61; however, 163 contains the digits of 61 in the wrong order.
		

Crossrefs

Programs

  • Python
    import sympy
    def get_shuffle_product(list_1, list_2):
        shuffle_product = set()
        shuffle = []
        _get_shuffle_product(list_1, list_2, shuffle, shuffle_product)
        return shuffle_product
    def _get_shuffle_product(list_1, list_2, shuffle, shuffle_product):
        if len(list_1) == 0 and len(list_2) == 0:
            shuffle_product.add(tuple(shuffle))
            return
        else:
            if len(list_1) == 0:
                shuffle.append(list_2[0])
                _get_shuffle_product(list_1, list_2[1:], shuffle, shuffle_product)
                shuffle.pop()
            elif len(list_2) == 0:
                shuffle.append(list_1[0])
                _get_shuffle_product(list_1[1:], list_2, shuffle, shuffle_product)
                shuffle.pop()
            else:
                shuffle.append(list_1[0])
                _get_shuffle_product(list_1[1:], list_2, shuffle, shuffle_product)
                shuffle.pop()
                shuffle.append(list_2[0])
                _get_shuffle_product(list_1, list_2[1:], shuffle, shuffle_product)
                shuffle.pop()
    max_prime_index = 25 # one and two digit primes.
    max_element = 999
    prime_set = set()
    for p_index in range(1, max_prime_index+1):
        p = sympy.prime(p_index)
        for q_index in range(p_index, max_prime_index+1):
            q = sympy.prime(q_index)
            list_p = list(str(p))
            list_q = list(str(q))
            shuffle_product = get_shuffle_product(list_p, list_q)
            for s in shuffle_product:
                candidate = int(''.join(s))
                if sympy.isprime(candidate) and candidate <= max_element:
                    prime_set.add(candidate)
    print(sorted(prime_set))
    
  • Python
    from sympy import isprime
    from itertools import chain, combinations
    def powerset(s): # skipping empty set and entire set
        return chain.from_iterable(combinations(s, r) for r in range(1, len(s)))
    def ok(n):
        if not isprime(n): return False
        s = str(n)
        for indices in powerset(range(len(s))):
            t1 = "".join(s[i] for i in indices)
            t2 = "".join(s[i] for i in range(len(s)) if i not in indices)
            if t1[0] != "0" and t2[0] != "0" and isprime(int(t1)) and isprime(int(t2)):
                return True
    print([k for k in range(720) if ok(k)]) # Michael S. Branicky, Apr 16 2023

A365009 Semiprimes that are the concatenation of two or more semiprimes.

Original entry on oeis.org

46, 49, 69, 94, 106, 146, 159, 214, 219, 226, 254, 259, 334, 339, 346, 386, 394, 415, 422, 446, 451, 458, 466, 469, 482, 485, 493, 514, 519, 554, 559, 579, 586, 589, 614, 622, 626, 629, 633, 634, 635, 649, 655, 662, 669, 674, 685, 687, 694, 695, 699, 746, 749, 779, 866, 869, 879, 914, 921, 922
Offset: 1

Views

Author

Zak Seidov and Robert Israel, Aug 15 2023

Keywords

Comments

Conjecture: The fraction of semiprimes <= N that are in this sequence goes to 1 as N -> infinity. What is the first N for which that fraction >= 1/2?

Examples

			a(3) = 69 is a term because 69 = 3 * 23 is a semiprime and is the concatenation of the semiprimes 6 = 2 * 3 and 9 = 3 * 3.
		

Crossrefs

Cf. A001358, A001238, A019549. Contains A107342.

Programs

  • Maple
    filter:= proc(n) local d,v;
      if numtheory:-bigomega(n) <> 2 then return false fi;
      for d from 1 to length(n)-1 do
         v:= n  mod 10^d;
         if v >= 10^(d-1) and numtheory:-bigomega(v)=2 and g((n-v)/10^d) then return true fi
      od;
      false
    end proc:
    g:= proc(n) local d,v; option remember;
      if numtheory:-bigomega(n) = 2 then return true fi;
      for d from 1 to length(n)-1 do
        v:= n mod 10^d;
        if v >= 10^(d-1) and numtheory:-bigomega(v)=2 and procname((n-v)/10^d) then return true fi
      od;
      false
    end proc:
    select(filter, [$10..1000]);

A165631 Numbers whose cube is a concatenation of primes, i.e., in A152242.

Original entry on oeis.org

3, 7, 9, 11, 13, 15, 17, 18, 27, 28, 29, 31, 33, 38, 39, 45, 47, 48, 49, 53, 55, 58, 59, 61, 63, 68, 71, 73, 75, 83, 85, 88, 91, 95, 98, 103, 108, 111, 113, 117, 121, 125, 127, 131, 133, 135, 137, 138, 148, 153, 157, 159, 161, 163, 167, 168, 173, 175, 177, 178, 179
Offset: 1

Views

Author

Zak Seidov and M. F. Hasler, Oct 16 2009

Keywords

Crossrefs

Programs

  • PARI
    for(n=1,999, is_A152242(n^3) & print1(n", "))

Extensions

Edited by Charles R Greathouse IV, Apr 24 2010
Previous Showing 11-13 of 13 results.