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.

A266141 Number of n-digit primes in which n-1 of the digits are 2's.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The leading digits must be 2's and only the trailing digit can vary.
For n large a(n) is usually zero.
a(n) <= 4. If n > 1 and not a multiple of 3, then a(n) <= 2. It appears that a(n) <= 1 for n > 3. - Chai Wah Wu, Dec 26 2015

Examples

			a(3) = 3 since 223, 227 and 229 are all primes.
		

Crossrefs

Programs

  • Mathematica
    d = 2; Array[Length@ Select[d (10^# - 1)/9 + (Range[0, 9] - d), PrimeQ] &, 100]
  • Perl
    use ntheory ":all"; sub a266141 { my $n=shift; return 4 if $n==1; 0+scalar(grep{is_prime("2"x($n-1).$)} 1,3,7,9); } say a266141($) for 1..20; # Dana Jacobsen, Dec 27 2015
  • Python
    from sympy import isprime
    def A266141(n):
        return 4 if n==1 else sum(1 for d in '1379' if isprime(int('2'*(n-1)+d))) # Chai Wah Wu, Dec 26 2015
    

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

Original entry on oeis.org

0, 2, 8, 14, 27, 63, 1167, 1694, 2361, 116619
Offset: 1

Views

Author

Robert G. Wilson v, Aug 10 2000

Keywords

Comments

Also numbers k such that (2*10^(k+1)+43)/9 is prime.

Crossrefs

Programs

  • Mathematica
    Do[ If[ PrimeQ[20*(10^n - 1)/9 + 7], Print[n]], {n, 0, 5000}]
    Flatten[Position[Table[FromDigits[PadLeft[{7},n,2]],{n,5000}], ?PrimeQ]]-1 (* _Harvey P. Dale, May 01 2012 *)
    Select[Range[0, 2500], PrimeQ[20*(10^n - 1)/9 + 7]&] (* Mikk Heidemaa, Nov 28 2015 *)

Formula

a(n) = A099409(n+1) - 1. - Robert Price, Jan 30 2015

Extensions

a(10) from Kamada link entered by Michael S. Branicky, Jan 14 2023

A093167 Primes of the form 20*R_k + 7, where R_k is the repunit (A002275) of length k.

Original entry on oeis.org

7, 227, 222222227, 222222222222227, 2222222222222222222222222227, 2222222222222222222222222222222222222222222222222222222222222227
Offset: 1

Views

Author

Rick L. Shepherd, Mar 26 2004

Keywords

Crossrefs

Cf. A002275, A056677 (corresponding k and count of digits 2 in a(n)), A099409.

Programs

  • Mathematica
    Select[FromDigits /@ NestList["2" <> # &, "7", 10^3], PrimeQ] (* Mikk Heidemaa, Nov 18 2015 *)
  • PARI
    list(lim)=for(i=0,lim,m=20*(10^i-1)/9 + 7;if(isprime(m),print1(m," ,"))) \\ Anders Hellström, Nov 18 2015
Showing 1-3 of 3 results.