# The second even sublime number

easy mode of my previous challenge

A perfect number is a positive integer whose sum of divisors (except itself) is equal to itself. E.g. 6 (1 + 2 + 3 = 6) and 28 (1 + 2 + 4 + 7 + 14 = 28) are perfect.

A sublime number (OEIS A081357) is a positive integer whose count and sum of divisors (including itself) are both perfect. E.g. 12 is a sublime number because:

• the divisors of 12 are 1, 2, 3, 4, 6, 12
• the count of divisors is 6 (perfect)
• the sum of divisors is 28 (perfect)

The next smallest known sublime number is

6086555670238378989670371734243169622657830773351885970528324860512791691264


which is a product of a power of 2 and six Mersenne primes

$$2^{126}(2^3-1)(2^5-1)(2^7-1)(2^{19}-1)(2^{31}-1)(2^{61}-1)$$

These two numbers are the only known sublime numbers as of 2022. The necessary and sufficient conditions for even sublime numbers have been found in this paper (pdf), but it remains unknown whether odd sublime numbers exist.

It is known that there are no other even sublime numbers before the number, but it is not known whether there are any odd ones.

Output the second even sublime number shown above. It is OK to only theoretically output this number in the following ways:

• the program outputs the correct number with probability 1 in finite time
• the program outputs the correct number given enough time and unlimited memory
• the program would output the correct number if the native number type had infinite precision

Standard rules apply. The shortest code in bytes wins.

• @thejonymyster It is known that there are no other even sublime numbers below that number. Aug 26, 2022 at 1:10
• So... I'm wondering that... Is there any built-in in Mathematica output this?
– tsh
Aug 26, 2022 at 6:36
• ///, 76 bytes, optimal solution: 6086555670238378989670371734243169622657830773351885970528324860512791691264 Aug 26, 2022 at 17:19
• "the program outputs the correct number with probability 1 in finite time": do you mean to imply as well that there is no other output? Aug 27, 2022 at 0:50
• @GregMartin I think other output will be considered a loophole. See codegolf.meta.stackexchange.com/a/9447/55372 Aug 28, 2022 at 10:57

# PARI/GP, 45 bytes

print(vecprod([4^i-2^i|i<-[3,5,7,19,31,61]]))

Attempt This Online!

The number is $$\\prod_{i\in\{3,5,7,19,31,61\}}(4^i-2^i)\$$. In fact, $$\126=3+5+7+19+31+61\$$.

Another interesting fact is that $$\2^{126}\$$ is just the sum of divisors of $$\\prod_{i\in\{3,5,7,19,31,61\}}(2^i-1)\$$. This might be useful for some golfing language if there is a built-in for divisor sum.

# Python 2, 37 bytes

print~-2**31*~-2**61*14448825433<<126


Try it online!

Writes out $$\2^{31}-1\$$, $$\2^{61}-1\$$, and the bit-shift $$\2^{126}\$$, and hardcodes the remaining product.

# R, 33 32 bytes

Edit -1 byte thanks to @xnor.

prod(8^42,2^c(3,5,7,19,31,61)-1)


Try it online!

Spells out the product.

@alephalpha's approach lead to +1 byte for me, but @Dominic van Essen found a 32-byte version (see the footer of the TIO link above).

• You can do 8^42 for 2^126
– xnor
Aug 26, 2022 at 4:36
• @xnor ah, right, thanks! Aug 26, 2022 at 6:24
• (alephalpha's approach could be the same length: try it)... Mar 27 at 8:48

# 05AB1E, 13 11 bytes

•w4н•foD<*P


-2 bytes thanks to @alephalpha.

Try it online.

Explanation:

•w4н•        # Push compressed integer 3772545
f       # Get its prime factors: [3,5,7,19,31,61]
o      # Get 2 to the power for each of these integers
D     # Duplicate the list
<    # Decrease each by 1 in the copy
*   # Multiply the values at the same positions in the two lists
P  # Get the product of this list
# (after which the result is output implicitly)


See this 05AB1E tips of mine (section How to compress large integers?) to understand why •w4н• is 3772545.

• -2 bytes: •w4н•foD<*P Aug 26, 2022 at 8:28
• @alephalpha Ah, of course. Thanks! :) Aug 26, 2022 at 8:32

# Pyth, 20 19 16 15 bytes

*FsmtB^2dPC"9


Try it online!

*FsmtB^2dPC"9
C"9  # compressed 3772545
P     # prime factors (3, 5, 7, 19, 31, 61)
mtB^2d      # map d: [2**d, 2**d - 1]
s            # flatten
*F             # reduce on multiplication


