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

A268707 Smallest n-digit prime having at least n-1 digits equal to 9.

Original entry on oeis.org

2, 19, 199, 1999, 49999, 199999, 2999999, 19999999, 799999999, 9199999999, 59999999999, 959999999999, 9919999999999, 59999999999999, 499999999999999, 9299999999999999, 99919999999999999, 994999999999999999, 9991999999999999999, 29999999999999999999
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 0, p = {}, r = (10^n - 1), s = Range@ 10 - 10}, While[k < n - 0, AppendTo[p, Select[r + 10^k*s, PrimeQ]]; k++]; p = Min@ Flatten@ p]; Array[f, 20]
  • PARI
    a(n)=my(t=10^n-1,p); forstep(d=n-1,0,-1, forstep(k=8,1,-1, p=t-10^d*k; if(ispseudoprime(p), return(p)))); -1 \\ Charles R Greathouse IV, Mar 21 2016

A268703 Smallest n-digit prime having at least n-1 digits equal to 3.

Original entry on oeis.org

2, 13, 233, 2333, 23333, 313333, 3233333, 31333333, 333233333, 3233333333, 23333333333, 333313333333, 3333333333383, 33133333333333, 323333333333333, 1333333333333333, 23333333333333333, 333333133333333333, 3333313333333333333, 33313333333333333333
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 0, p = {}, r = (10^n - 1)/3, s = Range@ 10 - 4}, While[k < n, AppendTo[p, Select[r + 10^k*s, PrimeQ]]; k++]; p = Min@ Flatten@ p]; f[1] = 2; f[2] = 13; Array[f, 20]

A268706 Largest n-digit prime having at least n-1 digits equal to 7.

Original entry on oeis.org

7, 97, 977, 7877, 97777, 787777, 7877777, 77777747, 787777777, 8777777777, 79777777777, 777777779777, 7877777777777, 77777779777777, 778777777777777, 8777777777777777, 77797777777777777, 797777777777777777, 7777877777777777777, 97777777777777777777
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n)
      local r,i,j,p;
      r:= 7*(10^n-1)/9;
      for p in sort([r, seq(seq(r + i*10^j, i=[$(-7)..(-1),1,2]),j=0..n-1)],`>`) do
        if isprime(p) then return p fi
      od;
      error("no prime found")
    end proc:
    map(f, [$1..100]); # Robert Israel, Feb 24 2016
  • Mathematica
    f[n_] := Block[{k = 0, p = {}, r = 7 (10^n - 1)/9, s = Range@ 10 - 8}, While[k < n, AppendTo[p, Select[r + 10^k*s, PrimeQ]]; k++]; p = Max@ Flatten@ p]; Array[f, 20]

A268704 Greatest n-digit prime having at least n-1 digits equal to 3.

Original entry on oeis.org

7, 83, 733, 7333, 38333, 733333, 3733333, 83333333, 373333333, 3334333333, 38333333333, 383333333333, 3433333333333, 53333333333333, 383333333333333, 3733333333333333, 43333333333333333, 353333333333333333, 3333334333333333333, 33343333333333333333
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 0, p = {}, r = (10^n - 1)/3, s = Range@ 10 - 4}, While[k < n, AppendTo[p, Select[r + 10^k*s, PrimeQ]]; k++]; p = Max@ Flatten@ p]; Array[f, 20]
    Table[Max[Select[FromDigits/@Flatten[Permutations/@Table[PadRight[{n},k,3],{n,{1,2,4,5,7,8}}],1],IntegerLength[#]==k&&PrimeQ[#]&]],{k,20}] (* Harvey P. Dale, Apr 11 2020 *)

A268705 Smallest n-digit prime having at least n-1 digits equal to 7.

Original entry on oeis.org

2, 17, 277, 1777, 47777, 727777, 7477777, 77767777, 577777777, 1777777777, 67777777777, 377777777777, 7177777777777, 17777777777777, 577777777777777, 2777777777777777, 77777767777777777, 377777777777777777, 2777777777777777777, 71777777777777777777
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 0, p = {}, r = 7(10^n - 1)/9, s = Range@ 10 - 8}, While[k < n, AppendTo[p, Select[r + 10^k*s, PrimeQ]]; k++]; p = Min@ Flatten@ p]; f[1] = 2; f[2] = 17; Array[f, 20]
    Table[Min[Select[FromDigits/@Flatten[Permutations/@Table[Join[ {n},PadRight[ {},k,7]],{n,0,9}],1],IntegerLength[#]==k+1&&PrimeQ[#]&]],{k,0,20}] (* Harvey P. Dale, Jan 23 2021 *)
Showing 1-5 of 5 results.