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

A016041 Primes that are palindromic in base 2 (but written here in base 10).

Original entry on oeis.org

3, 5, 7, 17, 31, 73, 107, 127, 257, 313, 443, 1193, 1453, 1571, 1619, 1787, 1831, 1879, 4889, 5113, 5189, 5557, 5869, 5981, 6211, 6827, 7607, 7759, 7919, 8191, 17377, 18097, 18289, 19433, 19609, 19801, 21157, 22541, 22669, 22861, 23581, 24029
Offset: 1

Views

Author

Keywords

Comments

See A002385 for palindromic primes in base 10, and A256081 for primes whose binary expansion is "balanced" (see there) but not palindromic. - M. F. Hasler, Mar 14 2015
Number of terms less than 4^k, k=1,2,3,...: 1, 3, 5, 8, 11, 18, 30, 53, 93, 187, 329, 600, 1080, 1936, 3657, 6756, 12328, 23127, 43909, 83377, 156049, 295916, 570396, 1090772, 2077090, 3991187, 7717804, 14825247, 28507572, 54938369, 106350934, ..., partial sums of A095741 plus 1. - Robert G. Wilson v, Feb 23 2018, corrected by Jeppe Stig Nielsen, Jun 17 2023

Crossrefs

Intersection of A000040 and A006995.
First row of A095749.
A095741 gives the number of terms in range [2^(2n), 2^(2n+1)].
Cf. A095730 (primes whose Zeckendorf expansion is palindromic), A029971 (primes whose ternary (base-3) expansion is palindromic).
Cf. A117697 (written in base 2), A002385, A194097, A256081.

Programs

  • Magma
    [NthPrime(n): n in [1..5000] | (Intseq(NthPrime(n), 2) eq Reverse(Intseq(NthPrime(n), 2)))]; // Vincenzo Librandi, Feb 24 2018
    
  • Mathematica
    lst = {}; Do[ If[ PrimeQ@n, t = IntegerDigits[n, 2]; If[ FromDigits@t == FromDigits@ Reverse@ t, AppendTo[lst, n]]], {n, 3, 50000, 2}]; lst (* syntax corrected by Robert G. Wilson v, Aug 10 2009 *)
    pal2Q[n_] := Reverse[x = IntegerDigits[n, 2]] == x; Select[Prime[Range[2800]], pal2Q[#] &] (* Jayanta Basu, Jun 23 2013 *)
    genPal[n_Integer, base_Integer: 10] := Block[{id = IntegerDigits[n, base], insert = Join[{{}}, {# - 1} & /@ Range[base]]}, FromDigits[#, base] & /@ (Join[id, #, Reverse@id] & /@ insert)]; k = 0; lst = {}; While[k < 100, AppendTo[lst, Select[ genPal[k, 2], PrimeQ]]; lst = Flatten@ lst; k++]; lst (* Robert G. Wilson v, Feb 23 2018 *)
  • PARI
    is(n)=isprime(n)&&Vecrev(n=binary(n))==n \\ M. F. Hasler, Feb 23 2018
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(n) and (b:=bin(n)[2:]) == b[::-1]
    print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Apr 20 2024

Formula

Sum_{n>=1} 1/a(n) = A194097. - Amiram Eldar, Mar 19 2021

Extensions

More terms from Patrick De Geest

A118031 Decimal expansion of the sum of the reciprocals of the palindromic numbers A002113.

Original entry on oeis.org

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

Views

Author

Martin Renner, May 11 2006

Keywords

Comments

The sum using all palindromic numbers < 10^8 is 3.37000183240... Extrapolating using Wynn's epsilon method gives a value near 3.37018... - Eric W. Weisstein, May 14 2006

Examples

			3.3702832594973733204921572985...
		

Crossrefs

Cf. A002113.
Similar sequences: A118064, A194097, A244162.

Programs

  • Mathematica
    NextPalindrome[n_] := Block[{l = Floor[ Log[10, n] + 1], idn = IntegerDigits@ n}, If[ Union@ idn == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[ idn, Ceiling[l/2]]]] > FromDigits[ Take[idn, -Ceiling[l/2]]], FromDigits[Join[Take[idn, Ceiling[l/2]], Reverse[Take[idn, Floor[l/2]]]]], idfhn = FromDigits[Take[idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits@ idfhn, Drop[ Reverse[ IntegerDigits@ idfhn], Mod[l, 2]]]]]]]]; pal = 1; sm = 0; Do[ While[pal < 10^n + 1, sm = N[sm + 1/pal, 128]; pal = NextPalindrome@ pal]; Print[{n, sm}], {n, 0, 17}] (* Robert G. Wilson v, Oct 20 2010 *)

Formula

a(n) = Sum_{palindromes p>0} 1/p.
a(n) = Sum_{n>=2} 1/A002113(n).

Extensions

Corrected by Eric W. Weisstein, May 14 2006
Corrected and extended by Robert G. Wilson v, Oct 20 2010
Corrected and extended by Joseph Myers, Jun 26 2014

A244162 Decimal expansion of the sum of the reciprocals of the binary palindromic numbers.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			2.3787957...
		

Crossrefs

Extensions

First 8 terms from Lars Blomberg
Extended by Joseph Myers, Jun 26 2014

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
Showing 1-4 of 4 results.