Questions tagged [palindrome]
Questions related to creating and determining palindromic numbers, words, lists and sub-lists. A palindromic sequence is a sequence that remains the same if we reverse it. An example of a numeral palindrome is "191". An example of a word palindrome is "noon".
14 questions
3 votes
2 answers
139 views
How can I write a function that takes into account multiple boolean conditions?
I might be interpreting this wrong, but my goal is to write a function that receives a k≥2 and gives, as a result, all naturals n such that: n is not a palindrome the last digit of n is not 0 n = m*r(...
2 votes
1 answer
120 views
Palindrome by deleting a character
I need to find a list of strings with input string length n for whom are palindrome by deleting a character from it . The strings are stored inside function ...
2 votes
2 answers
185 views
Creating a large database of all palindromic numbers
OEIS A002113, palindromes in base 10, shows a number of Mathematica constructs. I have used: ...
4 votes
2 answers
247 views
Generating numbers palindromic in two number bases
The purpose of the code below is to generate numbers that are $2d+1$ digit palindromes in number base $b+1$, and are also palindromic in number base $b+3$, where: The ...
2 votes
3 answers
335 views
Finding the largest palindrome which is the product of two 2-digit numbers
My goal is to find the largest palindrome which is the product of two 2-digit numbers using the following program. I want the program to add each palindrome it finds, to the list H. I also want it to ...
13 votes
5 answers
2k views
Largest palindrome from given string
Someone recently posted a request on LinkedIn for an algorithm to find the largest palindrome from a given string. I came up with this, which I believe does the trick, but I am wondering if there ...
3 votes
2 answers
765 views
How to find the palindromic number I'm looking for?
I'm looking for a number which is the same when you read it reverse like 101 or 878. I have to get all numbers from 10 to 1000. There are 99 numbers. {11,...,99,101,...,191,...,202,...,292,...,909,......
2 votes
5 answers
742 views
Prime-palindromic number selected from a list
I want to find all prime-palindromic numbers up to 5000. Prime-palindromic numbers are numbers that themselves and their reverse digits are both primes. For example, 31 is a prime-palindromic number ...
4 votes
2 answers
678 views
What's wrong with my palindrome finding function?
I'm trying to find the palindromes in the dictionary, but my output isn't giving me all of them. I have this so far ...
8 votes
5 answers
376 views
Better way to make a certain list with palindromic sublists
Here is my code, which works, but seems a little too long, I think might be a more refined version. ...
5 votes
3 answers
335 views
Generating a list of pure variables
I want to pass a list of pure variables to a function, in which the ordering of the variables matters. For instance, if I want a palindrome, my function might be: ...
5 votes
10 answers
3k views
How to find palindromic numbers (Project Euler #4)?
I'm trying to solve the fourth Project Euler's problem with this: ...
9 votes
2 answers
438 views
How can I get the list of dates in the next $n$ years
How can I get the list of all dates from today 21.02.2012 (which is a palindrome) up to say next $n$ years? Then finding the other palindromes are not difficult. I could not find an easy way to ...
119 votes
9 answers
6k views
Functional style using lazy lists?
Let's say I want to answer the question "what are the first 400 palindromic prime numbers?" The first approach that comes to my mind from the set of languages that I know is to use some sort ...