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

A266146 Number of n-digit primes in which n-1 of the digits are 7's.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			a(2) = 8 from 17, 37, 47, 67, 71, 73, 79, 97. - _N. J. A. Sloane_, Dec 27 2015
a(3) = 10 since 277, 577, 677, 727, 757, 773, 787, 797, 877, and 977 are primes.
		

Crossrefs

Programs

  • Mathematica
    f7[n_] := Block[{cnt = k = 0, r = 7 (10^n - 1)/9, s = Range[0, 9] - 7}, While[k < n, cnt += Length@ Select[r + 10^k*s, PrimeQ@ # && IntegerLength@ # > k &]; k++]; cnt]; Array[f7, 100]
  • PARI
    a(n)={sum(i=0, n-1, sum(d=i==n-1, 9, isprime((10^n-1)/9*7 + (d-7)*10^i)))} \\ Andrew Howroyd, Feb 28 2018
    
  • Python
    from _future_ import division
    from sympy import isprime
    def A266146(n):
         return 4*n if (n==1 or n==2) else sum(1 for d in range(-7,3) for i in range(n) if isprime(7*(10**n-1)//9+d*10**i)) # Chai Wah Wu, Dec 27 2015

Extensions

a(2) corrected by Chai Wah Wu, Dec 27 2015
a(2) corrected in b-file as above by Andrew Howroyd, Feb 28 2018

A093176 Primes of the form 70*R_k + 1, where R_k is the repunit (A002275) of length k.

Original entry on oeis.org

71, 7777777777771, 77777777777777777771, 77777777777777777777771, 7777777777777777777777777777771, 7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777771
Offset: 1

Views

Author

Rick L. Shepherd, Mar 27 2004

Keywords

Comments

Primes of the form (7*10^k - 61)/9. - Vincenzo Librandi, Nov 16 2010
The next term (a(7)) has 241 digits. - Harvey P. Dale, Jul 01 2022

Crossrefs

Cf. A002275, A056688 (corresponding k), A099419.

Programs

  • Mathematica
    Select[Table[FromDigits[PadLeft[{1},n,7]],{n,100}],PrimeQ] (* Harvey P. Dale, Jul 01 2022 *)

Formula

a(n) = (70*10^A056688(n) - 61)/9 = (7*10^A099419(n) - 61)/9.

Extensions

Edited by Ray Chandler, Mar 06 2012

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

Original entry on oeis.org

1, 12, 19, 22, 30, 99, 240, 274, 924, 1066, 1368, 2064, 7162, 37962, 91855, 111705, 260197, 271756, 314563, 348723
Offset: 1

Views

Author

Robert G. Wilson v, Aug 10 2000

Keywords

Comments

Also numbers k such that (7*10^(k+1)-61)/9 is prime.

Crossrefs

Programs

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

Formula

a(n) = A099419(n) - 1.

Extensions

a(13) from Kamada link by Herman Jamke (hermanjamke(AT)fastmail.fm), Jan 01 2008
a(14)-a(15) from Erik Branger, Dec 19 2009
a(16) from Erik Branger, Jan 29 2011
a(17) from Erik Branger, Nov 26 2011
a(18) from Erik Branger, Mar 05 2012
a(19)-a(20) from Erik Branger, Sep 23 2016
Showing 1-3 of 3 results.