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-10 of 14 results. Next

A099677 Primes arising in A032682.

Original entry on oeis.org

11, 131, 151, 181, 191, 1151, 1171, 1181, 1201, 1231, 1291, 1301, 1321, 1361, 1381, 1451, 1471, 1481, 1511, 1531, 1571, 1601, 1621, 1721, 1741, 1801, 1811, 1831, 1861, 1871, 1901, 1931, 1951, 11071, 11131, 11161, 11171, 11251, 11261, 11311, 11321, 11351, 11411
Offset: 1

Views

Author

N. J. A. Sloane, Nov 19 2004

Keywords

Crossrefs

Cf. A032682.

Programs

  • Maple
    t0:=[]; u0:=[]; for n from 1 to 100 do t1:=cat(1,n,1); t1:=convert(t1,decimal,10); if isprime(t1) then t0:=[op(t0),n]; u0:=[op(u0),t1]; fi; od: u0;

A032702 Numbers k such that k prefixed by '2' and followed by '1' is prime.

Original entry on oeis.org

1, 4, 5, 7, 8, 11, 13, 14, 16, 22, 25, 28, 31, 34, 35, 37, 38, 41, 44, 52, 53, 55, 59, 62, 67, 71, 73, 74, 79, 80, 85, 86, 97, 100, 101, 103, 106, 110, 112, 119, 121, 122, 134, 139, 140, 148, 149, 152, 160, 161, 166, 170, 175, 182, 184, 185, 187, 188, 191, 196
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Crossrefs

Extensions

Offset changed by Andrew Howroyd, Aug 11 2024

A032685 Numbers k such that k surrounded by digit '9' is a prime.

Original entry on oeis.org

