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

A007500 Primes whose reversal in base 10 is also prime (called "palindromic primes" by David Wells, although that name usually refers to A002385). Also called reversible primes.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97, 101, 107, 113, 131, 149, 151, 157, 167, 179, 181, 191, 199, 311, 313, 337, 347, 353, 359, 373, 383, 389, 701, 709, 727, 733, 739, 743, 751, 757, 761, 769, 787, 797, 907, 919, 929, 937, 941, 953, 967, 971, 983, 991, 1009, 1021
Offset: 1

Views

Author

Keywords

Comments

The numbers themselves need not be palindromes.
The range is a subset of the range of A071786. - Reinhard Zumkeller, Jul 06 2009
Number of terms less than 10^n: 4, 13, 56, 260, 1759, 11297, 82439, 618017, 4815213, 38434593, ..., . - Robert G. Wilson v, Jan 08 2015

References

  • Roozbeh Hazrat, Mathematica: A Problem-Centered Approach, Springer 2010, pp. 39, 131-132
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 113.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, 134.

Crossrefs

Cf. A002385 (primes that are palindromes in base 10).
Equals A002385 union A006567.
Complement of A076056 with respect to A000040. [From Reinhard Zumkeller, Jul 06 2009]

Programs

  • Haskell
    a007500 n = a007500_list !! (n-1)
    a007500_list = filter ((== 1) . a010051 . a004086) a000040_list
    -- Reinhard Zumkeller, Oct 14 2011
    
  • Magma
    [ p: p in PrimesUpTo(1030) | IsPrime(Seqint(Reverse(Intseq(p)))) ];  // Bruno Berselli, Jul 08 2011
    
  • Maple
    revdigs:= proc(n)
    local L,nL,i;
    L:= convert(n,base,10);
    nL:= nops(L);
    add(L[i]*10^(nL-i),i=1..nL);
    end:
    Primes:= select(isprime,{2,seq(2*i+1,i=1..5*10^5)}):
    Primes intersect map(revdigs,Primes); # Robert Israel, Aug 14 2014
  • Mathematica
    Select[ Prime[ Range[ 168 ] ], PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ # ] ] ] ]& ] (* Zak Seidov, corrected by T. D. Noe *)
    Select[Prime[Range[1000]],PrimeQ[IntegerReverse[#]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 15 2016 *)
  • PARI
    is_A007500(n)={ isprime(n) & is_A095179(n)} \\ M. F. Hasler, Jan 13 2012
    
  • Python
    from sympy import prime, isprime
    A007500 = [prime(n) for n in range(1,10**6) if isprime(int(str(prime(n))[::-1]))] # Chai Wah Wu, Aug 14 2014
    
  • Python
    from gmpy2 import is_prime, mpz
    from itertools import count, islice, product
    def agen(): # generator of terms
        yield from [2, 3, 5, 7]
        p = 11
        for digits in count(2):
            for first in "1379":
                for mid in product("0123456789", repeat=digits-2):
                    for last in "1379":
                        s = first + "".join(mid) + last
                        if is_prime(t:=mpz(s)) and is_prime(mpz(s[::-1])):
                            yield int(t)
    print(list(islice(agen(), 60))) # Michael S. Branicky, Jan 02 2025

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Oct 31 2000
Added further terms to the sequence Avik Roy (avik_3.1416(AT)yahoo.co.in), Jan 16 2009. Checked by N. J. A. Sloane, Jan 20 2009.
Third reference added by Harvey P. Dale, Oct 17 2011

A192139 Powers p^m, m >= 0, of palindromic primes p (A002385).

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 11, 16, 25, 27, 32, 49, 64, 81, 101, 121, 125, 128, 131, 151, 181, 191, 243, 256, 313, 343, 353, 373, 383, 512, 625, 727, 729, 757, 787, 797, 919, 929, 1024, 1331, 2048, 2187, 2401, 3125, 4096, 6561, 8192, 10201, 10301, 10501, 10601, 11311, 11411, 12421, 12721
Offset: 1

Views

Author

Jaroslav Krizek, Jun 24 2011

Keywords

Comments

Superset of A002385 and A084092. Subset of A192137.

Crossrefs

Programs

Extensions

Missing term 625 inserted and more terms added by M. F. Hasler, May 11 2015

A046405 Numbers of the form p*q*r where p,q,r are distinct odd palindromic primes (odd terms from A002385).

Original entry on oeis.org

105, 165, 231, 385, 1515, 1965, 2121, 2265, 2715, 2751, 2865, 3171, 3333, 3535, 3801, 4011, 4323, 4585, 4695, 4983, 5285, 5295, 5555, 5595, 5745, 5973, 6303, 6335, 6573, 6685, 7205, 7413, 7777, 7833, 8043, 8305, 9955, 10087, 10329, 10505, 10905
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Crossrefs

Intersection of A033620 and A046389.

Extensions

Definition clarified by N. J. A. Sloane, Dec 19 2017 at the suggestion of Harvey P. Dale
Offset changed by Andrew Howroyd, Aug 14 2024

A046485 Sum of first n palindromic primes A002385.

Original entry on oeis.org

2, 5, 10, 17, 28, 129, 260, 411, 592, 783, 1096, 1449, 1822, 2205, 2932, 3689, 4476, 5273, 6192, 7121, 17422, 27923, 38524, 49835, 61246, 73667, 86388, 99209, 112540, 126371, 140302, 154643, 169384, 184835, 200386, 216447, 232808, 249369, 266030, 283501
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1998

Keywords

Comments

The subsequence of prime partial sum of palindromic primes begins: 2, 5, 17, 5273, 7121, 154643, 283501. What is the smallest nontrivial (i.e., multidigit) palindromic prime partial sum of palindromic primes? [Jonathan Vos Post, Feb 07 2010]

Crossrefs

Programs

  • Mathematica
    t = {}; b = 10; Do[p = Prime[n]; i = IntegerDigits[p, b]; If[i == Reverse[i], AppendTo[t, p];(*Print[p.FromDigits[i]]*)], {n, 4000}]; Accumulate[t] (* Vladimir Joseph Stephan Orlovsky, Feb 23 2012 *)
    Accumulate[Select[Prime[Range[10000]],IntegerDigits[#]==Reverse[ IntegerDigits[#]]&]] (* Harvey P. Dale, Aug 10 2013 *)

Formula

a(n) = Sum_{i=1..n} A002385(i) = Sum_{i=1..n} {p prime and R(p) = p, i.e., primes whose decimal expansion is a palindrome}. [Jonathan Vos Post, Feb 07 2010]

Extensions

Offset set to 1 by R. J. Mathar, Feb 21 2010

A046373 Numbers of the form p*q*r where p,q,r are (not necessarily distinct) odd palindromic primes (odd terms from A002385).

Original entry on oeis.org

27, 45, 63, 75, 99, 105, 125, 147, 165, 175, 231, 245, 275, 343, 363, 385, 539, 605, 847, 909, 1179, 1331, 1359, 1515, 1629, 1719, 1965, 2121, 2265, 2525, 2715, 2751, 2817, 2865, 3171, 3177, 3275, 3333, 3357, 3447, 3535, 3775, 3801, 4011, 4323, 4525
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Crossrefs

Programs

  • Mathematica
    Take[Times@@@Tuples[Select[Prime[Range[2,100]],PalindromeQ],3]//Union,50] (* Harvey P. Dale, Sep 10 2019 *)

Extensions

Definition clarified by N. J. A. Sloane, Dec 19 2017 at the suggestion of Harvey P. Dale

A118064 Decimal expansion of the sum of the reciprocals of the palindromic primes A002385 (Honaker's constant).

Original entry on oeis.org

1, 3, 2, 3, 9, 8, 2, 1, 4, 6, 8, 0, 6
Offset: 1

Views

Author

Martin Renner, May 11 2006

Keywords

Comments

From Robert G. Wilson v, Nov 01 2010: (Start)
n \ sum to 10^n
02 1.267099567099567099567099567099567099567099567099567099567099567099567
03 1.320723244590290964212793334437872849720871258315369002493912638038324
05 1.323748402250648554164425746280035962754669829327727800040192015109270
07 1.323964105671202458016249150576217276147952428601889817773483085610332
09 1.323980718065525060936354534562000413901564393192688451911141729415146
11 1.323982026479475203850120990923294207966175748395470136325039323549015
13 1.323982136437462724794656629740867909978221153827990721566573347887836
15 1.323982145891606234777299440047139038371441916546100653011463101470839
17 1.323982146724859090645464845257681674740147563533254654075059843860490
19 1.323982146799188851138232927173756400348958236915409881890097448921521
21 1.323982146805857558347279363344557427339916178257233985191868031567947 (End)

Examples

			1.323982146806...
		

Crossrefs

Programs

  • Mathematica
    (* first obtain nextPalindrome from A007632 *) s = 1/11; c = 1; pp = 1; Do[ While[pp < 10^n, If[PrimeQ@ pp, c++; s = N[s + 1/pp, 64]]; pp = NextPalindrome@ pp]; If[ OddQ@ n, pp = 10^(n + 1); Print[{s, n, c}]], {n, 17}] (* Robert G. Wilson v, May 31 2009 *)
    generate[n_] := Block[{id = IntegerDigits@n, insert = {{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}}}, FromDigits@ Join[id, #, Reverse@ id] & /@ insert]; sm = N[Plus @@ (1/{2, 3, 5, 7, 11}), 64]; k = 1; Do [While[k < 10^n, sm = N[sm + Plus @@ (1/Select[ generate@k, PrimeQ]), 128]; k++ ]; Print[{2 n + 1, sm}], {n, 9}] (* Robert G. Wilson v, Nov 01 2010 *)

Formula

Equals Sum_{p} 1/p, where p ranges over the palindromic primes.

Extensions

Corrected by Eric W. Weisstein, May 14 2006
More terms from Robert G. Wilson v, Nov 01 2010
Entry revised by N. J. A. Sloane, May 05 2013

A287961 Numbers that are the sum of two palindromic primes (A002385).

Original entry on oeis.org

4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16, 18, 22, 103, 104, 106, 108, 112, 133, 134, 136, 138, 142, 153, 154, 156, 158, 162, 183, 184, 186, 188, 192, 193, 194, 196, 198, 202, 232, 252, 262, 282, 292, 302, 312, 315, 316, 318, 320, 322, 324, 332, 342, 355, 356, 358, 360, 362, 364, 372, 375, 376, 378, 380
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 03 2017

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 380; f[x_] := Sum[Boole[PalindromeQ[k] && PrimeQ[k]] x^k, {k, 1, nmax}]^2; Exponent[#, x] & /@ List @@ Normal[Series[f[x], {x, 0, nmax}]]

A327428 Record gaps between palindromic primes (lower end): primes A002385(k) where A002385(k+1) - A002385(k) exceeds A002385(j+1) - A002385(j) for all j < k.

Original entry on oeis.org

2, 3, 5, 11, 191, 383, 929, 19991, 39293, 98689, 1998991, 3998993, 9989899, 199999991, 399878993, 999727999, 19998289991, 39998389993, 99999199999, 1999987899991, 3999992999993, 9999987899999, 199999959999991, 399999959999993, 999999787999999, 19999998589999991, 39999999299999993
Offset: 1

Views

Author

Chai Wah Wu, Sep 09 2019

Keywords

Comments

This sequence is infinite if there exists an infinite number of palindromic primes (see comment in A327427).

Crossrefs

A286970 Number of compositions (ordered partitions) of n into decimal palindromic primes (A002385).

Original entry on oeis.org

1, 0, 1, 1, 1, 3, 2, 6, 6, 10, 16, 20, 35, 45, 72, 103, 150, 228, 324, 491, 710, 1053, 1552, 2272, 3369, 4930, 7288, 10711, 15771, 23244, 34175, 50382, 74113, 109168, 160722, 236596, 348446, 512894, 755303, 1111946, 1637205, 2410592, 3549023, 5225659, 7693623, 11327912
Offset: 0

Views

Author

Ilya Gutkovskiy, May 17 2017

Keywords

Examples

			a(7) = 6 because we have [7], [5, 2], [3, 2, 2], [2, 5], [2, 3, 2] and [2, 2, 3].
		

Crossrefs

Programs

  • Mathematica
    nmax = 45; CoefficientList[Series[1/(1 - Sum[Boole[PalindromeQ[k] && PrimeQ[k]] x^k, {k, 1, nmax}]), {x, 0, nmax}], x]

Formula

G.f.: 1/(1 - Sum_{k>=1} x^A002385(k)).

A350850 Members of A350836 that are not in A002385.

Original entry on oeis.org

1, 14, 50, 194, 712, 762, 1100, 1994, 2701, 4959, 58376, 70478, 111538, 116416, 144080, 158736, 712410, 1319216, 1934075, 7709760, 10228166, 11601194, 94663994, 177930006
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jan 18 2022

Keywords

Comments

Numbers k that are not palindromic primes, such that the concatenation of the prime factors of k with multiplicity is congruent mod k to the reverse of k.

Examples

			a(3) = 50 is a term because A103168(50) = 5 mod 50 = 5 and A340592(50) = 255 mod 50 = 5, but 50 is not a palindromic prime.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) local L, i;
      L:= convert(n, base, 10);
      add(L[-i]*10^(i-1), i=1..nops(L))
    end proc:
    f:= proc(n) local L, p, i, r;
      L:= sort(map(t -> t[1]$t[2], ifactors(n)[2]));
      r:= L[1];
      for i from 2 to nops(L) do r:= r*10^(1+max(0, ilog10(L[i])))+L[i] od;
      r
    end proc:
    f(1):= 1:
    filter:= proc(n) local r;
    r:= revdigs(n);
    (f(n) - r) mod n = 0 and (revdigs(n) <> n or not isprime(n))
    end proc:
    select(filter, [$1..10^6]);
Showing 1-10 of 287 results. Next