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.

A051835 Palindromic Sophie Germain primes.

Original entry on oeis.org

2, 3, 5, 11, 131, 191, 12821, 14741, 19391, 19991, 36563, 38183, 93239, 96269, 1028201, 1074701, 1150511, 1178711, 1243421, 1281821, 1317131, 1333331, 1407041, 1456541, 1508051, 1532351, 1557551, 1598951, 1600061, 1609061
Offset: 1

Views

Author

Warut Roonguthai Dec 11 1999

Keywords

Comments

p and 2p+1 are primes (cf. A005384) and p is a palindrome.

Crossrefs

Programs

  • Maple
    makepali:= proc(n, d) local L; # case with d odd
      L:= convert(n, base, 10);
      10^((d-1)/2)*n + add(L[i]*10^((d+1)/2-i), i=2..(d+1)/2)
    end proc:
    N:= 100: # for a(1)..a(N)
    R:= 2,3,5,11: count:= 4:
    for d from 3 by 2  while count < N do
      for i in [1,3,7,9] while count < N do
        for x from 0 to 10^((d-1)/2)-1 while count < N do
          y:= makepali(i*10^((d-1)/2)+x,d);
          if isprime(y) and isprime(2*y+1) then
            R:= R, y;
            count:= count+1;
           fi
    od od od:
    R; # Robert Israel, Nov 22 2020
  • Mathematica
    Select[Prime[Range[125000]],PrimeQ[2#+1]&&PalindromeQ[#]&] (* Harvey P. Dale, Nov 21 2021 *)