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-4 of 4 results.

A232210 Let b_k=3...3 consist of k>=1 3's. Then a(n) is the smallest k such that the concatenation prime(n)b_k is prime, or a(n)=0 if there is no such prime.

Original entry on oeis.org

1, 0, 1, 1, 1, 14, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 3, 1, 2, 6, 2, 2, 1, 1, 2, 1, 4, 4, 23, 1, 2, 1, 6, 2, 2, 5, 1, 10, 2, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 2, 4, 2, 1, 1, 1, 2, 4, 1, 2, 5, 4, 2, 3, 1, 1, 5, 4, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 6, 4, 2, 14, 2, 4, 1, 3
Offset: 1

Views

Author

Vladimir Shevelev, Sep 13 2014

Keywords

Comments

Conjecture: for n>=3, a(n)>0.
Records are 1,14,23,50,252,4752,...
The corresponding primes are 2,13,131,653,883,1279,...
These primes beginning with the second one we call "stubborn primes".
Counter-conjecture: a(2889)=0. - Hans Havermann, Oct 15 2014
If a(n)=1, then the resulting primes are in A092993 and form A055782; if a(n)=2, then they form sequence 4133,4733,5333,7933,..., etc. - Vladimir Shevelev, Oct 16 2014
If a prime p divides Pb_k, then it also divides Pb_{k+m(p-1)} for all m>=0. This follows from Fermat's little theorem applied to b_x=(10^x-1)/3 with x=p-1. - M. F. Hasler, Oct 20 2014

Examples

			For n=1, start with prime(1)=2 and get already at the first step the prime 23. So a(1)=1.
For n=2, starting with prime(2)=3, one never gets a prime by appending further digits "3", therefore a(2)=0.
For n=3, n=4, n=5, one gets after the first step the primes 53, 73, 113, and therefore a(n)=1.
For n=6, start with prime(6)=13; one has to append 14 "3"s in order to get a new prime, so a(6)=14.
For n=2889, start with prime(2889) = 26293. (Do not mix up with prime(2899) = 26393...!) Appending 2k-1 or 6k-4 or 6k-2 or 18k-6 or 36k-18 or 180k-144 digits "3" yields a number divisible by 11 resp. 7 resp. 13 resp. 19 resp. 101 resp. 31. For 18k-12 and 36k (with k <> 1 (mod 5)) digits "3" there is no simple pattern and both yield sometimes large primes in the factorization, but (so far) always composite numbers 26293...3 (up to several thousand digits). - _M. F. Hasler_, Oct 16 2014
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1, p = Prime@ n}, While[ !PrimeQ[p*10^k + (10^k - 1)/3], k++]; k]; f[2] = 0; Array[f, 100] (* Robert G. Wilson v, Apr 24 2015 *)
    m3[n_]:=Module[{k=10n+3},While[!PrimeQ[k],k=10k+3];IntegerLength[k]-IntegerLength[ n]]; Join[{1,0},m3/@Prime[Range[3,90]]] (* Harvey P. Dale, Feb 11 2018 *)
  • PARI
    a(n) = {if (n==2, return (0)); p = prime(n); k = 1; while (! isprime(p = p*10+3), k++); k;} \\ Michel Marcus, Sep 13 2014

Extensions

More terms from Peter J. C. Moses, Sep 13 2014

A242775 Let b_k=3...3 consist of k>=1 3's. Then a(n) is the smallest k such that the concatenation b_k and prime(n) is prime, or a(n)=0 if there is no such prime.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 4, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 3, 3, 2, 1, 2, 7, 3, 1, 3, 2, 2, 8, 1, 1, 7, 2, 1, 1, 5, 3, 2, 2, 2, 3, 1, 3, 8, 5, 1, 1, 4, 3, 1, 4, 5, 3, 6, 1, 2, 1, 2, 1, 3, 1, 2, 2, 1, 3, 1, 6, 3, 1, 3, 4, 2, 3, 8, 4, 1, 3, 34, 1
Offset: 1

Views

Author

Vladimir Shevelev, Sep 13 2014

Keywords

Comments

