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.

Previous Showing 51-60 of 288 results. Next

A383816 Palindromic primes which satisfy the requirements of A380943 in at least two ways.

Original entry on oeis.org

373, 1793971, 7933397, 374636473, 714707417, 727939727, 787333787, 790585097, 947939749, 991999199, 10253935201, 11365556311, 11932823911, 13127372131, 34390609343, 35369996353, 35381318353, 36297179263, 37018281073, 37423332473, 37773537773, 38233333283, 38914541983, 39064546093
Offset: 1

Views

Author

Keywords

Comments

Terms of A380943 are primes whose decimal representation is the concatenation of primes p and q such that the concatenation of q and p also forms a prime.

Examples

			The palindromic prime 373 meets the requirements of A380943 in two ways: the concatenation of 3 and 37 forms the prime 337, and the concatenation of 73 and 3 forms the prime 733.
Although 37673 is a palindrome where 3, 7673, and 76733 are all primes and 3767, 3, and 33767 are all primes, the palindrome is not prime and is therefore not in the sequence.
		

Crossrefs

Subsequence of A383810.

Programs

  • Mathematica
    f[n_] := Block[{cnt = 0, id = IntegerDigits@ n, k = 1, len, p, q, qp}, len = Length@ id; While[k < len, p = Take[id, k]; q = Take[id, -len + k]; qp = FromDigits[Join[q, p]]; If[ PrimeQ@ FromDigits@ p && PrimeQ@ FromDigits@ q && PrimeQ@ qp && IntegerLength@ qp == len, cnt++]; k++]; cnt]; fQ[n_] := Reverse[idn = IntegerDigits@ n] == idn && f@ n > 1; Select[ Prime@ Range@ 3000000, fQ]

A046349 Composite numbers with only palindromic prime factors.

Original entry on oeis.org

4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 27, 28, 30, 32, 33, 35, 36, 40, 42, 44, 45, 48, 49, 50, 54, 55, 56, 60, 63, 64, 66, 70, 72, 75, 77, 80, 81, 84, 88, 90, 96, 98, 99, 100, 105, 108, 110, 112, 120, 121, 125, 126, 128, 132, 135, 140, 144, 147, 150
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Crossrefs

