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.

A029971 Palindromic primes in base 3.

Original entry on oeis.org

2, 13, 23, 151, 173, 233, 757, 937, 1093, 1249, 1429, 1487, 1667, 1733, 1823, 1913, 1979, 2069, 8389, 9103, 10111, 12301, 14951, 16673, 16871, 18593, 60103, 60913, 61507, 63127, 69697, 73243, 78979, 80599, 82003, 82813, 83407, 85027
Offset: 1

Views

Author

Keywords

Comments

Intersection of A000040 and A014190. - Michel Marcus, Aug 19 2015

Crossrefs

Cf. A117698 (in base 3), A014190.

Programs

  • Maple
    N:= 14: # to get all terms < 3^N
    Res:= 2:
    digrev:=proc(n) local L;
      L:= convert(n,base,3);
      add(L[-i]*3^(i-1),i=1..nops(L))
    end proc;
    for d from 2 to N do
      if d::even then
        m:= d/2;
        Res:= Res, op(select(isprime,[seq](n*3^m + digrev(n), n=3^(m-1)..3^m-1)));
      else
        m:= (d-1)/2;
        Res:= Res, op(select(isprime,[seq](seq(n*3^(m+1)+y*3^m+digrev(n),
          y=0..2), n=3^(m-1)..3^m-1)));
      fi
    od:
    Res; # Robert Israel, Aug 19 2015
  • Mathematica
    Do[s = RealDigits[n, 3][[1]]; If[PrimeQ[n], If[FromDigits[s] == FromDigits[Reverse[s]], Print[n]]], {n, 1, 8500}]
    Select[Prime[Range[8300]], Reverse[x = IntegerDigits[#, 3]] == x &] (* Jayanta Basu, Jun 23 2013 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if ((d=digits(p,3)) && (Vecrev(d)==d), print1(p, ", "))); \\ Michel Marcus, Aug 19 2015

A117775 Total number of palindromic primes in base 3 below 3^n.

Original entry on oeis.org

1, 1, 3, 3, 6, 6, 18, 18, 26, 26, 73, 73, 179, 179, 459, 459, 1179, 1179, 3004, 3004, 8111, 8111, 22183, 22183, 60789, 60789, 168641, 168641, 469689, 469689, 1322664, 1322664, 3691761, 3691761, 10390938, 10390938, 29502559, 29502559, 84012658, 84012658, 239417332, 239417332
Offset: 1

Views

Author

Martin Renner, Apr 15 2006

Keywords

Comments

Every palindrome with an even number of digits is divisible by 11 (in base 3) and therefore is composite (not prime). Hence there is no palindromic prime with an even number of digits.

Examples

			a(5) = a(6) = 6 as the six palindromic primes below 3^5 are 2_10 = 2_3, 13_10 = 111_3, 23_10 = 212_3, 151_10 = 12121_3, 173_10 = 20102_3, 233_10 = 22122_3. There are no palindromic primes with 6 digits so a(5) = a(6). - _David A. Corneth_, Mar 21 2021
		

Crossrefs

Formula

a(2*k-1) = a(2*k) for k >= 1. - Bernard Schott, Mar 23 2021

Extensions

a(15)-a(42) from the data at A117776 added by Amiram Eldar, Mar 21 2021

A262631 Minimal nested base-3 palindromic primes with seed 1.

Original entry on oeis.org

1, 111, 1111111, 22111111122, 1221111111221, 112211111112211, 2111221111111221112, 2102111221111111221112012, 1212102111221111111221112012121, 20121210211122111111122111201212102, 2002201212102111221111111221112012121022002
Offset: 1

Views

Author

Clark Kimberling, Oct 02 2015

Keywords

Comments

Using only base-3 digits 0,1,2, let s be a palindrome and put a(1) = s. Let a(2) be the least palindromic prime having s in the middle; for n > 2, let a(n) be the least palindromic prime have a(n-1) in the middle. Then (a(n)) is the sequence of minimal nested base-3 palindromic primes with seed s.

Examples

			a(4) = 22111111122 is the least base-3 prime having a(3) = 1111111 in its middle. Triangular format:
         1
        111
      1111111
    22111111122
   1221111111221
  112211111112211
		

Crossrefs

Cf. A261881 (base 10), A262632, A262627. Subset of A117698 (except a(1)).

Programs

  • Mathematica
    s = {1}; base = 3; z = 20; Do[NestWhile[# + 1 &, 1, ! PrimeQ[tmp = FromDigits[Join[#, IntegerDigits[Last[s]], Reverse[#]] &[IntegerDigits[#, base]], base]] &];
    AppendTo[s, FromDigits[IntegerDigits[tmp, base]]], {z}]; s  (* A262631 *)
    Map[FromDigits[ToString[#], base] &, s]  (* A262632 *)
    (* Peter J. C. Moses, Sep 01 2015 *)

A117776 Total number of palindromic primes in base 3 with n digits.

Original entry on oeis.org

1, 0, 2, 0, 3, 0, 12, 0, 8, 0, 47, 0, 106, 0, 280, 0, 720, 0, 1825, 0, 5107, 0, 14072, 0, 38606, 0, 107852, 0, 301048, 0, 852975, 0, 2369097, 0, 6699177, 0, 19111621, 0, 54510099, 0, 155404674, 0
Offset: 1

Views

Author

Martin Renner, Apr 15 2006

Keywords

Comments

Every palindrome with an even number of digits is divisible by 11 (in base 3) and therefore is composite (not prime). Hence there is no palindromic prime with an even number of digits.

Crossrefs

Extensions

a(15)-a(42) from Chai Wah Wu, Dec 27 2015
Showing 1-4 of 4 results.