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

A241019 a(n) is the smallest j such that the n-digit number consisting of a 1 in position j and 3's in the other n-1 positions is a prime, or 0 if no such prime exists.

Original entry on oeis.org

1, 2, 3, 2, 2, 4, 2, 6, 5, 5, 5, 0, 3, 8, 1, 11, 7, 6, 4, 5, 11, 5, 0, 0, 9, 11, 0, 5, 5, 0, 4, 5, 17, 19, 19, 6, 0, 3, 9, 35, 1, 27, 24, 32, 0, 36, 14, 11, 34, 14, 22, 0, 17, 53, 0, 47, 11, 0, 16, 3, 0, 15, 0, 39, 22, 40, 27, 39, 0, 19, 2, 19, 48, 2, 43, 19
Offset: 2

Views

Author

Michel Lagneau, Apr 15 2014

Keywords

Comments

Previous name: Let x(1)x(2)... x(n) denote the decimal expansion of a number p having an index j such that x(j) = 1 and x(i) = 3 for i <> j. The sequence lists the smallest index j such that p is prime, or 0 if no such prime exists.
Except 0, the corresponding primes are 13, 313, 3313, 31333, 313333, 3331333, 31333333, 333331333, 3333133333, 33331333333, 333313333333, 0, 33133333333333, ... .

Crossrefs

Programs

  • Maple
    with(numtheory):nn:=80:T:=array(1..nn):
       for n from 2 to nn do:
         for i from 1 to n do:
         T[i]:=3:
         od:
           ii:=0:
           for j from 1 to n while(ii=0)do:
           T[j]:=1:s:=sum('T[i]*10^(n-i)', 'i'=1..n):
             if type(s,prime)=true
             then
             ii:=1: printf(`%d, `,j):
             else
             T[j]:=3:
             fi:
             od:
              if ii=0
               then
               printf(`%d, `,0):
               else
              fi:
           od:
  • Python
    from sympy import isprime
    def a(n):
        base = (10**n-1)//9*3
        for j in range(1, n+1):
            t = base - 2*10**(n-j)
            if isprime(t):
                return j
        return 0
    print([a(n) for n in range(2, 78)]) # Michael S. Branicky, Jun 02 2024

Extensions

Name simplified and offset corrected by Michael S. Branicky, Jun 02 2024

A241020 a(n) is the smallest j such that the n-digit number consisting of a 1 in position j and 7's in the other n-1 positions is a prime, or 0 if no such prime exists.

Original entry on oeis.org

1, 0, 1, 2, 0, 0, 6, 0, 1, 2, 0, 2, 1, 0, 3, 0, 0, 5, 2, 0, 6, 4, 0, 7, 4, 0, 12, 0, 0, 19, 8, 0, 26, 5, 0, 0, 33, 0, 6, 11, 0, 1, 23, 0, 18, 34, 0, 15, 0, 0, 1, 22, 0, 1, 50, 0, 32, 15, 0, 15, 25, 0, 21, 10, 0, 29, 47, 0, 0, 11, 0, 56, 14, 0, 2, 0, 0, 54, 3
Offset: 2

Views

Author

Michel Lagneau, Apr 15 2014

Keywords

Comments

Previous name: Let x(1)x(2)... x(n) denote the decimal expansion of a number p having an index j such that x(j) = 1 and x(i) = 7 for i <> j. The sequence lists the smallest index j such that p is prime, or 0 if no such prime exists.
Except 0, the corresponding primes are 17, 0, 1777, 71777, 0, 0, 77777177, 0, 1777777777, 71777777777, 0, 7177777777777, 17777777777777, 0, 7717777777777777, 0, 0, 7777177777777777777, ... .

Crossrefs

