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 31-40 of 287 results. Next

A046376 Palindromes with exactly 2 palindromic prime factors (counted with multiplicity), and no other prime factors.

Original entry on oeis.org

4, 6, 9, 22, 33, 55, 77, 121, 202, 262, 303, 393, 505, 626, 707, 939, 1111, 1441, 1661, 1991, 3443, 3883, 7997, 10201, 13231, 15251, 18281, 19291, 20602, 22622, 22822, 24842, 26662, 28682, 30903, 31613, 33933, 35653, 37673, 38683, 39993, 60206, 60406, 60806
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Comments

Equivalently, semiprime palindromes where both prime factors are palindromes. - Franklin T. Adams-Watters, Apr 11 2011
The sequence "trivially" includes products of palindromic primes p*q where
a) p = 2 or 3 and q has only digits < 4, as q = 11, 101, 131, 10301, 30103, ...
b) p <= 11 and q has only digits 0 and 1, as q = 101 and repunit primes A004022
c) p = 11 and q has only digits spaced out by zeros, as q = 101, 10301, 10501, 10601, 30103, 30203, 30403, 30703, 30803, ... - M. F. Hasler, Jan 04 2022

Examples

			The palindrome 35653 is a term since it has 2 factors, 101 and 353, both palindromic.
		

Crossrefs

Cf. A001358 (semiprimes), A002113 (palindromes), A002385 (palindromic primes).
Subsequence of A188650.

