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.

A332118 a(n) = (10^(2n+1) - 1)/9 + 7*10^n.

Original entry on oeis.org

8, 181, 11811, 1118111, 111181111, 11111811111, 1111118111111, 111111181111111, 11111111811111111, 1111111118111111111, 111111111181111111111, 11111111111811111111111, 1111111111118111111111111, 111111111111181111111111111, 11111111111111811111111111111, 1111111111111118111111111111111
Offset: 0

Views

Author

M. F. Hasler, Feb 09 2020

Keywords

Comments

See A107648 = {1, 4, 6, 7, 384, 666, ...} for the indices of primes.

Crossrefs

Cf. (A077791-1)/2 = A107648: indices of primes.
Cf. A002275 (repunits R_n = (10^n-1)/9), A011557 (10^n).
Cf. A138148 (cyclops numbers with binary digits), A002113 (palindromes), A077798 (palindromic wing primes), A088281 (primes 1..1x1..1), A068160 (smallest of given length), A053701 (vertically symmetric numbers).
Cf. A332128 .. A332178, A181965 (variants with different repeated digit 2, ..., 9).
Cf. A332112 .. A332119 (variants with different middle digit 2, ..., 9).

Programs

  • Maple
    A332118 := n -> (10^(2*n+1)-1)/9+7*10^n;
  • Mathematica
    Array[(10^(2 # + 1)-1)/9 + 7*10^# &, 15, 0]
  • PARI
    apply( {A332118(n)=10^(n*2+1)\9+7*10^n}, [0..15])
    
  • Python
    def A332118(n): return 10**(n*2+1)//9+7*10**n

Formula

a(n) = A138148(n) + 8*10^n = A002275(2n+1) + 7*10^n.
G.f.: (8 - 707*x + 600*x^2)/((1 - x)(1 - 10*x)(1 - 100*x)).
a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3) for n > 2.

A068161 Smallest prime beginning and ending in at least n 3's.

Original entry on oeis.org

3, 33533, 3331333, 3333133333, 333331033333, 33333362333333, 333333313333333, 333333332933333333, 33333333316333333333, 3333333333133333333333, 33333333333733333333333
Offset: 1

Views

Author

Amarnath Murthy, Feb 24 2002

Keywords

Examples

			a(2) = 33533 is a prime that starts with 33 and ends in 33 (two 3's).
		

Crossrefs

Cf. A068160.

Programs

  • Mathematica
    Join[{3},Table[With[{c=PadRight[{},n,3]},Module[{k=1},While[!PrimeQ[FromDigits[Join[c,IntegerDigits[k],c]]],k++];FromDigits[Join[c,IntegerDigits[k],c]]]],{n,2,15}]] (* Harvey P. Dale, Sep 02 2025 *)

Extensions

Corrected and extended by Robert Gerbicz, Sep 06 2002

A366416 a(n) is the first prime that starts and ends with at least n 1's (in base 10).

Original entry on oeis.org

11, 11, 1114111, 111181111, 111110611111, 1111118111111, 111111151111111, 111111110911111111, 1111111111111111111, 1111111111111111111, 1111111111111111111, 1111111111111111111, 1111111111111111111, 1111111111111111111, 1111111111111111111, 1111111111111111111, 1111111111111111111
Offset: 1

Views

Author

Robert Israel, Oct 10 2023

Keywords

Comments

The initial and final strings of 1's are allowed to overlap.
If k is in A004023 and (k+1)/2 <= j <= k, then a(j) = (10^k-1)/9 (unless it is (10^i-1)/9 for some i < k where i is in A004023 and (i+1)/2 <= j <= i).

Examples

			a(3) = 1114111 which is prime and starts and ends with 3 1's.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local x,s,d;
      for d from n to 2*n-1 do
         if isprime((10^d-1)/9) then return (10^d-1)/9 fi
      od;
      s:= (10^n-1)/9;
      for d from n do
        for x from 10^d*s + s by 10^n to 10^d*(s+1) do
          if isprime(x) then return x fi
      od od
    end proc:
    map(f, [$1..20]);
  • Python
    from gmpy2 import is_prime
    def a(n):
        t = (10**n-1)//9
        for d in range(n, 2*n):
            if is_prime(t): return t
            t = 10*t + 1
        suffix = (10**n-1)//9
        d = 2*n
        while True:
            prefix = 10**(d-n)*suffix
            for mid in range(0,10**(d-n),10**n):
                t = prefix + mid + suffix
                if is_prime(t): return t
            d += 1
    print([a(n) for n in range(1,18)]) # Michael S. Branicky, Oct 10 2023

A068162 Smallest prime beginning and ending in at least n 7's.

Original entry on oeis.org

7, 77377, 7772777, 777767777, 77777677777, 7777774777777, 777777727777777, 77777777677777777, 77777777704777777777, 777777777727777777777, 77777777777677777777777, 7777777777772777777777777, 777777777777757777777777777
Offset: 1

Views

Author

Amarnath Murthy, Feb 24 2002

Keywords

Examples

			a(2) = 77377 is a prime that starts with 77 and ends in 77 (two 7's).
		

Crossrefs

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 07 2003
a(1)=7 from Sean A. Irvine, Jan 30 2024

A068163 Smallest prime beginning and ending in at least n 9's.

Original entry on oeis.org

919, 990599, 99901999, 9999049999, 99999199999, 99999901999999, 9999999239999999, 99999999299999999, 9999999992999999999, 9999999999049999999999, 999999999990599999999999, 99999999999904999999999999
Offset: 1

Views

Author

Amarnath Murthy, Feb 24 2002

Keywords

Examples

			a(2) = 990599 is a prime that starts with 99 and ends in 99.
		

Crossrefs

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Mar 31 2003
Showing 1-5 of 5 results.