login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A298048 a(1) = number of 1-digit primes (that is, 4: 2,3,5,7); then a(n) = number of distinct n-digit prime numbers obtained by left- or right-concatenating a digit to the a(n-1) primes obtained in the previous iteration. 1
4, 16, 70, 243, 638, 1450, 2819, 4951, 7629, 10677, 13267, 15182, 15923, 15796, 14369, 12547, 10291, 7939, 5703, 3911, 2559, 1595, 920, 561, 321, 167, 72, 37, 11, 6, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..31.

EXAMPLE

2-digit primes:

-------------------

23   2->23 or 3->23

29   2->29

13   3->13

43   3->43

53   3->53 or 5->53

73   3->73 or 7->73

83   3->83

31   3->31

37   3->37 or 7->37

59   5->59

17   7->17

47   7->47

67   7->67

97   7->97

71   7->71

79   7->79

-------------------

a(2) = 16.

===================

3-digit primes:

[223, 233, 523, 823, 239, 229, 293, 829, 929, 113, 131, 313, 613, 137, 139, 311, 331, 431, 631, 317, 433, 443, 643, 743, 439, 353, 653, 853, 953, 173, 373, 733, 673, 773, 739, 337, 937, 379, 283, 383, 683, 883, 983, 839, 359, 593, 659, 859, 599, 617, 179, 271, 571, 971, 719, 347, 547, 647, 947, 479, 167, 367, 467, 677, 967, 197, 397, 797, 977, 997]

In the case of 223, 2->23 (adding the rightmost digit)->223 (adding the leftmost digit) and 2, 23 and 223 are prime.

In the case of 233, 2->23 (adding the rightmost digit)->233 (adding the rightmost digit) and 2, 23 and 233 are prime.

In the case of 523, 2->23 (adding the rightmost digit)->523 (adding the leftmost digit) and 2, 23 and 523 are prime.

a(3) = 70.

MATHEMATICA

Block[{b = 10, t}, t = Select[Range[b], CoprimeQ[#, b] &]; TakeWhile[Length /@ Fold[Function[{a, n}, Append[a, Union[Join @@ {Join @@ Map[Function[k, Select[Map[Prepend[k, #] &, Range[b - 1]], PrimeQ@ FromDigits[#, b] &]], Last[a]], Join @@ Map[Function[k, Select[Map[Append[k, #] &, t], PrimeQ@ FromDigits[#, b] &]], Last[a]]}] ] ] @@ {#1, #2} &, {IntegerDigits[Prime@ Range@ PrimePi@ b, b]}, Range[2, 40]], # > 0 &]] (* Michael De Vlieger, Jan 21 2018 *)

PROG

(Ruby)

require 'prime'

def A298048(n)

  ary = [2, 3, 5, 7]

  a_ary = [4]

  (n - 1).times{|i|

    ary1 = []

    ary.each{|a|

      (1..9).each{|d|

        j = d * 10 ** (i + 1) + a

        ary1 << j if j.prime?

        j = a * 10 + d

        ary1 << j if j.prime?

      }

    }

    ary = ary1.uniq

    a_ary << ary.size

  }

  a_ary

end

p A298048(10)

CROSSREFS

Cf. A050986, A050987, A297960, A297961.

Sequence in context: A231297 A231358 A000303 * A144316 A180145 A133789

Adjacent sequences:  A298045 A298046 A298047 * A298049 A298050 A298051

KEYWORD

nonn,fini,full,base

AUTHOR

Seiichi Manyama, Jan 11 2018

EXTENSIONS

a(16)-a(31) from Michael De Vlieger, Jan 21 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 22 14:40 EDT 2019. Contains 325222 sequences. (Running on oeis4.)