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.

A304247 Numbers which yield a prime whenever a '2' is inserted between any single pair of adjacent digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 23, 27, 29, 41, 51, 53, 77, 81, 83, 87, 89, 99, 101, 113, 123, 129, 131, 137, 149, 183, 207, 221, 243, 251, 297, 303, 321, 329, 357, 359, 399, 401, 417, 419, 429, 441, 443, 453, 461, 471, 473, 527, 533, 581, 597, 611, 621
Offset: 1

Views

Author

M. F. Hasler, Jun 01 2018

Keywords

Comments

Motivated by existing sequences defined in an analog way for other digits to be inserted, e.g., A164329 for the digit 0, cf. cross-references.
For single-digit terms, the condition is voidly satisfied: nothing can be inserted.
See also A050712 where 2 is inserted between each pair of adjacent digits. - R. J. Mathar, Feb 28 2020

Examples

			123 is in the sequence because it yields a prime when a '2' is inserted after the first or after the second digit, which yields the prime 1223 in both cases. The term itself does not need to be prime.
		

Crossrefs

Cf. A164329 (prime when 0 is inserted anywhere), A216169 (subset of composite terms), A215417 (subset of primes), A159236 (0 is inserted between all digits).
Cf. A068679 (1 is prefixed, appended or inserted anywhere), A069246 (primes among these), A068673 (1 is prefixed, or appended), A304246 (1 is inserted anywhere).
Cf. A158594 (3 is prefixed, appended or inserted anywhere), A215419 (primes among these).
Cf. A069832 (7 is prefixed, appended or inserted anywhere), A215420 (primes among these), A068677 (7 is prefixed or appended).
Cf. A069833 (9 is prefixed, appended or inserted anywhere), A215421 (primes among these).
Cf. A158232 (13 is prefixed or appended).
Cf. A304243 (2 is prefixed or prime(k+2) is inserted after the k-th digit), A304244 (prime(k) is inserted after the k-th digit), A304245 (prime(k+1) is inserted after the k-th digit, k > 1, or '2' after the first digit).

Programs

  • Maple
    filter:= proc(n) local j,t;
      for j from 1 to ilog10(n) do
        if not isprime(10*n-9*(n mod 10^j)+2*10^j) then return false fi
      od;
      true
    end proc:
    select(filter, [$0..10000]); # Robert Israel, Jun 01 2018
  • PARI
    is(n,p=2,L=logint(n+!n,10)+1,d,P)=!for(k=1,L-1,isprime((d=divrem(n,P=10^(L-k)))[2]+(10*d[1]+p)*P)||return)