-3 bytes thanks to @CursorCoercer
-1 byte thanks to @isaacg

• Save 3 bytes by replacing .U*bZ with *F Aug 26, 2022 at 16:18
• Save 1 byte by replacing m-^4d^2d with smtB^2d Aug 28, 2022 at 0:52

# Vyxal, 1413 11 bytes

»;⟑L»ǐE:‹*Π


Try it Online!

-1 byte thanks to alephalpha and -2 bytes thanks to Mukundan314.

# Jelly, 17 16 bytes

“¤¦¬Œþ=‘2*’æ«21P


Try it online!

-1 byte thanks to xnor.

• Might it be shorter to multiply each list element by 2^21 instead of the bit-shift at the end?
– xnor
Aug 26, 2022 at 1:19
• @xnor It's 2^126, and it's longer (“¤¦¬Œþ=‘2*’P×2*126¤) Aug 26, 2022 at 1:35
• I meant to multiply each element of [7, 31, 127, 524287, 2147483647, 2305843009213693951] by 2^21 (probably via bit-shift) so that when we take their product, we've included an overall factor of (2^21)^6=2^126.
– xnor
Aug 26, 2022 at 1:42
• Ah, clever. That saves a byte on the Jelly answer (not on Vyxal because 126 could be compressed). Thanks! Aug 26, 2022 at 1:44
• Aug 26, 2022 at 2:51

# Factor + math.unicode,  40 38 bytes

4 2 [ "=">array n^v ] bi@ v- Π .


Try it online!

-2 bytes from porting @alephalpha's PARI/GP answer.

Note "=" is a literal string that is equivalent to { 3 5 7 19 31 61 }. You can only see the = since the rest are non-printable, but you can see the non-printable characters on TIO. This needs to be converted to an array because n^v is buggy otherwise. Still 4 bytes shorter than the sequence literal.

• 4 2 [ ... ] bi@ Apply [ ... ] to both 4 and 2.
• { 3 5 7 19 31 61 } n^v Input raised to 3, input raised to 5, etc.
• v- Subtract two vectors.
• Π Take the product.
• . Print the result to stdout.

# Bash, 47 Bytes

echo "14448825433*(2^31-1)*(2^61-1)*(2^126)"|bc


Try it online!

# Wolfram Language (Mathematica), 32 bytes

8^42##&@@(2^{3,5,7,19,31,61}-1)&


Try it online!

# Prolog (SWI), 51 bytes

Thanks JoKing and Steffan for helping me golf some bytes

?-X is(2^61-1)*14448825433*(2^31-1)*2^126,write(X).


Try it online!

My very first Prolog answer :D, probably can be golfed a lot though.

• you can just do write(X). Sep 2, 2022 at 1:02
• also you can change X is 14448825433*(2^61-1) to X is(2^61-1)*14448825433 to save a byte. unfortunately it's the same length to use format: ?-format("~d",(2^61-1)*14448825433*(2^31-1)*2^126). Sep 2, 2022 at 1:02
• @Steffan ah ok didn't know that, will fix Sep 2, 2022 at 1:02
• @Steffan ok that format trick is cool Sep 2, 2022 at 1:04

# Charcoal, 21 bytes

ＩΠＥＸ²⁻Ｅ357COm℅ι⁴⁸×ι⊖ι


Try it online! Link is to verbose version of code. Explanation:

       357COm           Literal string 357COm
Ｅ                 Map over characters
ι         Current character
℅          ASCII code
⁻                  Vectorised subtract
⁴⁸       Literal integer 48
Ｘ                    Vectorised exponentiate with base
²                   Literal integer 2
Ｅ                     Map over powers of 2
ι   Current power of 2
⊖    Decremented
×      Multiplied by
ι     Current power of 2
Π                      Take the product
Ｉ                       Cast to string
Implicitly print


# MathGolf, 15 bytes

