Questions tagged [palindrome]
Palindromes are words, phrases, representations of numbers or times which read the same in reverse, for example "level", "reviver", "12321", "10:01". See also the [balanced-string] tag.
100
questions
15
votes
16
answers
1k
views
Pretty Palintiples
Imagine you have a positive integer number \$n\$. Let \$m\$ be the number obtained by reversing \$n\$'s digits. If \$m\$ is a whole multiple of \$n\$, then \$n\$ is said to be a reverse divisible ...
19
votes
10
answers
3k
views
Numbers that can be negated by reading backwards
Balanced ternary is a modified version of ternary (base 3), using the three digits 1,0 and -1...
1
vote
0
answers
171
views
making a binary string palindrome using xor operations [closed]
Problem
You are given a binary string A of length N.
You can perform the following type of operation on the string A:
Choose two different indices \$i\$ and \$j\$ (\$1 \le i\$, \$j \le N\$)
Change \$...
19
votes
7
answers
2k
views
Farigiraf my Girafarig
A palindrome is a word that is its own reverse. I will define the left palindromic root of a word as the shortest prefix of the word for which the shortest possible palindrome that begins with that ...
33
votes
37
answers
3k
views
Is it an alphadrome?
An alphadrome is a word in which each letter in the first half of the word "reflects" its alphabetical "opposite" in the second half of the word. Write a program or function that ...
4
votes
5
answers
282
views
Rotatable numbers (Upside down) [duplicate]
Searching for rotatable numbers, like: 68089
If you consider numbers upside-down,
6 looks like ...
32
votes
14
answers
5k
views
Have you heard of tralindromes?
I haven't. :P So I decided to define one:
A tralindrome is a string which contains three equal-length sections X, Y, Z such that
all characters in the string are included in at least one of the three ...
20
votes
28
answers
3k
views
Rearrange to a palindrome
Given a string, shuffle it so that it becomes a palindrome.
For example, adadbcc can be arranged into dacbcad, or ...
5
votes
19
answers
2k
views
Palindromic Powers
Powers
We define an important power as a number that can be represented as \$ x^y \$ where \$ x ≥ 2 \$ and \$ y ≥ 2 \$.
Palindrome
We define an ...
17
votes
13
answers
1k
views
Recursive palindromes
A palindrome is a word which is spelled the same backwards and forwards. For example, "racecar" is a palindrome as is "redder". A double palindrome is a palindrome whose halves are ...
10
votes
5
answers
471
views
The Most Palindromy Code to Calculate Palindromy Numbers
The string
abaaba
Is a palindrome, meaning it doesn't change when it's reversed. However we can split it in half to make two palindromes
...
5
votes
1
answer
281
views
Tips on golfing this Python program to generate a palindrome from a string
I wrote this function in 48 bytes and I wonder, is there any way to write this code 2 characters shorter?
p=lambda n,c:(n*c)[:n//2]+(n*c)[:n//2+n%2][::-1]
The ...
19
votes
25
answers
3k
views
I palindrome the source code, you palindrome the input!
This is a rip-off of a rip-off of a rip-off of a rip-off of a rip-off. Go upvote those!
Your task, if you accept it, is to write a program/function that outputs/returns its input/args. The tricky ...
23
votes
27
answers
2k
views
Based Palindromes
A palindromic number, as a refresher, is any number which reads the same forward as backwards. However, what about palindromes in other bases?
Input
Any integer b ...
9
votes
8
answers
373
views
Squarefree Palindromes [closed]
Create the shortest function, program, or expression that calculates a sequence of squarefree palindromic numbers.
A squarefree number is one which is not evenly divisible by a square number (i.e. ...