Programs

  • Maple
    isA046349 := proc(n)
        simplify(isA033620(n) and not isprime(n)) ;
    end proc:
    for n from 2 to 300 do
        if isA046349(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Sep 09 2015
  • Mathematica
    palQ[n_]:=Reverse[x=IntegerDigits[n]]==x; Select[Range[4,150],!PrimeQ[#]&&And@@palQ/@First/@FactorInteger[#]&] (* Jayanta Basu, Jun 05 2013 *)
    Select[Range[200],CompositeQ[#]&&AllTrue[FactorInteger[#][[All,1]],PalindromeQ]&] (* Harvey P. Dale, May 15 2022 *)
  • Python
    from sympy import isprime, primefactors
    def pal(n): s = str(n); return s == s[::-1]
    def ok(n): return not isprime(n) and all(pal(f) for f in primefactors(n))
    print(list(filter(ok, range(4, 151)))) # Michael S. Branicky, Apr 06 2021

Formula

A033620 INTERSECT A002808. - R. J. Mathar, Sep 09 2015

A050251 Number of palindromic primes less than 10^n.

Original entry on oeis.org

0, 4, 5, 20, 20, 113, 113, 781, 781, 5953, 5953, 47995, 47995, 401696, 401696, 3438339, 3438339, 30483565, 30483565, 269577430, 269577430, 2427668363, 2427668363, 22170468927, 22170468927, 202985860292, 202985860292
Offset: 0

Views

Author

Keywords

Comments

Every palindrome with an even number of digits is divisible by 11 and therefore is composite (not prime). Hence there is only one palindromic prime with an even number of digits, 11. - Martin Renner, Apr 15 2006

Crossrefs

Partial sums of A016115.
Cf. A002113 (palindromes), A002385 (palindromic primes).

Programs

  • Python
    from _future_ import division
    from sympy import isprime
    def paloddgen(l,b=10): # generator of odd-length palindromes in base b of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1,l+1):
                n = b**(x-1)
                n2 = n*b
                for y in range(n,n2):
                    k, m = y//b, 0
                    while k >= b:
                        k, r = divmod(k,b)
                        m = b*m + r
                    yield y*n + b*m + k
    def A050251(n):
        if n <= 1:
            return 4*n
        else:
            c = 1
            for i in paloddgen((n+1)//2):
                if isprime(i):
                    c += 1
            return c # Chai Wah Wu, Jan 05 2015

Formula

a(n) ~ A070199(n)/log(10^n) = 1/log(10^n)*Sum {k=1..n} 9*10^floor[(k-1)/2]. - Robert G. Wilson v, May 31 2009
a(2n) = a(2n-1) for n > 1. - Chai Wah Wu, Nov 21 2021

Extensions

More terms from Patrick De Geest, Aug 01 1999
2 more terms from Shyam Sunder Gupta, Feb 12 2006
2 more terms from Shyam Sunder Gupta, Mar 13 2009
a(23)-a(24) from Shyam Sunder Gupta, Oct 05 2013
Missing a(0) inserted by Chai Wah Wu, Nov 21 2021
a(25)-a(26) from Shyam Sunder Gupta, Dec 19 2024

A070250 Palindromic primes with digit sum 10.

Original entry on oeis.org

181, 12421, 30403, 1008001, 1114111, 1212121, 100161001, 100404001, 101060101, 101141101, 102040201, 102202201, 104000401, 130020031, 140000041, 10001610001, 10013031001, 10100600101, 10102220101, 10130003101
Offset: 1

Views

Author

Amarnath Murthy, May 05 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Do[p = IntegerDigits[ Prime[n]]; If[ Plus @@ p == 10 && Reverse[p] == p, Print[ Prime[n]]], {n, 1, 10^10}]
    Select[Prime[Range[4607*10^5]],PalindromeQ[#]&&Total[IntegerDigits[#]]==10&] (* Harvey P. Dale, May 28 2023 *)

Extensions

Edited and extended by Robert G. Wilson v and Jason Earls, May 06 2002

A071251 Squarefree palindromes.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 11, 22, 33, 55, 66, 77, 101, 111, 131, 141, 151, 161, 181, 191, 202, 222, 262, 282, 303, 313, 323, 353, 373, 383, 393, 434, 454, 474, 494, 505, 515, 535, 545, 555, 565, 595, 606, 626, 646, 707, 717, 727, 737, 757, 767, 777, 787, 797, 818, 838
Offset: 1

Views

Author

Amarnath Murthy, May 21 2002

Keywords

Crossrefs

Intersection of A002113 and A005117.

Programs

  • Maple
    ffpal := proc(n) local i,j,k,s,aa,nn,bb,flag; s := n; aa := convert(s,string); nn := length(aa); bb := ``; for i from nn by -1 to 1 do bb := cat(bb,substring(aa,i..i)); od; flag := 0; for j from 1 to nn do if substring(aa,j..j)<>substring(bb,j..j) then flag := 1 fi; od; RETURN(flag); end: ts_ndk_pal := proc(i) if ffpal((i)) = 0 then if (numtheory[issqrfree](i) = 'true' ) then RETURN((i)) fi fi end: andkpal := [seq(ts_ndk_pal(i), i=1..10000)]: andkpal;
  • Mathematica
    Select[ Range[ 1000], # == FromDigits[ Reverse[ IntegerDigits[ # ]]] && Max[ Transpose[ FactorInteger[ # ]] [[2]]] < 2 &]
    Select[Range[1000],PalindromeQ[#]&&SquareFreeQ[#]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 17 2018 *)

Extensions

Edited by Robert G. Wilson v, Jun 03 2002

A082623 a(1) = 5, a(n) = smallest palindromic prime obtained by inserting two digits anywhere in a(n-1).

Original entry on oeis.org

5, 151, 10501, 1035301, 103515301, 10325152301, 1013251523101, 101325181523101, 10132512821523101, 1013251428241523101, 101322514282415223101, 10132245142824154223101, 1013224514281824154223101, 101322451402818204154223101, 10132245014028182041054223101
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Apr 29 2003

Keywords

Comments

a(78) is the last term, as none of the candidates for a(79) is prime. - Giovanni Resta, Sep 20 2019

Crossrefs

Programs

  • Maple
    cp:= proc(x,y) if x[1] < y[1] then true
               elif x[1] > y[1] then false
               elif nops(x)=1 then true
               else procname(x[2..-1],y[2..-1])
               fi
    end proc: A[1]:= 5: L:= [5]:
    for n from 2 to 15 do
      nL:= nops(L);
      Lp:= sort([seq(seq([op(L[1..i]), x, op(L[i+1..-1])], x=`if`(i=0, 1..9, 0..9)), i=0..nL)], cp);
      cands:= map(t -> add(t[i]*(10^(i-1)+10^(2*nL+1-i)), i=1..nL)+t[nL+1]*10^(nL), Lp);
      found:= false;
      for i from 1 to nops(cands) do
        if isprime(cands[i]) then
          A[n]:= cands[i];
          L:= Lp[i];
          found:= true;
          break
        fi
      od;
      if not found then break fi
    od:
    seq(A[i],i=1..15); # Robert Israel, Jan 03 2017, corrected Sep 20 2019

Extensions

Terms after a(4) corrected by Giovanni Resta, Sep 20 2019

A082624 a(1) = 7, a(n) = smallest palindromic prime obtained by inserting digit anywhere in a(n-1).

Original entry on oeis.org

7, 373, 30703, 3007003, 302070203, 30207570203, 3062075702603, 306020757020603, 30602075057020603, 3060320750570230603, 300603207505702306003, 30060320275057202306003, 3006032021750571202306003, 300603202127505721202306003, 30046032021275057212023064003
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Apr 29 2003

Keywords

Crossrefs

Extensions

More terms from Giovanni Resta, Sep 20 2019

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

A100580 Palindromic primes containing digits 0 and 1 only. (Palindromic terms in A020449.)

Original entry on oeis.org

11, 101, 100111001, 110111011, 111010111, 1100011100011, 1100101010011, 1101010101011, 1110110110111, 1110111110111, 100110101011001, 101000010000101, 101011000110101, 101110000011101, 110011101110011
Offset: 1

Views

Author

Chuck Seggelin (seqfan(AT)plastereddragon.com), Nov 29 2004

Keywords

Examples

			a(3) = 100111001 because 100111001 is the third palindromic prime composed only of 1's and 0's.
		

Crossrefs

Programs

  • Mathematica
    PalQ[n_]:=FromDigits[Reverse@IntegerDigits[n]]==n; DeleteDuplicates[Flatten[Table[Select[FromDigits /@ Tuples[{0,1},n],PrimeQ[#]&&PalQ[#] &],{n,15}]]] (* Jayanta Basu, May 11 2013 *)
    Select[FromDigits/@Tuples[{0,1},15],PalindromeQ[#]&&PrimeQ[#]&] (* Harvey P. Dale, Jan 18 2023 *)
  • Python
    from sympy import isprime
    A100580_list = [11]
    for i in range(2, 2**16):
        s = format(i, 'b')
        x = int(s+s[-2::-1])
        if isprime(x):
            A100580_list.append(x) # Chai Wah Wu, Jan 06 2015

A108388 Transmutable primes: Primes with distinct digits d_i, i=1,m (2<=m<=4) such that simultaneously exchanging all occurrences of any one pair (d_i,d_j), i<>j results in a prime.

Original entry on oeis.org

13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 179, 191, 199, 313, 331, 337, 773, 911, 919, 1171, 1933, 3391, 7717, 9311, 11113, 11119, 11177, 11717, 11933, 33199, 33331, 77171, 77711, 77713, 79999, 97777, 99991, 113111, 131111, 131113, 131171, 131311
Offset: 1

Views

Author

Rick L. Shepherd, Jun 02 2005

Keywords

Comments

a(n) is a term iff a(n) is prime and binomial(m,2) 'transmutations' (see example) of a(n) are different primes. A083983 is the subsequence for m=2: one transmutation (The author of A083983, Amarnath Murthy, calls the result of such a digit-exchange a self-complement. {Because I didn't know until afterwards that this sequence was a generalization of A083983 and as this generalization always leaves some digits unchanged for m>2, I've chosen different terminology.}). A108389 ({1,3,7,9}) is the subsequence for m=4: six transmutations. Each a(n) corresponding to m=3 (depending upon its set of distinct digits) and having three transmutations is also a member of A108382 ({1,3,7}), A108383 ({1,3,9}), A108384 ({1,7,9}), or A108385 ({3,7,9}). The condition m>=2 only eliminates the repunit (A004022) and single-digit primes. The condition m<=4 is not a restriction because if there were more distinct digits, they would include even digits or the digit 5, in either case transmuting into a composite number. Some terms such as 1933 are reversible primes ("Emirps": A006567) and the reverse is also transmutable. The transmutable prime 3391933 has three distinct digits and is also a palindromic prime (A002385). The smallest transmutable prime having four distinct digits is A108389(0) = 133999337137 (12 digits).

Examples

			179 is a term because it is prime and its three transmutations are all prime:
exchanging ('transmuting') 1 and 7: 179 ==> 719 (prime),
exchanging 1 and 9: 179 ==> 971 (prime) and
exchanging 7 and 9: 179 ==> 197 (prime).
(As 791 and 917 are not prime, 179 is not a term of A068652 or A003459 also.).
Similarly, 1317713 is transmutable:
exchanging all 1's and 3s: 1317713 ==> 3137731 (prime),
exchanging all 1's and 7s: 1317713 ==> 7371173 (prime) and
exchanging all 3s and 7s: 1317713 ==> 1713317 (prime).
		

Crossrefs

Cf. A108382, A108383, A108384, A108385, A108386, A108389 (transmutable primes with four distinct digits), A083983 (transmutable primes with two distinct digits), A108387 (doubly-transmutable primes), A006567 (reversible primes), A002385 (palindromic primes), A068652 (every cyclic permutation is prime), A003459 (absolute primes).

Programs

  • Python
    from gmpy2 import is_prime
    from itertools import combinations, count, islice, product
    def agen(): # generator of terms
        for d in count(2):
            for p in product("1379", repeat=d):
                p, s = "".join(p), sorted(set(p))
                if len(s) == 1: continue
                if is_prime(t:=int(p)):
                    if all(is_prime(int(p.translate({ord(c):ord(d), ord(d):ord(c)}))) for c, d in combinations(s, 2)):
                        yield t
    print(list(islice(agen(), 50))) # Michael S. Branicky, Dec 15 2023
Previous Showing 51-60 of 288 results. Next