Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

10
votes
24answers
2k views

Password Bishop Goodness

Derived from this, now deleted, post. Given a string, answer (truthy/falsy or two consistent values) if it constitutes a good Bishop password, which is when all the following conditions are met: it ...
7
votes
1answer
195 views

A Radiation Hardened Palindromic Quine

There are radiation hardened quines, palindromic quines, but has anyone tried both?! I think not! Rules So the challenge here is to make a quine that if any symbol is deleted it prints its original ...
-1
votes
1answer
116 views

Every positive integer can be written as the sum of 3 palindrome integers. Wha'ts the largest possible palindrome integer for each integer n? [duplicate]

Let n be a positive integer then n = a + b + c for some a, b, and c that are palindrome integers. What is the largest possible integer ...
14
votes
12answers
1k views

Stitch Together a Palindrome from Palindromic Substrings

Given a string l, find all palindromic substrings p of l (including duplicates and single ...
5
votes
9answers
369 views

Length of the Longest Palindromic Substring [duplicate]

A palindrome is a string which is the same when read forwards and backwards. For example "racecar" is a palindrome, but "Racecar" is not. A substring is a contiguous set of characters in a larger ...
12
votes
12answers
1k views

List all palindromic prime dates between 0000-01-01 and 99999-12-31

You know what a palindrome, a prime and a date are. Your task is to list all dates in 100 thousands of years that fulfill all three characteristics. Nevermind anything but the numbers, use the ...
47
votes
24answers
5k views

Downgrade to a Palindrome

Given a string s, return the smallest contiguous substring you can remove to create a palindrome. Examples: ...
61
votes
18answers
8k views

Yo boy, must it sum

Every positive integer can be expressed as the sum of at most three palindromic positive integers in any base b≥5.   Cilleruelo et al., 2017 A positive integer is palindromic in a given base if ...
5
votes
7answers
766 views

Smaller-Base Palindromes

For the purpose of this challenge, a smaller-base palindrome (SBP) is a number which is palindromic in a base between 1 and itself (exclusive), and is not a repdigit in the same base. For example, 5 ...
8
votes
14answers
518 views

Count the Palindromes [duplicate]

Given a number n, calculate the amount of bases in the range of [2, n) in which b(n) is a ...
29
votes
25answers
2k views

Palindromic numbers with a binary twist

Warning : this is NOT a "hey, let's draw a cake in ASCII-art" challenge! Please keep reading ;) Some time ago it was my birthday, I'm 33 now. So there is this awkward social tradition consisting in ...
5
votes
1answer
233 views

Find the Closest Double Palindrome

Given a double-precision float, find the closest double-precision float whose binary representation is a palindrome. Input A floating point number x. You may use ...
5
votes
16answers
904 views

Emoticon numbers!

(related) Your challenge is to output the highest number you can. You can output as a number or as a string. You must output something that matches the regex ^\d+$,...
18
votes
14answers
2k views

Fully-palindromic triangles

Consider the string 160615051. It can be "triangulated" as such: 1 606 15051 Then, each row is a palindrome. Also note ...
53
votes
37answers
4k views

User Appreciation Challenge #1: Dennis ♦

I got the spontaneous idea of making a series of challenges of users that have helped and continue to help the PPCG community be an enjoyable place for everyone, or maybe just specifically for me. :P ...
25
votes
11answers
5k views

Perfect Palindromes

Your task is to determine how much of a perfect palindrome a string is. Your typical palindrome (eg 12321) is a perfect palindrome; its perfectness is 1. To determine the perfectness of a string, you ...
15
votes
9answers
2k views

Palindromic Primes without 11

Every palindrome with an even number of digits is divisible by 11, so 11 is the only [palindromic prime] with an even number of digits. - David Wasserman, OEIS I learned this today the manual way, ...
15
votes
16answers
3k views

Never odd or even

Did you notice, that this is a palindrome? Input Non-negative integer number or string representing it Output 4 possible outputs, representing two properties of number: is it palindrome tricky #2 ...
25
votes
12answers
1k views

Palindromic Residue

Today, as I'm writing this, is March 31st. In the US, this is 3/31. I was playing around with 331 as a number to come up with a ...
11
votes
6answers
404 views

Numbers that are palindromes in N bases

Given an non-negative integer n >= 0, output forever the sequence of integers x_i >= 3 that are palindromes in exactly <...
13
votes
16answers
966 views

Number of string permutations that are palindromes

Your input will be a string consisting of small english letters. Your task is to determine the number of distinct permutations of the original string that are a palindrome. The input string has up ...
103
votes
67answers
25k views

I'm a palindrome. Are you?

There have been a couple of previous attempts to ask this question, but neither conforms to modern standards on this site. Per discussion on Meta, I'm reposting it in a way that allows for fair ...
0
votes
0answers
60 views

Complete my palindrome [duplicate]

Create a function (preferably) or a program that takes an ordered collection and outputs the smallest possible palindrome that starts with the input. For example: ...
10
votes
10answers
451 views

Smallest Multiple to “Palindromize” [duplicate]

Goal: Given any non-zero natural number a, find the smallest non-zero natural number b such that ...
5
votes
4answers
594 views

The Essential™ (comment-free) Convenient Palindromic Quine Golf

