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.

A345728 Primes with an odd number of digits and 0 as the middle digit.

This page as a plain text file.
%I A345728 #55 Jan 19 2022 23:36:15
%S A345728 101,103,107,109,307,401,409,503,509,601,607,701,709,809,907,10007,
%T A345728 10009,10037,10039,10061,10067,10069,10079,10091,10093,10099,11003,
%U A345728 11027,11047,11057,11059,11069,11071,11083,11087,11093,12007,12011,12037,12041,12043,12049,12071,12073,12097,13001,13003,13007
%N A345728 Primes with an odd number of digits and 0 as the middle digit.
%t A345728 Select[Prime@Range@2000,OddQ[d=Length[s=IntegerDigits[#]]]&&s[[Ceiling[d/2]]]==0&] (* _Giorgos Kalogeropoulos_, Jul 04 2021 *)
%o A345728 (Perl)
%o A345728 #!/usr/bin/perl
%o A345728 $str = "";
%o A345728 foreach $cand (101..20000){  # loop over candidates
%o A345728     next unless &isPrime($cand);  # is $cand prime? 0/1 result
%o A345728     @a = split("",$cand);
%o A345728     next if @a/2 == int @a/2;
%o A345728     $mid = int @a/2;
%o A345728     next unless $a[$mid] == 0;
%o A345728     $str .= "$cand, ";
%o A345728 }
%o A345728 chop $str; chop $str;
%o A345728 print "$str\n";
%o A345728 (PARI) isok(p) = {if (isprime(p), my(d=digits(p)); (#d % 2) && (d[#d\2+1] == 0););} \\ _Michel Marcus_, Jun 28 2021
%o A345728 (Python)
%o A345728 from sympy import isprime
%o A345728 from itertools import product
%o A345728 def agen(maxdigits):
%o A345728     for digits in range(3, maxdigits+1, 2):
%o A345728         for first in "123456789":
%o A345728             for left in product("0123456789", repeat=digits//2-1):
%o A345728                 left = "".join(left)
%o A345728                 for right in product("0123456789", repeat=digits//2-1):
%o A345728                     right = "".join(right)
%o A345728                     for last in "1379":
%o A345728                         t = int("".join(first + left + "0" + right + last))
%o A345728                         if isprime(t): yield t
%o A345728 print([an for an in agen(5)]) # _Michael S. Branicky_, Jun 28 2021
%Y A345728 Cf. A000040 (primes), A134809 (Cyclops primes).
%K A345728 nonn,base
%O A345728 1,1
%A A345728 _James S. DeArmon_, Jun 27 2021