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.

A266145 Number of n-digit primes in which n-1 of the digits are 6's.

Original entry on oeis.org

4, 2, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1, 0, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Keywords

Comments

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

Examples

			a(2) = 2 since 61 and 67 are prime.
a(3) = 1 since 661 is the only prime.
		

Crossrefs

Programs

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

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

Original entry on oeis.org

1, 2, 3, 9, 17, 20, 21, 27, 42, 65, 120, 132, 177, 240, 453, 552, 1599, 2174, 2977, 3648, 7707, 8315, 10391, 12457, 21056, 26222, 48296, 64040, 84903, 92975, 95071
Offset: 1

Views

Author

Robert G. Wilson v, Aug 09 2000

Keywords

Comments

Also numbers k such that (2*10^(k+1)-17)/3 is prime.

Crossrefs

Cf. A002275, A092571 (corresponding primes), A098088.

Programs

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

Formula

a(n) = A098088(n) - 1. - Robert Price, Aug 19 2014

Extensions

1599 and 2174 (corresponding to probable primes) from Rick L. Shepherd, Feb 28 2004
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Jan 01 2008
a(23)-a(31) derived from A098088 by Robert Price, Aug 19 2014
Showing 1-2 of 2 results.