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

A088282 Palindromic primes in which a single digit is sandwiched between strings of 3's.

Original entry on oeis.org

313, 353, 373, 383, 33533, 3331333, 3337333, 333333313333333, 333333373333333, 333333383333333, 33333333333733333333333, 333333333333373333333333333, 33333333333333333533333333333333333, 33333333333333333733333333333333333
Offset: 1

Views

Author

Amarnath Murthy, Sep 29 2003

Keywords

Comments

a(36) has 1553 digits and is therefore too large to include in the b-file. - Harvey P. Dale, Mar 22 2020

Crossrefs

Programs

  • Mathematica
    Select[FromDigits/@Flatten[Table[Join[PadRight[{},k,3],{n},PadRight[ {},k,3]],{n,0,9},{k,20}],1],PrimeQ]//Sort (* Harvey P. Dale, Mar 22 2020 *)

Extensions

More terms from David Wasserman, Aug 03 2005

A088283 Palindromic primes in which a single digit is sandwiched between strings of 7's.

Original entry on oeis.org

727, 757, 787, 797, 77377, 77477, 77977, 7772777, 7774777, 7778777, 777767777, 77777677777, 7777774777777, 777777727777777, 777777757777777, 77777777677777777, 77777777977777777, 777777777727777777777
Offset: 1

Views

Author

Amarnath Murthy, Sep 29 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Flatten[Table[FromDigits[Flatten[Join[{PadRight[{},n,7], i, PadRight[ {},n,7]}]]],{n,10},{i,0,9}]],PrimeQ] (* Harvey P. Dale, Jun 15 2015 *)

Extensions

More terms from David Wasserman, Aug 03 2005

A088284 Palindromic primes in which a single digit is sandwiched between nonempty strings of 9's.

Original entry on oeis.org

919, 929, 99999199999, 99999999299999999, 9999999992999999999, 999999999999919999999999999, 99999999999999499999999999999, 999999999999999999999949999999999999999999999, 99999999999999999999999999899999999999999999999999999
Offset: 1

Views

Author

Amarnath Murthy, Sep 29 2003

Keywords

Crossrefs

Subsequence of A002385.

Programs

  • Mathematica
    Select[Flatten[Table[FromDigits[Join[PadRight[{},n,9],{d},PadRight[{},n,9]]],{n,30},{d,Range[8]}]],PrimeQ] (* Harvey P. Dale, Mar 17 2023 *)

Extensions

More terms from David Wasserman, Aug 03 2005
Name clarified by Christian Stump, Mar 31 2015

A258372 Smallest nonnegative number k not starting or ending with the digit 1 that forms a prime when it is sandwiched between n ones to the left of k and n ones to the right of k.

Original entry on oeis.org

0, 3, 4, 8, 36, 8, 5, 72, 28, 6, 79, 212, 23, 6, 73, 24, 52, 62, 3, 28, 220, 53, 75, 58, 228, 9, 265, 89, 214, 86, 215, 4, 7, 39, 295, 40, 87, 216, 97, 6, 264, 53, 287, 223, 4, 239, 259, 25, 57, 364, 49, 38, 93, 86, 27, 30, 80, 24, 6, 356, 50, 645, 395, 206
Offset: 1

Views

Author

Felix Fröhlich, May 28 2015

Keywords

Comments

n = 1 is the only case where a(n) = 0, since for any n > 1, A138148(n) is divisible by A002275(n).
No n exists such that a(n) = 2, since any number of the form A100706(n)+A011557(n) is of the form A000533(n)*A002275(n+1) (see comment by Robert Israel in A107123).
a(n) = 3 iff n is in A107123.
a(n) = 4 iff n is in A107124.
If k has an even number of digits and is a multiple of 11, then k is not a term. If k = (10^r+1)(10^m-1)/9 for some m > 0, r >= 0, then k is not a term. If A272232(k) = 0, then k is not a term. - Chai Wah Wu, Nov 08 2019

Examples

			a(1) = 0, because 101 is prime.
