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.

A265733 Number of n-digit primes whose digits include at least n-1 digits "1".

Original entry on oeis.org

4, 8, 10, 9, 10, 13, 7, 16, 10, 11, 11, 13, 9, 11, 6, 7, 8, 16, 7, 11, 8, 9, 9, 10, 8, 12, 6, 13, 13, 21, 7, 12, 8, 7, 15, 16, 8, 9, 17, 9, 5, 22, 9, 15, 6, 12, 9, 20, 11, 13, 14, 11, 13, 12, 9, 15, 7, 4, 8, 12, 4, 11, 8, 15, 10, 17, 12, 12, 4, 9, 9, 14, 8, 14, 10, 7, 10, 14, 5, 14
Offset: 1

Views

Author

Keywords

Comments

Inspired by A241100 and its conjecture by Chai Wah Wu of Dec 10 2015.
The average value of a(n) is 10.6, median is 10, and mode is 11 for the first 1000 terms.
The first occurrence of k>0: 433, 361, 229, 1, 41, 15, 7, 2, 4, 3, 10, 26, 6, 51, 35, 8, 39, 180, 84, 48, 30, 42, 306, 138, 948, 642, ..., .
0 < a(n) < 27 for n < 1551.
It appears that a(n)/(9*n + 0^(n-1)) has its maximum at n = 2. - Altug Alkan, Dec 16 2015

Examples

			a(1) = 4 because {2, 3, 5, 7} are primes;
a(2) = 8 because {11, 13, 17, 19, 31, 41, 61, 71} are two digit primes with at least one digit being 1;
a(3) = 10 because {101, 113, 131, 151, 181, 191, 211, 311, 811, 911} are three digit primes with at least two digit being 1, etc.
		

Crossrefs

Programs

  • Maple
    A:= proc(n) local x,X,i,y;
      x:= (10^n-1)/9;
      y:= [x,seq(seq(x+10^i*y,y=1..8),i=0..n-1),seq(x - 10^i,i=0..n-2)];
      nops(select(isprime,y))
    end proc:
    map(A, [$1..100]); # Robert Israel, Dec 31 2015
  • Mathematica
    f1[n_] := Block[{cnt = k = 0, r = (10^n - 1)/9, s = {-1, 1, 2, 3, 4, 5, 6, 7, 8}}, If[ PrimeQ@ r, cnt++]; If[ PrimeQ[(10^(n - 1) - 1)/9], cnt--]; While[k < n, p = Select[r + 10^k*s, PrimeQ]; cnt += Length@ p; k++]; cnt]; Array[f1, 70]

Formula

Number of n-digit primes of the form 111...d...111, where the number of ones is at least n-1 and d is any other decimal digit.