All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Palindromic and prime (Posted on 2013-12-30) Difficulty: 3 of 5
For what values of x the expression 2x^2+2x+1 is palindromic and prime?

x=1 is the 1st answer.

Please provide three others.

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution Comment 1 of 1

   10   for X=1 to 999999
   20   Y=2*X*(X+1)+1
   30   if prmdiv(Y)=Y then
   40     :if fnPalin(Y)=1 then print X,Y
   45   if prmdiv(Y)=0 then print "x=";X;"y=";Y;" is too big":end
   50   next
   60   end
 1000   fnPalin(N)
 1010     T=1:S=cutspc(str(N))
 1020     for I=1 to int(len(S)/2)
 1030       if mid(S,I,1)<>mid(S,len(S)+1-I,1) then T=0
 1040     next
 1050    return(T)

finds
  x      expression
 1       5
 9       181
 12      313
 1262    3187813
x= 92682 y= 17180091613  is too big

The last line indicates that when x got to 92,682, the expression became 17,180,091,613, which is too large for the test of primality used in the program.


  Posted by Charlie on 2013-12-30 17:45:16
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information