a(5) = 36, because the smallest x >= 0 such that 11111_x_11111 (where '_' denotes concatenation) is prime is 36. The decimal expansion of that prime is 111113611111.
		

Crossrefs

Programs

  • Mathematica
    Table[k = 0; s = Table[1, {n}]; While[Or[!PrimeQ[FromDigits[s ~Join~ IntegerDigits[k] ~Join~ s]], Or[First@ IntegerDigits@ k == 1, Last@ IntegerDigits@ k == 1]], k++]; k, {n, 64}] (* Michael De Vlieger, May 28 2015 *)
  • PARI
    a000042(n) = (10^n-1)/9
    a(n) = my(k=0); while(k==10 || k%10==1 || k\(10^(#Str(k)-1))==1 || !ispseudoprime(eval(Str(a000042(n), k, a000042(n)))), k++); k

A046705 Palindromic primes whose product of digits is a prime.

Original entry on oeis.org

2, 3, 5, 7, 131, 151, 11311, 1117111, 111111151111111, 111111111111111111131111111111111111111, 1111111111111111111111111111111117111111111111111111111111111111111, 1111111111111111111111111111111111111111111115111111111111111111111111111111111111111111111
Offset: 1

Views

Author

Keywords

Comments

Except for the first 4 terms, a subsequence of A088281. - Chai Wah Wu, Dec 17 2015
Subsequence of A028842, of A046703, and also of A117058. - Michel Marcus, Dec 18 2015

Crossrefs

Programs

  • Mathematica
    t = Prime[Range[4]]; Union[Select[Flatten[Table[NestList[FromDigits[Flatten[{1, IntegerDigits[#], 1}]] &, n, 45], {n, t}]], PrimeQ]] (* Jayanta Basu, Jun 27 2013 *)
  • Python
    from _future_ import division
    from sympy import isprime
    A046705_list = [n for n in ((10**(2*l+1)-1)//9+d*10**l for l in range(100) for d in [1,2,4,6]) if isprime(n)] # Chai Wah Wu, Dec 17 2015

A345223 a(n) is the smallest k >= 0 such that the decimal concatenation 1 (n times) || k || 1 (n times) is a prime, or -1 if no such k exists.

Original entry on oeis.org

0, 3, 4, 8, 10, 8, 5, 21, 1, 6, 1, 116, 23, 6, 73, 24, 16, 62, 3, 10, 19, 53, 61, 58, 191, 9, 265, 12, 133, 86, 141, 4, 7, 39, 193, 31, 51, 13, 31, 6, 31, 53, 287, 139, 4, 239, 187, 25, 18, 144, 31, 38, 93, 86, 27, 30, 16, 24, 6, 356, 50, 91, 395, 117, 217, 61
Offset: 1

Views

Author

Felix Fröhlich, Jun 11 2021

Keywords

Comments

a(n) = 0 only for n = 1, since A138148(1) = 101 is the only prime in A138148.
a(n) = 1 iff n is of the form (A004023(i)-1)/2 for some i >= 1.
No term equals 2, see second comment in A258372.

Examples

			For n = 3: 1110111, 1111111, 1112111 and 1113111 are all composite, while 1114111 is prime, so the smallest number that can be inserted between strings of three ones so that the concatenation is prime is 4. Therefore a(3) = 4.
		

Crossrefs

Programs

  • Mathematica
    Table[Module[{k=0},While[!PrimeQ[FromDigits[Flatten[Join[{PadRight[ {},n,1],IntegerDigits[ k],PadRight[{},n,1]}]]]],k++];k],{n,70}] (* Harvey P. Dale, Jun 03 2024 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    a(n) = my(v=vector(n, t, 1), d, w=[]); for(k=0, oo, d=digits(k); w=concat(v, d); w=concat(w, v); if(ispseudoprime(eva(w)), return(k)))
    
  • Python
    from sympy import isprime
    def a(n, d=1):
        k, bread = 0, str(d)*n
        while not isprime(int(bread + str(k) + bread)): k += 1
        return k
    print([a(n) for n in range(1, 67)]) # Michael S. Branicky, Jun 11 2021
Showing 1-7 of 7 results.