Conjecture: for n>=4, a(n)>0.
Records >=1: 1,2,4,7,8,34,... correspond to primes 7,19,41,127,157,443,...

Examples

			For n<=3, a(n) = 0, because 3..32, 3..33 and 3..35 can never be prime, whatever the number of 3's that are concatenated.
For n=4, prime(n)=7, 37 is prime. So a(4)=1.
		

Crossrefs

Programs

  • PARI
    a(n) = {if (n<=3, return (0)); p = prime(n); k = 1; while (! isprime(p = eval(concat("3", Str(p)))), k++); k; } \\ Michel Marcus, Sep 17 2014

Extensions

More terms from Peter J. C. Moses, Sep 14 2014

A247342 Let b_k=3...3 consist of k>=1 3's. Then a(n) is the smallest k such that the odd part (A000265) of concatenation b_k 2^n is prime, or a(n)=0 if there is no such prime.

Original entry on oeis.org

1, 2, 1, 1, 1, 1, 4, 3, 2, 1, 3, 1, 1, 6, 1, 1, 1, 3, 1, 15, 29, 5, 1, 2, 3, 6, 1, 6, 20, 6, 3, 50, 3, 22, 8, 5, 5, 1, 84, 8, 7, 36, 3, 6, 7, 20, 6, 6, 8, 1, 6, 3, 2, 38, 1, 5, 3, 2, 5, 16, 1, 12, 13, 7, 1, 4, 16, 5, 32, 1, 6, 13, 4, 150, 7, 29, 17, 9, 12, 34
Offset: 0

Views

Author

Vladimir Shevelev, Sep 14 2014

Keywords

Comments

Conjecture: for all n, a(n)>0.
a(443) > 17000 if it is not 0.

Examples

			2^0=1 and already 31 is prime. So a(0)=1;
2^1=2, but odd part of 32 is 1 (nonprime); then consider odd part of 332. It is 83 that is prime. So a(1)=2.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local m,d,k,x;
        m:= 2^n;
        d:=ilog10(m);
        for k from 1 do
           x:= (10^k-1)/3*10^(d+1)+m;
           if isprime(x/2^padic:-ordp(x,2)) then return k fi
        od
    end proc:
    map(f, [$0..100]); # Robert Israel, Oct 30 2016
  • PARI
    a(n) = {k = 0; while (! ((val = eval(concat(Str((10^k-1)/3), Str(2^n)))) && isprime(val/2^valuation(val, 2))), k++); k;} \\ Michel Marcus, Sep 15 2014

Extensions

More terms from Michel Marcus, Sep 15 2014

A245657 Primes p for which none of the concatenations p3, p9, 3p, 9p are primes.

Original entry on oeis.org

3, 107, 113, 179, 317, 443, 487, 599, 641, 653, 751, 773, 937, 977, 991, 1021, 1087, 1103, 1187, 1201, 1213, 1217, 1301, 1409, 1427, 1439, 1483, 1553, 1559, 1579, 1609, 1637, 1693, 1747, 1777, 1787, 1789, 1861, 1949, 1987, 1993, 2081, 2129, 2239, 2281, 2287, 2293, 2351, 2393, 2477
Offset: 1

Views

Author

Vladimir Shevelev, Sep 13 2014

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[400]],NoneTrue[{10#+3,10#+9,3*10^IntegerLength[#]+#, 9*10^IntegerLength[ #]+#},PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 06 2020 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, if (!isprime(eval(concat(Str(p), Str(3)))) && ! isprime(eval(concat(Str(p), Str(9)))) && ! isprime(eval(concat(Str(3), Str(p)))) && ! isprime(eval(concat(Str(9), Str(p)))), print1(p, ", ")););} \\ Michel Marcus, Sep 14 2014
    
  • Python
    import sympy
    from sympy import isprime
    from sympy import prime
    for n in range(1,10**3):
      p = str(prime(n))
      if not isprime(int(p+'3')) and not isprime(int(p+'9')) and not isprime(int('3'+p)) and not isprime(int('9'+p)):
        print(int(p),end=', ') # Derek Orr, Sep 16 2014

Extensions

More terms from Derek Orr, Sep 16 2014
Showing 1-4 of 4 results.