Programs

  • Maple
    with(numtheory):nn:=80:T:=array(1..nn):
       for n from 2 to nn do:
         for i from 1 to n do:
         T[i]:=7:
         od:
           ii:=0:
           for j from 1 to n while(ii=0)do:
           T[j]:=1:s:=sum('T[i]*10^(n-i)', 'i'=1..n):
             if type(s,prime)=true
             then
             ii:=1: printf(`%d, `,j):
             else
             T[j]:=7:
             fi:
             od:
              if ii=0
               then
               printf(`%d, `,0):
               else
              fi:
           od:
  • Mathematica
    Flatten[Position[IntegerDigits[#],1]&/@Table[Select[FromDigits/@Permutations[ Join[ {1},PadRight[ {},n,7]]],PrimeQ]/.{}->{0,0},{n,80}][[;;,1]]/.{}->0] (* Harvey P. Dale, Jul 21 2024 *)
  • Python
    from sympy import isprime
    def a(n):
        if (1+7*(n-1))%3 == 0:
            return 0
        base = (10**n-1)//9*7
        for j in range(1, n+1):
            t = base - 6*10**(n-j)
            if isprime(t):
                return j
        return 0
    print([a(n) for n in range(2, 81)]) # Michael S. Branicky, Jun 02 2024

Formula

a(n) = 0 when 7*(n-1) + 1 mod 3 = 0. - Michael S. Branicky, Jun 02 2024

Extensions

Name simplified by Michael S. Branicky, Jun 02 2024

A241022 Smallest prime numbers p of length n having a decimal expansion x(1)x(2)... x(n) such that there exists an index j where x(j) = 1 and x(i) = 3 for i<>j, or 0 if no such prime exists.

Original entry on oeis.org

13, 313, 3313, 31333, 313333, 3331333, 31333333, 333331333, 3333133333, 33331333333, 333313333333, 0, 33133333333333, 333333313333333, 1333333333333333, 33333333331333333, 333333133333333333, 3333313333333333333, 33313333333333333333, 333313333333333333333
Offset: 2

Views

Author

Michel Lagneau, Apr 15 2014

Keywords

Comments

The corresponding index of the decimal digit 1 are 1, 2, 3, 2, 2, 4, 2, 6, 5, 5, 5, 0, 3, 8, 1, 11, 7, 6, 4, 5,...(A241019).

Crossrefs

Programs

  • Maple
    with(numtheory):nn:=80:T:=array(1..nn):
       for n from 2 to nn do:
         for i from 1 to n do:
         T[i]:=3:
         od:
           ii:=0:
           for j from 1 to n while(ii=0)do:
           T[j]:=1:s:=sum('T[i]*10^(n-i)', 'i'=1..n):
             if type(s,prime)=true
             then
             ii:=1: printf(`%d, `,s):
             else
             T[j]:=3:
             fi:
           od:
              if ii=0
               then
               printf(`%d, `,0):
               else
              fi:
         od:

A241021 Smallest prime numbers p of length n having a decimal expansion x(1)x(2)... x(n) such that there exists an index j where x(j) = 1 and x(i) = 9 for i<>j, or 0 if no such prime exists.

Original entry on oeis.org

19, 199, 1999, 99991, 199999, 9999991, 19999999, 0, 9199999999, 99999199999, 991999999999, 9919999999999, 99999999991999, 919999999999999, 9999999999999199, 99919999999999999, 0, 9991999999999999999, 99999199999999999999, 0, 9991999999999999999999
Offset: 2

Views

Author

Michel Lagneau, Apr 15 2014

Keywords

Comments

The corresponding indices of the decimal digit 1 are 1, 1, 1, 5, 1, 7, 1, 0, 2, 6, 3, 3, 11, 2, 14, 4, 0, 4, 6, 0, 4, ... (A241018).

Crossrefs

Programs

  • Maple
    with(numtheory):nn:=80:T:=array(1..nn):
       for n from 2 to nn do:
         for i from 1 to n do:
         T[i]:=9:
         od:
           ii:=0:
           for j from 1 to n while(ii=0)do:
           T[j]:=1:s:=sum('T[i]*10^(n-i)', 'i'=1..n):
             if type(s,prime)=true
             then
             ii:=1: printf(`%d, `,s):
             else
             T[j]:=9:
             fi:
             od:
              if ii=0
               then
               printf(`%d, `,0):
               else
              fi:
         od:
  • Mathematica
    Table[SelectFirst[FromDigits/@Table[Insert[PadRight[{},k,9],1,n],{n,k+1}],PrimeQ],{k,30}]/.Missing["NotFound"]->0 (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 10 2017 *)

A241027 Smallest prime numbers p of length n having a decimal expansion x(1)x(2)... x(n) such that there exists an index j where x(j) = 1 and x(i) = 7 for i<>j, or 0 if no such prime exists.

Original entry on oeis.org

17, 0, 1777, 71777, 0, 0, 77777177, 0, 1777777777, 71777777777, 0, 7177777777777, 17777777777777, 0, 7717777777777777, 0, 0, 7777177777777777777, 71777777777777777777, 0, 7777717777777777777777, 77717777777777777777777, 0, 7777771777777777777777777
Offset: 2

Views

Author

Michel Lagneau, Apr 15 2014

Keywords

Comments

The corresponding index of the decimal digit 1 are 1, 0, 1, 2, 0, 0, 6, 0, 1, 2, 0, 2, 1, 0, 3, 0, 0, 5, 2,...(A241020).

Crossrefs

Programs

  • Maple
    with(numtheory):nn:=80:T:=array(1..nn):
       for n from 2 to nn do:
         for i from 1 to n do:
         T[i]:=7:
         od:
           ii:=0:
           for j from 1 to n while(ii=0)do:
           T[j]:=1:s:=sum('T[i]*10^(n-i)', 'i'=1..n):
             if type(s,prime)=true
             then
             ii:=1: printf(`%d, `,s):
             else
             T[j]:=7:
             fi:
           od:
              if ii=0
               then
               printf(`%d, `,0):
               else
              fi:
         od:

A373351 Numbers k such that there are no primes among the k-digit numbers consisting of one 1 and all other digits 9.

Original entry on oeis.org

1, 9, 18, 21, 34, 35, 36, 39, 49, 62, 63, 69, 70, 73, 78, 80, 86, 93, 99, 102, 116, 122, 123, 141, 142, 143, 146, 147, 150, 178, 182, 185, 201, 206, 223, 230, 236, 238, 241, 246, 251, 267, 279, 285, 292, 293, 304, 309, 313, 321, 326, 329, 343, 346, 347, 350, 355, 362, 375, 380, 381, 385, 389, 398
Offset: 1

Views

Author

Robert Israel, Jun 01 2024

Keywords

Comments

Besides 1, numbers k such that A241018(k) = 0.

Examples

			a(2) = 9 is a term because none of the numbers 199999999, 9199999999, ..., 999999991 are prime.
		

Crossrefs

Cf. A241018.

Programs

  • Maple
    filter:= proc(n) local a,j;
    a:= 10^n-1;
    not ormap(j -> isprime(a-8*10^j), [$0..n-1])
    end proc:
    select(filter, [$1..400]);
Showing 1-6 of 6 results.