A program is "conveniently palindromic" if it is equal to the string derived when its reverse has all its parentheses (()), brackets (...
40
votes
32answers
3k views

Goodness Giza Golf!

A "Giza number", also colloquially known as a Timmy Number is any number where the digits represent a pyramid (A134810). For example, "12321" is a giza number because it can be visualized like this: <...
15
votes
15answers
2k views

Palindrome polyglot

Your task is to write a program that runs in two different languages, and does the following: In one language, it palindromizes a given string. Take the string. ...
16
votes
7answers
757 views

Minimum insertions to make palindrome

Today you will be doing another palindrome challenge! So, your task today is to take a string, and determine the minimum amount of letters required to insert to turn it into a palindrome. For ...
7
votes
8answers
383 views

What degree is this palindrome?

Your task is to determine the palindromic degree of a given non-empty string. To do this, loop until one of the following conditions are met: The string is not a palindrome. You encounter a string ...
46
votes
63answers
5k views

Depalindromize this string!

Given a palindrome generated according to this challenge, depalindromize it. Test cases ...
13
votes
23answers
2k views

Palindromize this string! [duplicate]

Your task is to palindromize a string as follows: Take the string. abcde Reverse it. edcba Remove the first letter. <...
23
votes
14answers
2k views

Find the super palindromes!

Consider the number 99999999. That number is obviously a palindrome. The largest prime factor of 99999999 is 137. If you divide 99999999 by 137, you get 729927. This number is also a palindrome. ...
18
votes
3answers
423 views

Smallest Hamming distance to a palindrome containing a substring

This was inspired by a now removed CS.SE question. Task Given two non-empty input strings A and B, output the smallest distance from A to a palindrome that contains B as a substring. Distance is ...
6
votes
3answers
283 views

Alexa and the Tea Plantation

Hey guys, first time poster here. I went on Coderoulette recently and some guy posted this question. I looked around online but it doesn't seem to be anywhere. I figured I would post it here for ...
25
votes
2answers
2k views

Write a Palindrome-Polyglot-Quine

Write a "palipolyquine": a program that is a quine, a polyglot, and a palindrome. Rules: The number of polyglot languages is more preferable than code size. The shortest answer (in bytes) wins, in ...
14
votes
12answers
670 views

Non-palindromic numbers

A strictly non-palindromic number N is a number that isn't a palindrome in any base (in bases 2 to N-2). These numbers are listed on OEIS For example, the number ...
22
votes
39answers
4k views

Smallest palindrome divisible by the input

Given a positive integer N, output the smallest positive integer such that this number is a palindrome (i.e. is its own reverse) and is divisible by ...
18
votes
14answers
2k views

Permutapalindromic numbers

Given an integer N as input, output the Nth permutapalindromic number. A permutapalindromic number is a strictly positive ...
30
votes
14answers
3k views

Where should I put my mirror?

This is a mirror: |. I just found out that you can stick a mirror in the middle of a string if the string can be mirrored on itself! For example, the string ...
18
votes
13answers
1k views

Forecast Palindromic Dates

Palindromic dates are dates that appear as palindromes: the string of digits can be read the same way backwards as forwards. For the North American date format (MM/DD/YYYY), the next few palindromic ...
22
votes
25answers
1k views

Print the Nth non-palindromic number

A palindromic number (in case you don't know) is a number which reads the same backwards and forwards (example, 11). The first 15 non-palindromic numbers are: ...
31
votes
32answers
6k views

Watson-Crick palindromes

Problem Create a function that can determine whether or not an arbitrary DNA string is a Watson-Crick palindrome. The function will take a DNA string and output a true value if the string is a ...
30
votes
24answers
3k views

Palindromizing the strings

Introduction For the ones who don't know, a palindrome is when a string is equal to the string backwards (with exception to interpunction, spaces, etc.). An example of a palindrome is: ...
-7
votes
4answers
328 views

Write a palindrome that prints “Hello, World!” without using comments [duplicate]

Your Task: Print "Hello, World!" using a palindrome. Simple, right? Nope. You have one restriction: you may not use comments. "Comments" include Normal // or <...
20
votes
14answers
1k views

All your base palindromic belong to us

Generate the sequence number of bases in which n is a palindrome (OEIS A126071). Specifically, the sequence is defined as follows: given a number ...
13
votes
8answers
612 views

Palindromic Prime Factors

Palindromic prime problems are pretty common, but that's not what this question is about. In this challenge, the number doesn't have to be a palindrome, its prime factors do. Task Your code has to ...
27
votes
24answers
2k views

Atbash Self Palindromes

Consider the Atbash transformation: A|B|C|D|E|F|G|H|I|J|K|L|M Z|Y|X|W|V|U|T|S|R|Q|P|O|N Where A ⇔ Z and L ⇔ O, e.g. There is an interesting property that ...
14
votes
4answers
449 views

Chunky palindromes

Palindromes are fun, but some of the other strings are starting to feel left out. We can turn those strings into chunky palindromes by splitting them up into palindromic arrays of chunks. For example,...
5
votes
4answers
426 views

Returning the range of a number as a palindrome

I like to do programming challenges in my free time to teach myself and keep fresh, this one I can't seem to optimize though and it's driving me insane. The goal is essentially, "Given a number, ...
26
votes
56answers
2k views

Palindrome Hello, World

Your task is to create a program that prints "Greetings, Planet!" exactly to the console. Seems simple enough, right? Well, here's the trick. The code must be a palindrome, meaning it reads from right ...