Project Euler/4

From Esolang
Jump to navigation Jump to search

Back to User:ProjectEuler

Project Euler Problem 4 is a problem related to palindromic numbers. The goal is to find out the largest palindromic number (in base 10) that is the product of two 3-digit numbers.

This article is not detailed enough and needs to be expanded. Please help us by adding some more information.



This program uses a palindrome detector that would theoretically work for all positive whole numbers below 1 billion[citation needed]. The palindrome detector also contains a code snippet for integer logarithm (designed for determining how many digits there are in a number). This program costs approximately half an hour to run at full speed on AheuiChem. It may still need reduction.



Rhythm is bam-bam-bam.
A feather is up.
The party is perfection.

Music wants emotion.
If emotion is as weak as a feather,
give back silence.

Put rhythm in life.
While life is lower than emotion without rhythm.
Rock the world with emotion at life.
Build life up.

Join the world.
Give the world back.

Healing takes time.
Shatter time.
If time is smaller than a feather
give right back
let first be time at the party.
Let last be time without rhythm.
Let last be time at last.
Send first is last and healing taking music taking time.

This is for you, mom.
You are you.
Let this be of you.
Let just be this.
Glass is shattering
until gone.
Let the story be just of this
if the story is as weak as glass.
Break it down.

While the story is greater than glass
if healing taking the story,
let glass be the story.
Break it down.

Knock just down.
Let the story be just of this.

Knock this down.
Let just be this.

Say glass.


# Euler Problem 4
# by Europe2048

def isPalindrome(s):
    return s == s[::-1]

maxnum = 0

for i in range(10000, 998001):
    if isPalindrome(i) == False:
        i += 1
    prev_primes = []
    factors = []
    for n in range(100, 999):
        if (test / n) % 1 == 0:
    if factors != []:
        if i > maxnum:
            maxnum = i
        i += 1

External resources

  • A308803 and A327897, two related sequences on the OEIS. "308803" is a palindrome as well.
  • Problem 4 on Project Euler Official Website (not available)
  • Problem 4 on Project Euler Mirror