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-2 of 2 results.

A266147 Number of n-digit primes in which n-1 of the digits are 8's.

Original entry on oeis.org

4, 2, 3, 1, 1, 1, 0, 1, 2, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Keywords

Comments

The leading digits must be 8's and only the trailing digit can vary.
For n large a(n) is usually zero.

Examples

			a(3) = 3 since 881, 883, and 887 are all primes.
		

Crossrefs

Programs

  • Mathematica
    d = 8; Array[Length@ Select[d (10^# - 1)/9 + (Range[0, 9] - d), PrimeQ] &, 100]
    Join[{4},Table[Count[Table[10FromDigits[PadRight[{},k,8]]+n,{n,{1,3,7,9}}], ?PrimeQ],{k,110}]] (* _Harvey P. Dale, Jun 22 2021 *)
  • Python
    from _future_ import division
    from sympy import isprime
    def A266147(n):
        return 4 if n==1 else sum(1 for d in [-7,-5,-1,1] if isprime(8*(10**n-1)//9+d)) # Chai Wah Wu, Dec 27 2015

A056664 Numbers k such that 80*R_k + 1 is prime, where R_k = 11...1 is the repunit (A002275) of length k.

Original entry on oeis.org

2, 18, 78, 138, 222, 462, 543, 1095, 1418, 3246, 3876, 4416, 9506, 11090, 14601, 27810, 29187
Offset: 1

Views

Author

Robert G. Wilson v, Aug 09 2000

Keywords

Comments

Also numbers k such that (8*10^(k+1) - 71)/9 is prime.
There are no other terms <= 2500. - Rick L. Shepherd, Mar 02 2004
a(18) > 10^5. - Robert Price, Nov 01 2014

Crossrefs

Cf. A002275, A092675 (corresponding primes), A099421.

Programs

  • Mathematica
    Do[ If[ PrimeQ[ 80*(10^n - 1)/9 + 1 ], Print[n]], {n, 15000}]

Formula

a(n) = A099421(n+1) - 1. - Robert Price, Nov 01 2014

Extensions

a(9) (giving a probable prime) from Rick L. Shepherd, Mar 02 2004
a(10)-a(15) from N. J. A. Sloane, Feb 20 2005
a(16)-a(17) derived from A099421 by Robert Price, Nov 01 2014
Showing 1-2 of 2 results.