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.

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

This page as a plain text file.
%I A266141 #25 Mar 02 2019 21:03:09
%S A266141 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,
%T A266141 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,
%U A266141 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
%N A266141 Number of n-digit primes in which n-1 of the digits are 2's.
%C A266141 The leading digits must be 2's and only the trailing digit can vary.
%C A266141 For n large a(n) is usually zero.
%C A266141 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
%H A266141 Dana Jacobsen, <a href="/A266141/b266141.txt">Table of n, a(n) for n = 1..10000</a> (first 1500 terms from Michael De Vlieger and Robert G. Wilson v)
%e A266141 a(3) = 3 since 223, 227 and 229 are all primes.
%t A266141 d = 2; Array[Length@ Select[d (10^# - 1)/9 + (Range[0, 9] - d), PrimeQ] &, 100]
%o A266141 (Python)
%o A266141 from sympy import isprime
%o A266141 def A266141(n):
%o A266141     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
%o A266141 (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
%Y A266141 Cf. A265733, A266142, A266143, A266144, A266145, A266146, A266147, A266148, A266149, A084832, A096506, A099409, A099410.
%K A266141 base,nonn
%O A266141 1,1
%A A266141 _Michael De Vlieger_ and _Robert G. Wilson v_, Dec 21 2015