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

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

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

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

A032690 Numbers k such that k surrounded by digit '9' is a lucky number.

Original entry on oeis.org

7, 13, 24, 33, 34, 39, 40, 42, 54, 64, 78, 97, 99, 103, 105, 108, 112, 123, 126, 127, 129, 132, 133, 139, 142, 147, 150, 163, 172, 177, 205, 217, 219, 223, 229, 237, 240, 255, 256, 258, 259, 265, 268, 270, 273, 274, 277, 282, 286, 292, 309, 312, 313, 316
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Crossrefs

A032735 Palindromes that cannot be prefixed and followed by any digit to form a prime.

Original entry on oeis.org

11111, 60806, 65356, 1115111, 1392931, 1643461, 1762671, 1797971, 1799971, 1863681, 1911191, 2005002, 2190912, 2429242, 2499942, 2512152, 2708072, 2714172, 2794972, 2845482, 2848482, 2942492, 2993992, 3150513, 3239323
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Examples

			11111 prefixed and followed with a digit from (1,2,3,4,5,6,7,8,9) never yields a prime: '2'11111'3' = 29 x 72797.
		

Crossrefs

A032736 a(n) cannot be prefixed or followed by any digit to form a prime ('empty' prefixes allowed).

Original entry on oeis.org

14612, 27971, 29289, 33170, 36186, 38327, 39608, 40078, 41165, 41528, 43277, 44657, 47382, 55553, 55791, 58899, 60806, 62318, 63056, 65970, 66818, 70558, 73851, 80477, 81167, 83986, 86145, 89072, 89280, 90379, 91538, 93160, 96222
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Examples

			60806 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: '_'60806'3' = 43 x 79 x 179; '1'14612'3' = 3^3 x 11 x 17 x 227.
		

Crossrefs

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024

A032738 a(n) cannot be prefixed or followed by any digit to form a prime ('empty' prefixes and suffixes are allowed).

Original entry on oeis.org

14612, 27971, 33170, 36186, 39608, 40078, 41165, 41528, 47382, 55553, 60806, 62318, 63056, 65970, 66818, 70558, 83986, 86145, 89072, 89280, 91538, 93160, 96222, 97908, 101532, 102852, 104609, 105275, 108312, 108615, 108792, 109934
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Comments

a(n) itself cannot be a prime to start with.

Examples

			104609 prefixed or followed by a digit from ('',1,2,3,4,5,6,7,8,9) never yields a prime: '_'104609'_' = 73 x 1433; '8'104609'3' = 3089 x 26237.
		

Crossrefs

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024
Showing 1-8 of 8 results.