357HT╟)]ó_(m*ε*


Try it online.

Explanation:

3        # Push 3
5       # Push 5
7      # Push 7
H     # Push 19
T    # Push 31
╟   # Push 60
)  # Increase the 60 by 1
] # Wrap the stack into a list: [3,5,7,19,31,61]
ó        # Calculate 2 to the power each of these integers
_       # Duplicate the list
(      # Decrease each by 1
m*    # Multiply the values at the same positions in the lists together
ε*  # Product: reduce by multiplication
# (after which the entire stack joined together is output implicitly as result)


# MATL, 21 19 18 14 bytes

3772545YfWtqhp


Try it online!

3772545YfWtqhp
3772545Yf         # Prime factorize 3772545 (3, 5, 7, 19, 31, 61)
W        # 2 ** elements
t       # duplicate list
q      # decrement elements in copy by 1
h     # concatenate lists
p    # product


-2 bytes thanks to @Luis Mendo

# Nibbles, 16 15 12.5 bytes

*.D62*;^2$-$~ a8532dc3


Attempt This Online!

-2.5 bytes thanks to Dominic van Essen

Nibbles has no prime-related built-ins, so I had to resort to good old base conversion.

*.D62*;^2$-$~ a8532dc3
*                       Product
.                       for each n in
D62                    convert from base 62
a8532dc3    2824023491
*                   multiply
^2                 2 to the power of
$n ;$              with itself
- ~              minus 1

• 14 bytes Mar 27 at 8:27
• 12.5 bytes Mar 27 at 8:32
• @DominicvanEssen Nice, I didn't notice that the 126 is the sum of the exponents. Thanks! Mar 27 at 9:40

# Burlesque, 33 bytes

{Jfc~]++==}s1r1f{fcsa%1!j++%1!&&}


Try it online!

Given infinite time, should find sublime numbers

{    # IsPerfect function
J   # Duplicate
fc  # Factors
~]  # Without self
++  # Sum
==  # Equals self
}s1  # Store as "1"
r1   # Range 1..inf
f{   # Filter
fc  # Factors
sa  # Non-destructive Length
%1! # IsPerfect
j++ # Sum of factors
%1! # IsPerfect
&&  # And
}


# Vyxal, 16 13 bytes

₆¨*≬K₍L∑¨=∆Kc


Try it Online!

half-Legitimate calculation is was shorter than hard coding lol. Given enough time and memory, this would eventually output the right number.

## Explained

₆¨*≬K₍L∑¨=∆Kc
₆¨*≬        c   # From all multiples of 64 (which contains the target number), get the first where:
K₍L∑        #   The list [len(factors), sum(factors)]
¨=∆K    #   Is invariant under sum of proper divisors

• If the code means "last of the first two integers that are sublime", it isn't correct because there might be an unknown odd sublime number before the 2nd even one. Aug 26, 2022 at 0:38
• @Steffan That was exactly the initial version of this answer and my first comment explains why it doesn't work. Aug 26, 2022 at 1:01
• You could speed things up slightly by replacing ₆ with ₈, because the target number is a multiple of 256. Aug 26, 2022 at 1:02
• It's no longer shorter than hardcoding it :P Aug 26, 2022 at 3:13
• why does my answer appear higher than yours, lol Mar 29 at 17:10

# Jelly, 12 bytes

⁹Æs;ÆdÆṣƑƲ1#


A full program that will (eventually!) print the result.

Don't Try it online!
The ⁹ starts the search at 256, if one replaces it with 1 it'll find 12 - try that here.

Faster in 13:

“;Y,’Æf2*×’\$P


Try it here.

# Python, 49 46 45 bytes

print(2**126*14448825433*(2**31-1)*(2**61-1))

• There are some more easy golfs, which will lead to basically xnor's solution. Aug 26, 2022 at 6:22

# Thunno, $$\ 17 \log_{256}(96) \approx \$$ 13.99 bytes

3772545AF2@D1-z*P


Attempt This Online!

Port of Kevin Cruijssen's 05AB1E answer.

3772545AF2@D1-z*P
3772545            # Push 3772545                (there's no integer compression in Thunno)
AF          # Prime factors of that       ([3, 5, 7, 19, 31, 61])
2@        # 2 ** each one               ([8, 32, 128, 524288, 2147483648, 2305843009213693952])
D1-     # Duplicate and subtract one  ([7, 31, 127, 524287, 2147483647, 2305843009213693951])
z*   # Multiply                    ([56, 992, 16256, 274877382656, 4611686016279904256, 5316911983139663489309385231907684352])
P  # Product of the list         (6086555670238378989670371734243169622657830773351885970528324860512791691264)


# Pyt, 2217 16 bytes

3772545ǰϼ2⇹^Đ⁻*Π


Try it online!

3772545             push 3, 7, 7, 2, 5, 4, 5
ǰ            ǰoin elements on stack with no delimiter
ϼ          get unique ϼrime factors (casts to integer)
2⇹^       raise 2 to each power
Đ⁻     Đuplicate; decrement
*    element-wise multiplication
Π   product of list; implicit print


# Jelly, 30 bytes

My first Jelly answer! Hope I'll get better in the future.

2*’
[3,5,7,19,31,61]ç
¢×/æ«126


Attempt This Online!

# J, 23 bytes

echo*/(,<:)2^q:3772545x


echo*/(,<:)2^q:3772545x