from Hacker News

World’s longest palindrome?

by rmeertens on 8/9/18, 7:52 AM with 57 comments

  • by AndrewOMartin on 8/9/18, 5:16 PM

    "A man, a plan, a canoe, pasta, heros, rajahs, a coloratura, maps, snipe, percale, macaroni, a gag, a banana bag, a tan, a tag, a banana bag again (or a camel), a crepe, pins, Spam, a rut, a Rolo, cash, a jar, sore hats, a peon, a canal-- Panama!" - Guy Steele, CLTL2
  • by asimjalis on 8/10/18, 4:00 AM

    See banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, banana, bees.

    For any N "See [banana,]* bees." can be longer than N.

  • by sp332 on 8/9/18, 5:36 PM

  • by marzell on 8/9/18, 7:10 PM

    How does this count as a palindrome? It's just a bunch of nonsense words (ignoring all the acronyms, are the rest all actually even really words?) separated by commas, that doesn't even seem to pretend to take on the structure of a sentence.

    Am I misunderstanding the level of coherence of the text? If the requirements are that loose, it seems it would be trivial to generate a 'palindrome' of arbitrary length.

  • by kiliankoe on 8/10/18, 12:44 PM

    I was recently dumbfounded by the fact that

        ()() 
    
    is not a palindrome, but

        ())(
    
    is. It's obvious, sure, but it still doesn't look right.
  • by DonaldFisk on 8/10/18, 1:39 PM

    The longest palindrome has infinite length. Start with any palindrome, e.g. "radar". You can make a new palindrome: "radar, sides reversed, is radar". That can then be used to create the palindrome "radar, sides reversed, is radar, sides reversed, is radar, sides reversed, is radar".

    You can repeat this indefinitely.

  • by techbio on 8/10/18, 2:33 AM

    "Never odd or even" is one some here might like to see, and perhaps suggests the shorter palindrome, "NaN".
  • by chipuni on 8/9/18, 5:44 PM

    World's shortest palindrome:
  • by lazycouchpotato on 8/9/18, 6:01 PM

    There's a link which takes you to the list of palindrome dates mentioned on the website [1]. There's 38 of them, but they all take the MM/DD/YYYY format into consideration. I wonder how much of a difference it would be by taking DD/MM/YYYY instead.

    [1] https://www.livescience.com/33583-palindrome-dates-21st-cent...

  • by fnayr on 8/10/18, 12:07 PM

    Different word trivia that I find fascinating that I feel HNers will also appreciate:

    (twelve plus one) is an anagram of (eleven plus two)

    I guess that should be called a mathagram?

  • by SippinLean on 8/9/18, 7:27 PM

    I was a fan of this palindromic short story (also in honor of the year 2002): http://spinelessbooks.com/2002/palindrome/
  • by nathell on 8/10/18, 10:35 AM

    Here's a handcrafted one in Polish, 33K+ characters: http://www.palindromy.pl/pal_naj.php
  • by nathell on 8/10/18, 10:40 AM

    I'm also reminded of this IOCCC entry: https://www.ioccc.org/1987/westley/westley.c. Strictly speaking, it's not composed of palindromes because of the mirror-image brackets and slashes, but still, impressive.
  • by type_enthusiast on 8/10/18, 1:49 PM

    I have to point out Weird Al's "Bob": https://www.youtube.com/watch?v=JUQDzj6R3p4

    It's not a palindrome, but is a semi-sensical song masterfully composed entirely out of palindromes (which also does a great job poking fun at Bob Dylan).

  • by jacquesm on 8/10/18, 11:35 AM

    This one is a valid sentence in Dutch:

    "Nelli plaatst op n parterretrap n pot staalpillen."

    The 'n's are a bit of an issue though, 'n in dutch means 'een', but reversed that doesn't work so the 'e's got dropped and replaced by "'" but they move from one side of the n's to the other in the reversal.

  • by User23 on 8/10/18, 1:40 AM

    We used find the longest palindrome in a string as an interview question at Amazon back in 2004
  • by psalminen on 8/9/18, 6:00 PM

    Hug of death?
  • by etiennemarcel on 8/10/18, 12:37 PM

  • by luizfzs on 8/10/18, 1:51 PM

    8102018 is not a palindromic because it isn't a valid format date (it is, but is nonsense, so not valid on my standards :).

    examples of valid date formats are: yyyy-mm-dd dd-mm-yyyy

  • by evilolive on 8/9/18, 7:54 PM

    engage le jeu que je le gagne
  • by Aardwolf on 8/10/18, 10:30 AM

    For single words, in Dutch there is:

    koortsmeetsysteemstrook

  • by elwell on 8/9/18, 5:33 PM

    Go hang a salami, I'm a lasagna hog.
  • by LearnerHerzog on 8/10/18, 5:51 AM

    I thought the point of palindromes were that they

    1: Are the same forwards and backwards

    2: Make coherent sense

    Still pretty cool nonetheless, I suppose

  • by imtringued on 8/9/18, 9:50 PM

    This palindrome is surprisingly disappointing. Almost every word appears 100s of times...
  • by lowercased on 8/10/18, 10:30 AM

    My 2 "go to" palindromes...

    I know a fat man called Ella C Namtafawnoki.

    I got hang of fog nah togi.

  • by quickthrower2 on 8/10/18, 10:30 AM

    Whats with Sadick? (15 times!). Also the F*, C and S words!
  • by mkstowegnv on 8/10/18, 4:04 PM

    For a line level palindrome homage to Douglas Hofstadter's Crab Canon see

    https://juliagalef.com/2017/02/21/a-poem-for-douglas-hofstad...

  • by ehonda on 8/9/18, 5:59 PM

    wo nemo toss a lasso to me now!
  • by white-flame on 8/9/18, 7:22 PM

    Rotavator