login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A225603 Palindromic primes whose square is also a palindrome. 2

%I #11 Jan 08 2015 17:34:10

%S 2,3,11,101,100111001,110111011,111010111,1100011100011,1100101010011,

%T 1101010101011,100110101011001,101000010000101,101011000110101,

%U 101110000011101,10000010101000001,10011010001011001,10100110001100101,10110010001001101,10111000000011101

%N Palindromic primes whose square is also a palindrome.

%C Subsets of A002385, A057135 and A065378.

%C Palindromes in A161721. Conjecture: a(n) for n >=3 consists only of the digits 0,1. - _Chai Wah Wu_, Jan 06 2015

%H Chai Wah Wu, <a href="/A225603/b225603.txt">Table of n, a(n) for n = 1..27</a>

%e 101 is a member since it is a palindromic prime such that 101^2=10201 is a palindrome.

%t palQ[n_]:=FromDigits[Reverse[IntegerDigits[n]]]==n; t={}; Do[If[palQ[p=Prime[n]] && palQ[p^2],AppendTo[t,p]],{n,10^7}]; t

%o (Python)

%o from __future__ import division

%o from sympy import isprime

%o def paloddgenrange(t,l,b=10): # generator of odd-length palindromes in base b of 2*t <=length <= 2*l

%o ....if t == 0:

%o ........yield 0

%o ....else:

%o ........for x in range(t+1,l+1):

%o ............n = b**(x-1)

%o ............n2 = n*b

%o ............for y in range(n,n2):

%o ................k, m = y//b, 0

%o ................while k >= b:

%o ....................k, r = divmod(k,b)

%o ....................m = b*m + r

%o ................yield y*n + b*m + k

%o A225603_list = [2,3,11]

%o for i in paloddgenrange(1,10):

%o ....s = str(i*i)

%o ....if s == s[::-1] and isprime(i):

%o ........A225603_list.append(i) # _Chai Wah Wu_, Jan 06 2015

%Y Cf. A002385, A057135, A065378.

%K nonn,base

%O 1,1

%A _Jayanta Basu_, May 11 2013

%E a(15)-a(19) from _Giovanni Resta_, May 11 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 09:49 EDT 2024. Contains 371967 sequences. (Running on oeis4.)