1, 2, 10, 19, 20, 23, 31, 34, 41, 43, 47, 53, 61, 62, 64, 67, 68, 71, 73, 74, 76, 82, 83, 85, 92, 94, 100, 101, 107, 109, 112, 113, 115, 119, 122, 124, 130, 136, 145, 149, 152, 163, 190, 193, 196, 200, 211, 217, 218, 221, 226, 236, 239, 241, 245
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[300],PrimeQ[FromDigits[Join[{9},IntegerDigits[#],{9}]]]&] (* Harvey P. Dale, Jul 20 2012 *)
  • Python
    from sympy import isprime
    def ok(n): return isprime(int('9' + str(n) + '9'))
    print([k for k in range(250) if ok(k)]) # Michael S. Branicky, Sep 04 2022

A032734 All 81 combinations of prefixing and following a(n) by a single digit are nonprime.

Original entry on oeis.org

2437, 5620, 7358, 11111, 13308, 13332, 13650, 14612, 19737, 19817, 24217, 25213, 26302, 27971, 28472, 28838, 29289, 29542, 29650, 31328, 33027, 33170, 35914, 35970, 36186, 37977, 38327, 39127, 39608, 40078, 41165, 41528, 42422, 43277, 44657, 45649, 47172, 47382
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Examples

			2437 prefixed and followed with a pair of digits from (1,2,3,4,5,6,7,8,9) never yields a prime, e.g., '9'2437'1' = 7 * 37 * 43 * 83.
		

Crossrefs

Programs

  • Maple
    isA032734 := proc(n)
            for k from 1 to 9 do
            for k2 from 1 to 9 do
                    dgs := [k,op(convert(n,base,10)),k2] ;
                    dgsn := add( op(i,dgs)*10^(i-1),i=1..nops(dgs)) ;
                    if isprime(dgsn) then
                            return false;
                    end if;
            end do:
            end do:
            return true;
    end proc:
    for n from 1 to 50000 do
            if isA032734(n) then
                    printf("%d,",n);
            end if;
    end do: # R. J. Mathar, Oct 22 2011
    filter:= proc(n) local d,i,j;
         d:= 10^(ilog10(n)+2);
         not ormap(isprime,[seq(seq(d*i+10*n+j,j=[1,3,5,7,9]),i=1..9)])
    end proc:
    select(filter,[$1..10^5]); # Robert Israel, Jul 07 2016
  • Mathematica
    ok[n_] := With[{id = IntegerDigits[n]}, Select[ Flatten[ Table[ FromDigits[ Join[{j}, id, {k}]], {j, 1, 9}, {k, 1, 9}], 1], PrimeQ, 1] == {}]; A032734 = {}; n = 1; While[n < 50000, If[ok[n], Print[n]; AppendTo[A032734, n]]; n++]; A032734(* Jean-François Alcover, Nov 23 2011 *)
    Select[Range[50000],NoneTrue[Flatten[Table[FromDigits[Join[{x}, IntegerDigits[ #],{y}]],{x,9},{y,9}]],PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 07 2018 *)
  • PARI
    is_A032734(n)=p=10^#Str(n*=10);forstep(k=n+p,n+9*p,p,nextprime(k)>k+9 || return);1 \\ M. F. Hasler, Oct 22 2011
    
  • Python
    from sympy import isprime
    def ok(n):
        s, fdigs, edigs = str(n), "123456789", "1379"
        return not any(isprime(int(f+s+e)) for f in fdigs for e in edigs)
    print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Sep 05 2022

A032683 Numbers k such that k surrounded by digit '3' is a prime.

Original entry on oeis.org

1, 5, 7, 8, 16, 20, 25, 31, 32, 34, 37, 41, 43, 46, 53, 58, 59, 61, 62, 64, 67, 73, 79, 80, 82, 83, 85, 86, 92, 94, 101, 103, 106, 112, 115, 118, 119, 122, 125, 133, 139, 151, 154, 157, 158, 164, 166, 172, 179, 187, 188, 196, 197, 200, 206, 208, 214, 217
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[250],PrimeQ[FromDigits[Join[{3},IntegerDigits[#],{3}]]]&] (* Harvey P. Dale, Apr 18 2012 *)
  • Python
    from sympy import isprime
    def ok(n): return isprime(int('3' + str(n) + '3'))
    print([k for k in range(220) if ok(k)]) # Michael S. Branicky, Sep 04 2022

A059694 Primes p such that 1p1, 3p3, 7p7 and 9p9 are all primes.

Original entry on oeis.org

53, 2477, 4547, 5009, 7499, 8831, 9839, 11027, 24821, 26393, 29921, 36833, 46073, 46769, 47711, 49307, 53069, 59621, 64283, 66041, 79901, 84017, 93263, 115679, 133103, 151121, 169523, 197651, 207017, 236807, 239231, 255191, 259949, 265271, 270071, 300431, 330047
Offset: 1

Views

Author

Patrick De Geest, Feb 07 2001

Keywords

Comments

All terms == 1 (mod 6). The sequence is apparently infinite. There are 16486 terms up to 10^9. - Zak Seidov, Jan 17 2014
Intersection of A069687, A069688, A069689, and A069690. - Zak Seidov, Jan 17 2014

Examples

			53 is a term because 1531, 3533, 7537 and 9539 are primes.
		

Crossrefs

Programs

  • Python
    from sympy import isprime, nextprime
    from itertools import islice
    def agen(): # generator of terms
        p = 2
        while True:
            sp = str(p)
            if all(isprime(int(d+sp+d)) for d in "1379"):
                yield p
            p = nextprime(p)
    print(list(islice(agen(), 40))) # Michael S. Branicky, Feb 23 2023

A059693 Palindromes n such that 1n1, 3n3, 7n7 and 9n9 are all primes.

Original entry on oeis.org

8179718, 8615168, 209484902, 303272303, 342272243, 354050453, 378707873, 533373335, 631363136, 661525166, 668787866, 792545297, 807989708, 964666469, 12792529721, 14435153441, 17755355771, 20160806102, 20175857102
Offset: 1

Views

Author

Patrick De Geest, Feb 07 2001

Keywords

Examples

			8179718 is ok because 181797181, 381797183, 781797187 and 981797189 are primes.
		

Crossrefs

A032737 Composite numbers k such that all the decimal concatenations ik and ikj (i, j = 1...9) are also composite.

Original entry on oeis.org

5620, 7358, 13308, 13332, 13650, 14612, 26302, 27971, 28472, 28838, 29542, 29650, 31328, 33027, 33170, 35914, 35970, 36186, 39608, 40078, 41165, 41528, 42422, 47172, 47382, 48046, 48052, 48454, 50774, 52735, 55553, 60222, 60806
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Comments

The old definition was that a(n) must be composite and "cannot be prefixed or followed by any digit to form a prime ('empty' suffixes are allowed)".

Examples

			55553 prefixed with a digit from (1,2,3,4,5,6,7,8,9) and followed by a digit from ('',1,3,7,9) never yields a prime: '3'55553'_' = 11 x 32323; '2'5620'9' = 3 x 41 x 2083.
		

Crossrefs

Programs

  • Maple
    # Naive program to test for membership -  N. J. A. Sloane, Jan 01 2025:
    isA032737 := proc(x) local S,y,L1,L2,i,j;
    L1:=[seq(i,i=1..9)]; L2:=[1,3,7,9];
    S:=[x];
    for i in L1 do y:=parse(cat(i,x)); S:=[op(S),y]; od:
    for i in L1 do for j in L2 do y:=parse(cat(i,x,j)); S:=[op(S),y]; od: od:
    for i in S do if isprime(i) then return('false', i,"is prime"); break; fi; od:
    'true';
    end;
  • Mathematica
    pfdQ[n_]:=CompositeQ[n]&&NoneTrue[Flatten[Table[10(d1*10^IntegerLength[n]+n)+d2,{d1,Range[9]},{d2,{1,3,7,9}}]],PrimeQ] && NoneTrue[ Flatten[Table[d1*10^IntegerLength[n]+n,{d1,Range[9]}]],PrimeQ]; Select[Range[61000],pfdQ] (* Harvey P. Dale, Jan 01 2025 *)

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024
Definition revised by N. J. A. Sloane, Jan 01 2025
Terms corrected and extended by Harvey P. Dale, Jan 01 2025

A059677 Numbers n such that 1n1, 3n3, 7n7 and 9n9 are all primes.

Original entry on oeis.org

20, 53, 341, 536, 2312, 2477, 3380, 3665, 3686, 4547, 5009, 5105, 6458, 6488, 6731, 6845, 7499, 7508, 7562, 7835, 8411, 8831, 9032, 9386, 9764, 9839, 11027, 11885, 14990, 19589, 20498, 21080, 22844, 24821, 25220, 26393, 27593, 29864, 29921
Offset: 1

Views

Author

Harvey P. Dale, Feb 05 2001

Keywords

Examples

			2312 is a term because 123121, 323123, 723127 and 923129 are all primes.
		

Crossrefs

Programs

  • Mathematica
    Select[ Range[ 30000 ], PrimeQ[ ToExpression[ StringInsert[ ToString[ # ], "1", {1, -1} ] ] ] && PrimeQ[ ToExpression[ StringInsert[ ToString[ # ], "3", {1, -1} ] ] ] && PrimeQ[ ToExpression[ StringInsert[ ToString[ # ], "7", {1, -1} ] ] ] && PrimeQ[ ToExpression[ StringInsert[ ToString[ # ], "9", {1, -1} ] ] ] & ]
    enclose[n_]:=Table[FromDigits[Join[{i},IntegerDigits[n],{i}]],{i, {1,3,7,9}}]; Select[Range[30000],AllTrue[enclose[#],PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 21 2015 *)

Extensions

More terms from Patrick De Geest, Feb 07 2001

A032686 Numbers k such that k surrounded by digit '1' is a lucky number.

Original entry on oeis.org

1, 4, 5, 7, 10, 20, 23, 25, 26, 28, 29, 40, 44, 47, 49, 50, 61, 64, 70, 71, 73, 77, 80, 83, 92, 94, 101, 109, 118, 130, 134, 137, 139, 149, 152, 154, 158, 164, 172, 173, 178, 181, 191, 196, 199, 212, 214, 215, 220, 230, 232, 239, 241, 248, 262, 263
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Crossrefs

Showing 1-10 of 14 results. Next