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.

Previous Showing 21-22 of 22 results.

A309488 Primes whose decimal expansion is of the form d_1+0+d_2+0+d_3+0+...+0+d_k where d_i are digits with 1 <= d_i <= 9, k > 1 and + stands for concatenation.

Original entry on oeis.org

101, 103, 107, 109, 307, 401, 409, 503, 509, 601, 607, 701, 709, 809, 907, 10103, 10301, 10303, 10501, 10601, 10607, 10709, 10903, 10909, 20101, 20107, 20201, 20407, 20507, 20509, 20707, 20807, 20809, 20903, 30103, 30109, 30203, 30307, 30403, 30509, 30703, 30707, 30803, 30809
Offset: 1

Views

Author

Bernard Schott, Aug 04 2019

Keywords

Comments

The terms of this sequence have necessarily an odd number >= 3 of digits.
There is only one term whose digits > 0 are all equal: 101.
The only cyclops primes (A134809) of this sequence are the first 15 terms from 101 to 907.
The first palindromes of this sequence are 101, 10301, 10501, 10601, 30103, 30203, 30403, 30703, 30803, ...
Intersection with A309101 = {503, 10103, 10303, 10903, ...}.

Examples

			103 is the smallest term with two distinct digits > 0.
10607 is the smallest term with three distinct digits > 0.
		

Crossrefs

Subsequence of A059168 (undulating primes).

Programs

  • Magma
    sol:=[]; m:=1; for p in PrimesInInterval(101,50000) do  v:=Reverse(Intseq(p)); test:=0; for u in [1..#v-1] do if u mod 2 eq 0 and v[u] eq 0 and v[u+1] ne 0 then test:=test+1; end if; end for; if test eq (#v-1)/2 then sol[m]:=p; m:=m+1; end if; end for; sol; // Marius A. Burtea, Aug 04 2019
    
  • Mathematica
    aQ[n_] := PrimeQ[n] && OddQ[(m = Length[(d = IntegerDigits[n])])] && Flatten@Position[d, ?(# == 0 &)] == Range[2, m, 2]; Select[Range[100, 31000], aQ] (* _Amiram Eldar, Aug 04 2019 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    f(n) = my(d=digits(n)); eva(vector(2*#d-1, k, if (k%2, d[1+k\2]))) \\ from Michel Marcus
    terms(n) = my(i=0); for(k=10, oo, if(i>=n, break); if(vecmin(digits(k)) > 0, my(iz=f(k)); if(ispseudoprime(iz), print1(iz, ", "); i++)))
    /* Print initial 40 terms as follows: */
    terms(40) \\ Felix Fröhlich, Aug 08 2019

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

Original entry on oeis.org

101, 103, 107, 109, 307, 401, 409, 503, 509, 601, 607, 701, 709, 809, 907, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 11003, 11027, 11047, 11057, 11059, 11069, 11071, 11083, 11087, 11093, 12007, 12011, 12037, 12041, 12043, 12049, 12071, 12073, 12097, 13001, 13003, 13007
Offset: 1

Views

Author

James S. DeArmon, Jun 27 2021

Keywords

Crossrefs

Cf. A000040 (primes), A134809 (Cyclops primes).

Programs

  • Mathematica
    Select[Prime@Range@2000,OddQ[d=Length[s=IntegerDigits[#]]]&&s[[Ceiling[d/2]]]==0&] (* Giorgos Kalogeropoulos, Jul 04 2021 *)
  • PARI
    isok(p) = {if (isprime(p), my(d=digits(p)); (#d % 2) && (d[#d\2+1] == 0););} \\ Michel Marcus, Jun 28 2021
    
  • Perl
    #!/usr/bin/perl
    $str = "";
    foreach $cand (101..20000){  # loop over candidates
        next unless &isPrime($cand);  # is $cand prime? 0/1 result
        @a = split("",$cand);
        next if @a/2 == int @a/2;
        $mid = int @a/2;
        next unless $a[$mid] == 0;
        $str .= "$cand, ";
    }
    chop $str; chop $str;
    print "$str\n";
    
  • Python
    from sympy import isprime
    from itertools import product
    def agen(maxdigits):
        for digits in range(3, maxdigits+1, 2):
            for first in "123456789":
                for left in product("0123456789", repeat=digits//2-1):
                    left = "".join(left)
                    for right in product("0123456789", repeat=digits//2-1):
                        right = "".join(right)
                        for last in "1379":
                            t = int("".join(first + left + "0" + right + last))
                            if isprime(t): yield t
    print([an for an in agen(5)]) # Michael S. Branicky, Jun 28 2021
Previous Showing 21-22 of 22 results.