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
    

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

Original entry on oeis.org

1, 2, 4, 13, 175, 415, 2504, 2758, 7924, 9400, 10390, 12104, 19615
Offset: 1

Views

Author

Robert G. Wilson v, Aug 10 2000

Keywords

Comments

Also numbers k such that (2*10^(k+1)+61)/9 is prime.
a(14) > 10^5. - Robert Price, Nov 01 2014

Crossrefs

Cf. A002275, A093401 (corresponding primes), A099410.

Programs

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

Formula

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

Extensions

Two more terms from Rick L. Shepherd, Mar 30 2004
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Jan 01 2008
a(11)-a(13) derived from A099410 by Robert Price, Nov 01 2014

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

Original entry on oeis.org

29, 229, 22229, 22222222222229
Offset: 1

Views

Author

Rick L. Shepherd, Mar 28 2004

Keywords

Comments

a(5) has 176 digits, a(6) has 416 digits. - Vincenzo Librandi, Dec 10 2010; Bruno Berselli, Jul 17 2012

Crossrefs

Cf. A002275, A056678 (corresponding k), A099410.
Showing 1-3 of 3 results.