Programs

  • Mathematica
    Take[Select[Times@@@Tuples[Select[Prime[Range[5000]],PalindromeQ],2], PalindromeQ]// Union,50] (* Harvey P. Dale, Aug 25 2019 *)
  • PARI
    {first(N=50, p=1) = vector(N, i, until( bigomega( p=nxt_A002113(p))==2 && vecmin( apply( is_A002113, factor(p)[,1])),); p)} \\ M. F. Hasler, Jan 04 2022
    
  • Python
    from sympy import factorint
    from itertools import product
    def ispal(n): s = str(n); return s == s[::-1]
    def pals(d, base=10): # all d-digit palindromes
        digits = "".join(str(i) for i in range(base))
        for p in product(digits, repeat=d//2):
            if d > 1 and p[0] == "0": continue
            left = "".join(p); right = left[::-1]
            for mid in [[""], digits][d%2]: yield int(left + mid + right)
    def ok(pal):
        f = factorint(pal)
        return sum(f.values()) == 2 and all(ispal(p) for p in f)
    print(list(filter(ok, (p for d in range(1, 6) for p in pals(d) if ok(p))))) # Michael S. Branicky, Aug 14 2022

Formula

Intersection of A002113 and A046368; A188649(a(n)) = a(n). - Reinhard Zumkeller, Apr 11 2011

Extensions

Definition clarified by Franklin T. Adams-Watters, Apr 11 2011
More terms from Lars Blomberg, Nov 06 2015

A070247 Palindromic primes with digit sum 5.

Original entry on oeis.org

5, 131, 10301, 1003001, 100030001, 100111001, 101000010000101, 10000010101000001, 101000000010000000101, 110000000010000000011, 10000000000300000000001, 10000100000100000100001, 100000100000010000001000001, 10000000000000300000000000001, 10000000001000100010000000001
Offset: 1

Views

Author

Amarnath Murthy, May 05 2002

Keywords

Comments

It is conjectured that are just 3 palindromic primes with digit sum 2, namely 2, 11 and 101. If any others exist, they must be of the form 10^(2^k) + 1 with k > 14.
From Jeppe Stig Nielsen, Aug 30 2025: (Start)
It is now known that any additional primes 10^(2^k) + 1 must have k >= 31.
Digit sum 3 yields only one prime, 3, a palindrome in a vacuous way.
Digit sum 4 leads to primes (A062339), but such numbers can never be palindromes. Proof: Let w be any palindrome with digit sum 4. So w = 10^a + 10^b + 10^c + 10^d with a >= b >= c >= d >= 0. But then 10^c + 10^d is a nontrivial divisor of w, showing that w is not prime.
You may have come here searching for the subsequence 5, 131, 10301, 1003001, 100030001, 10000000000300000000001, ... where the largest digit exceeds 1. See A171376 and A100028 for information on them.
(End)

Crossrefs

Programs

  • Mathematica
    Do[p = Join[ IntegerDigits[n, 4], Reverse[ Drop[ IntegerDigits[n, 4], -1]]]; q = Plus @@ p; If[q == 5 && PrimeQ[ FromDigits[p]] && q == 5, Print[ FromDigits[p]]], {n, 1, 4 10^8}] (* this coding will not pick up the first entry *)
  • PARI
    for(i=0,50,for(j=0,i,p=10^(2*i)+10^(i+j)+10^i+10^(i-j)+1;isprime(p)&&print1(p,", "))) \\ Jeppe Stig Nielsen, Aug 30 2025

Extensions

Edited by Robert G. Wilson v, May 15 2002
More terms from Chai Wah Wu, Nov 25 2015

A075807 Numbers n such that n-th prime is palindromic.

Original entry on oeis.org

1, 2, 3, 4, 5, 26, 32, 36, 42, 43, 65, 71, 74, 76, 129, 134, 138, 139, 157, 158, 1263, 1285, 1293, 1367, 1377, 1483, 1519, 1528, 1583, 1635, 1647, 1682, 1726, 1805, 1814, 1867, 1897, 1917, 1928, 2009, 2060, 2083, 2117, 2196, 2250, 2260, 3255, 3267, 3285
Offset: 1

Views

Author

Jani Melik, Oct 13 2002

Keywords

Examples

			26th prime is 101, which is palindromic.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..3500] | Intseq(NthPrime(n), 10) eq Reverse(Intseq(NthPrime(n), 10))]; // Vincenzo Librandi, Mar 24 2019
    
  • Maple
    test := proc(n) local d; d := convert(ithprime(n),base,10); return ListTools[Reverse](d)=d; end; a := []; for n from 1 to 4000 do if test(n) then a := [op(a),n]; end; od; a;
  • Mathematica
    Rest[Flatten[Position[Prime[Range[4000]],?(IntegerDigits[#] == Reverse[ IntegerDigits[#]]&)]]] (* _Harvey P. Dale, Jan 26 2014 *)
  • PARI
    isok(n) = my(d=digits(prime(n))); Vecrev(d) == d; \\ Michel Marcus, Mar 24 2019

Formula

a(n) = A000720(A002385(n)). - David A. Corneth, Mar 24 2019

Extensions

Edited by Dean Hickerson, Oct 21 2002

A082806 Palindromes which are prime and the sum of the digits is also prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 101, 131, 151, 191, 313, 353, 373, 757, 797, 919, 10301, 10501, 11311, 12721, 13331, 13931, 14341, 14741, 15551, 16361, 16561, 18181, 19391, 19991, 30103, 30703, 31513, 32323, 33533, 34543, 35153, 35353, 35753, 36563, 38183
Offset: 1

Views

Author

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

Keywords

Comments

Most of the initial palindromic primes are members.
11 is the only member of even length since the sum of the digits of such palindromes is even and 2 is the only even prime. For the members of odd length the middle digit is odd (except for 2). - Chai Wah Wu, Aug 12 2014

Examples

			E.g. 12721 is a palindromic prime and 1+2+7+2+1 = 13 is also prime.
		

Crossrefs

Cf. A002385.
Subsequence of A083393. [Arkadiusz Wesolowski, Sep 14 2011]

Programs

  • Maple
    N:= 3: # to get all terms of at most 2*N+1 digits
    revdigs:= proc(n)
    local L,d;
    L:= convert(n,base,10);
    d:= nops(L);
    add(L[i]*10^(d-i),i=1..d);
    end proc:
    pals:= proc(d)
    local x,y;
    seq(seq(x*10^(d+1)+y*10^d + revdigs(x),y=0..9),x=10^(d-1)..10^d-1)
    end proc;
    select(n -> isprime(n) and isprime(convert(convert(n,base,10),`+`)), {2,3,5,7,11,seq(pals(d),d=1..3)}); # Robert Israel, Aug 12 2014
  • Mathematica
    Select[ Range[390000], PrimeQ[ # ] && FromDigits[ Reverse[ IntegerDigits[ # ]]] == # && PrimeQ[ Plus @@ IntegerDigits[ # ]] & ] (* Robert G. Wilson v, Jun 17 2003 *)
  • Python
    from sympy import isprime
    A082806 = sorted([n for n in chain(map(lambda x:int(str(x)+str(x)[::-1]),range(1,10**5)),map(lambda x:int(str(x)+str(x)[-2::-1]), range(1,10**5))) if isprime(n) and isprime(sum([int(d) for d in str(n)]))])
    # Chai Wah Wu, Aug 12 2014

Extensions

Corrected and extended by Giovanni Resta, Feb 07 2006
Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, May 14 2007

A188649 Least common multiple of reversals of divisors of n in decimal representation.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 84, 31, 574, 255, 488, 71, 162, 91, 20, 84, 22, 32, 168, 260, 62, 72, 1148, 92, 510, 13, 11224, 33, 6106, 1855, 2268, 73, 15106, 93, 40, 14, 6888, 34, 44, 4590, 64, 74, 10248, 658, 260, 1065, 3100, 35, 3240, 55, 149240, 6825, 7820, 95, 7140, 16, 26, 252, 11224, 8680, 66, 76, 12212, 96, 152110, 17, 4536, 37, 6862, 251940, 2024204, 77
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 11 2011

Keywords

Examples

			Divisors(42) = {1,2,3,6,7,14,21,42}, therefore a(42) = lcm(1,2,3,6,7,41,12,24) = 6888.
		

Crossrefs

Cf. A003990 (LCM), A027750 (divisors), A004086 (reversal), A188650.

Programs

  • Haskell
    a188649 n = foldl lcm 1 $ map a004086 $ filter ((== 0) . mod n) [1..n]
    
  • PARI
    a(n) = lcm(apply(x->fromdigits(Vecrev(digits(x))), divisors(n))); \\ Michel Marcus, Mar 13 2018
    
  • Python
    from math import lcm
    from sympy import divisors
    def a(n): return lcm(*(int(str(d)[::-1]) for d in divisors(n)))
    print([a(n) for n in range(1, 78)]) # Michael S. Branicky, Aug 14 2022

Formula

a(A000040(n)) = A004087(n);
a(A002385(n)) = A002385(n), see A188650 for all fixed points.

A230199 Sum of digits of n-th palindromic prime.

Original entry on oeis.org

2, 3, 5, 7, 2, 2, 5, 7, 10, 11, 7, 11, 13, 14, 16, 19, 22, 23, 19, 20, 5, 7, 8, 7, 8, 10, 13, 14, 11, 16, 17, 13, 17, 16, 17, 14, 17, 19, 20, 20, 25, 19, 22, 23, 28, 29, 7, 8, 10, 13, 14, 8, 13, 13, 14, 17, 19, 22, 16, 17, 19, 23, 20, 23, 22, 25, 22, 23, 29
Offset: 1

Views

Author

Shyam Sunder Gupta, Oct 11 2013

Keywords

Examples

			a(6) =2, since sum of digits of 6th palindromic prime i.e. 101 is 2.
		

Crossrefs

Programs

  • Mathematica
    a = {}; Do[z = n*10^(IntegerLength[n] - 1) +
    FromDigits@Rest@Reverse@IntegerDigits[n]; If[PrimeQ[z], s = Apply[Plus, IntegerDigits[z]]; AppendTo[a, s]], {n, 1, 10^5}]; Insert[a, 2, 5]
    palQ[n_]:=Module[{idn=IntegerDigits[n]},idn==Reverse[idn]]; Total[ IntegerDigits[ #]]&/@ Select[Prime[Range[5000]],palQ] (* Harvey P. Dale, Oct 10 2014 *)

Formula

a(n) = A007953(A002385(n)). - R. J. Mathar, Sep 09 2015

A032595 First of three consecutive palindromes all of which are prime.

Original entry on oeis.org

1878781, 1879781, 1968691, 3589853, 7819187, 108484801, 159181951, 160696061, 175090571, 187090781, 316686613, 319393913, 725585527, 728888827, 731898137, 904080409, 921191129, 930494039, 987191789, 987484789, 10456865401, 10744944701
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Examples

			2,3,5 are palindromes, and consecutive primes, but they are not consecutive palindromes.
2,3,4 are consecutive palindromes, but they are not all primes.
The first time there are three consecutive palindromes which are all primes is 1878781, 1879781, 1880881.  - _N. J. A. Sloane_, Aug 12 2021
		

Crossrefs

Programs

  • PARI
    nxt(n)=my(d=digits(n)); i=(#d+1)\2; while(i&&d[i]==9, d[i]=0; d[#d+1-i]=0; i--); if(i, d[i]++; d[#d+1-i]=d[i], d=vector(#d+1); d[1]=d[#d]=1); sum(i=1, #d, 10^(#d-i)*d[i]) \\ From David A. Corneth at A002113
    list(lim)=my(v=List(),p=1,q=2,r=3); while(p<=lim\=1, if(isprime(r), if(isprime(q), if(isprime(p), listput(v,p)); p=q; q=r; r=nxt(r), q=nxt(p=r); r=nxt(q)), q=nxt(p=nxt(r)); r=nxt(q))); Vec(v) \\ Charles R Greathouse IV, Aug 11 2021

Extensions

New name from Charles R Greathouse IV, Aug 11 2021

A046351 Palindromic composite numbers with only palindromic prime factors.

Original entry on oeis.org

4, 6, 8, 9, 22, 33, 44, 55, 66, 77, 88, 99, 121, 202, 242, 252, 262, 303, 343, 363, 393, 404, 484, 505, 525, 606, 616, 626, 686, 707, 808, 909, 939, 1111, 1331, 1441, 1661, 1991, 2112, 2222, 2662, 2772, 2882, 3333, 3443, 3773, 3883, 3993, 4224, 4444, 5445
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Crossrefs

Programs

  • Mathematica
    palQ[n_]:=Reverse[x=IntegerDigits[n]]==x; Select[Range[4,5500],!PrimeQ[#]&&And@@palQ/@Join[{#},First/@FactorInteger[#]]&](* Jayanta Basu, Jun 05 2013 *)
  • Python
    from itertools import product
    from sympy import isprime, primefactors as pf
    def pal(n): s = str(n); return s == s[::-1]
    def palsthru(maxdigits):
      midrange = [[""], [str(i) for i in range(10)]]
      for digits in range(1, maxdigits+1):
        for p in product("0123456789", repeat=digits//2):
          left = "".join(p)
          if len(left) and left[0] == '0': continue
          for middle in midrange[digits%2]: yield int(left+middle+left[::-1])
    def okpal(p): return p > 3 and not isprime(p) and all(pal(f) for f in pf(p))
    print(list(filter(okpal, palsthru(4)))) # Michael S. Branicky, Apr 06 2021

Formula

(A032350 INTERSECT A033620) MINUS {1}. - R. J. Mathar, Sep 09 2015

A054217 Primes p with property that p concatenated with its emirp p' (prime reversal) forms a palindromic prime of the form 'primemirp' (rightmost digit of p and leftmost digit of p' are blended together - p and p' palindromic allowed).

Original entry on oeis.org

2, 3, 5, 7, 13, 31, 37, 79, 113, 179, 181, 199, 353, 727, 787, 907, 937, 967, 983, 1153, 1193, 1201, 1409, 1583, 1597, 1657, 1831, 1879, 3083, 3089, 3319, 3343, 3391, 3541, 3643, 3853, 7057, 7177, 7507, 7681, 7867, 7949, 9103, 9127, 9173, 9209, 9439, 9547, 9601
Offset: 1

Views

Author

Patrick De Geest, Feb 15 2000

Keywords

Comments

Original idea from G. L. Honaker, Jr..

Examples

			E.g., prime 113 has emirp 311 and 11311 is a palindromic prime, so 113 is a term.
		

Crossrefs

Programs

  • Mathematica
    empQ[n_]:=Module[{idn=IntegerDigits[n],rev},rev=Reverse[idn];And@@PrimeQ[ {FromDigits[ rev],FromDigits[Join[Most[idn],rev]]}]]; Select[Prime[ Range[ 1200]],empQ] (* Harvey P. Dale, Mar 26 2013 *)
  • Python
    from sympy import isprime
    def ok(n):
        if not isprime(n): return False
        s = str(n); srev = s[::-1]
        return isprime(int(srev)) and isprime(int(s[:-1] + srev))
    print([k for k in range(10**4) if ok(k)]) # Michael S. Branicky, Nov 17 2023

Extensions

Corrected (a(30)=3089 inserted) by Harvey P. Dale, Mar 26 2013

A070248 Palindromic primes with digit sum 7.

Original entry on oeis.org

7, 151, 313, 10501, 11311, 30103, 1201021, 3001003, 100050001, 100131001, 101030101, 110111011, 111010111, 10000500001, 1100011100011, 1100101010011, 100020010020001
Offset: 1

Views

Author

Amarnath Murthy, May 05 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Do[p = Join[ IntegerDigits[n], Reverse[ Drop[ IntegerDigits[n], -1]]]; q = Plus @@ p; If[ PrimeQ[ FromDigits[p]] && q == 7, Print[ FromDigits[p]]], {n, 1, 10^7}]

Extensions

Edited by Robert G. Wilson v, May 15 2002
Previous Showing 31-40 of 287 results. Next