6
\$\begingroup\$

CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?

6779686932717976703238326711110010511010332671049710810810111010310111558327311032116111100971213911532991049710810810111010310144321211111173910810832981013297115107101100321161113211211410511011632116104101321021111081081111191051101033211810111412132115112101991059710832657868321161141059910712132657868321159711610511510212110511010332801141051091013278117109981011144646463332651141013212111111732103111108102101114115321141019710012163
   

Your task is to output this 442-digit Prime Number

Rules

Your code must not contain any odd decimal digits. So numbers 1,3,5,7,9 (ASCII 49,51,53,55,57) are forbidden.

This is . The shortest code in bytes wins.

So... what is so special about this prime number anyway?
You may find this out yourselves. If you don't, I'll tell you next week!

EDIT
Since this challenge is going to close, I will give a hint to my friend @xnor:
The challenge IS the number (this is why it is called "Prime Challenge")

\$\endgroup\$
24
  • 17
    \$\begingroup\$ Whatever is special about this number presumably helps in shortening the code. Once an answer finds out the others can do the same. So I don't see the point in hiding that information in the challenge \$\endgroup\$
    – Luis Mendo
    Aug 19, 2020 at 18:31
  • 10
    \$\begingroup\$ I think challenges like this that are partly a puzzle in disguise are both a bad idea for the reasons Luis Mendo said, and likely off-topic for the site. \$\endgroup\$
    – xnor
    Aug 19, 2020 at 19:31
  • 3
    \$\begingroup\$ @J42161217 Right, I think the key difference is that the ternary number is indeed random and has nothing secret up its sleeve. I've seen a number of attempts at challenges that start as basically "solve the puzzle of what pattern I made", and I remember them having been downvoted. \$\endgroup\$
    – xnor
    Aug 19, 2020 at 19:38
  • 14
    \$\begingroup\$ Now that Guiseppe has solved the puzzle and revealed the pattern, I have to say I'm disappointed in the task that remains. Like, perhaps the puzzle was interesting for Guiseppe or anyone who wants to solve it, but for a golfer it's now basically "hardcode/compress this fixed string". It's cool that you found a prime that's produced this way, but it being prime doesn't matter at all for golfing. I was hoping there would be something special mathematically about this prime, but as is, I think the challenge text's emphasis on it being prime makes this even more a chameleon challenge. \$\endgroup\$
    – xnor
    Aug 19, 2020 at 21:23
  • 5
    \$\begingroup\$ @HighlyRadioactive I'd say this is a simple CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready? compression challenge \$\endgroup\$ Aug 20, 2020 at 4:12

17 Answers 17

16
\$\begingroup\$

R, 195 bytes

(SPOILER IF YOU WANT TO FIGURE IT OUT YOURSELF)

cat(utf8ToInt("CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?"),sep="")

Try it online!

Not the golfiest language to use for , but it does the trick.

\$\endgroup\$
1
  • 14
    \$\begingroup\$ Well done! But -sigh- (SPOILER) then the challenge not only hides the pattern; it also tries to mislead the reader with red herrings in the title (the key idea is not related to prime numbers) and in the rules (not being able to use odd digits doesn't add any difficulty) \$\endgroup\$
    – Luis Mendo
    Aug 19, 2020 at 21:05
5
\$\begingroup\$

x86-16 machine code, IBM PC DOS, 206 bytes

Binary:

00000000: be24 01b1 aaac d40a 5086 e0d4 0a05 3030  .$......P.....00
00000010: 86e0 3c30 7402 cd29 86e0 cd29 5804 30cd  ..<0t..)...)X.0.
00000020: 29e2 e2c3 434f 4445 2047 4f4c 4620 2620  )...CODE GOLF &
00000030: 436f 6469 6e67 2043 6861 6c6c 656e 6765  Coding Challenge
00000040: 733a 2049 6e20 746f 6461 7927 7320 6368  s: In today's ch
00000050: 616c 6c65 6e67 652c 2079 6f75 276c 6c20  allenge, you'll
00000060: 6265 2061 736b 6564 2074 6f20 7072 696e  be asked to prin
00000070: 7420 7468 6520 666f 6c6c 6f77 696e 6720  t the following
00000080: 7665 7279 2073 7065 6369 616c 2041 4e44  very special AND
00000090: 2074 7269 636b 7920 414e 4420 7361 7469   tricky AND sati
000000a0: 7366 7969 6e67 2050 7269 6d65 204e 756d  sfying Prime Num
000000b0: 6265 722e 2e2e 2120 4172 6520 796f 7520  ber...! Are you
000000c0: 676f 6c66 6572 7320 7265 6164 793f       golfers ready?

Listing:

BE 0124   MOV  SI, OFFSET TXT     ; string offset
B1 AA     MOV  CL, 170            ; string length
      CHAR_LOOP:
AC        LODSB                   ; AL = next char
D4 0A     AAM                     ; AL = AL % 10, AH = AL / 10
50        PUSH AX                 ; save units digits
86 E0     XCHG AH, AL             ; swap digits
D4 0A     AAM                     ; AL = AL % 10, AH = AL / 10
05 3030   ADD  AX, '00'           ; ASCII convert
86 E0     XCHG AH, AL             ; swap digits
3C 30     CMP  AL, '0'            ; is highest digit a '0'?
74 02     JZ   TWODIG             ; if so, don't display leading zero
CD 29     INT  29H                ; display hundreds digit
      TWODIG:
86 E0     XCHG AH, AL             ; swap digits
CD 29     INT  29H                ; display tens digit
58        POP  AX                 ; restore units digit
04 30     ADD  AL, '0'            ; ASCII convert
CD 29     INT  29H                ; display units digit
E2 E2     LOOP CHAR_LOOP          ; loop until end of string
C3        RET                     ; return to DOS
      TXT:
          DB 'CODE GOLF & Coding Challenges: In today',27H,'s challenge, '
          DB 'you',27H,'ll be asked to print the following very special '
          DB 'AND tricky AND satisfying Prime Number...! Are you golfers ready?'

enter image description here

\$\endgroup\$
4
  • 1
    \$\begingroup\$ The trick with multi-line spoilers is to put two spaces at the end of every line. Otherwise it all gets garbled onto one line. \$\endgroup\$
    – Noodle9
    Aug 19, 2020 at 21:51
  • \$\begingroup\$ Hmm. Both ASM listing and machine code contain odd numbers, which were forbidden. \$\endgroup\$
    – gastropner
    Aug 19, 2020 at 22:01
  • 2
    \$\begingroup\$ @gastropner, no the challenge specifically forbids ASCII 49,51,53,55,57. Codepoint \x01 != '1' :) \$\endgroup\$
    – 640KB
    Aug 19, 2020 at 22:03
  • \$\begingroup\$ @640KB Ah, I see! I saw the 1 in the text, which corresponds to 0xB1. My bad! \$\endgroup\$
    – gastropner
    Aug 19, 2020 at 22:04
4
\$\begingroup\$

Io, 186 bytes

"CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?"foreach(print)
Try it online!

Explanation

Io's default syntax for defining strings actually defines a "sequence", that is basically a list of ord codes.

During foreach, Io treats every character of the sequence as it's respective ord code (don't believe it? try "abc"at(0))

"..."               // The big string, from other answers
     foreach(     ) // For every codepoint in this string:
             print  //     output this codepoint without a newline

\$\endgroup\$
4
\$\begingroup\$

05AB1E, 93 bytes

”›ˆ‚³...!€™”‘€ƒ‘D”Âïªï:€†”‘ƒËŠˆ‘“ÿ & ÿƒÜ's›Ý,€î'll€ï‹Ð€„…¢€€„—‚ÒƒÑ ÿÐËy ÿËØing ÿ€îŠˆersŽä?“ÇJ

Try it online.

Explanation:

”›ˆ‚³...!€™”  # Push (titlecased) dictionary string "Prime Number...! Are"
‘€ƒ‘D         # Push (uppercased) dictionary string "AND" and duplicate it
”Âïªï:€†”     # Push (titlecased) dictionary string "Coding Challenges: In"
‘ƒËŠˆ‘        # Push (uppercased) dictionary string "CODE GOLF"
“ÿ & ÿƒÜ's›Ý,€î'll€ï‹Ð€„…¢€€„—‚ÒƒÑ ÿÐËy ÿËØing ÿ€îŠˆersŽä?“
              # Push (regular) dictionary string "ÿ & ÿ today's challenge, you'll be asked to print the following very special ÿ tricky ÿ satisfying ÿ you golfers ready?",
              # where the ÿ are automatically filled with the strings on the stack
Ç             # Convert each character to its codepoint integer
J             # And join all those together
              # (after which the result is output implicitly)

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why ”›ˆ‚³...!€™” is "Prime Number...! Are"; ‘€ƒ‘ is "AND"; ”Âïªï:€†” is "Coding Challenges: In"; ‘ƒËŠˆ‘ is "CODE GOLF"; and “ÿ & ÿƒÜ's›Ý,€î'll€ï‹Ð€„…¢€€„—‚ÒƒÑ ÿÐËy ÿËØing ÿ€îŠˆersŽä?“ is "ÿ & ÿ today's challenge, you'll be asked to print the following very special ÿ tricky ÿ satisfying ÿ you golfers ready?".

\$\endgroup\$
3
\$\begingroup\$

Japt, 133 bytes

As will be the case with every solution to this, all credit here belongs to Giuseppe!

`CODE GOLF & CoÜA Câ%s: In Üþs å¡e, y'¥ ¼ k  pÎC e èÄg vy special AND Éky AND Ñsfyg PÎX Num¼r...! A y goÓÈs Î%y?`mc

Try it

\$\endgroup\$
3
\$\begingroup\$

Keg, 177 141 bytes

`CODE GOLF & Coding Challenges: In nL;'s r⊂;, you'll be 0⑵; to a⑱; the 1⟱; 0K; 4∀; AND ⬨⑺; AND Q&; Prime Number...! Are you :G;ers 1⑾;?`÷^(ⁿ.

Try it online!

Yeah, it the same technique as everyone else. Now with string compression.

\$\endgroup\$
3
\$\begingroup\$

Python 2, 202 bytes

print''.join(`ord(x)`for x in"CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?")

Spoiler tag misinterprets the backticks and anyway, it's probably not necessary any more.

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ This is same as Noodle9's initial Python answer. \$\endgroup\$ Aug 20, 2020 at 11:42
  • \$\begingroup\$ @ManishKundu Noodle9's original answer wasn't there by the time I posted this :) \$\endgroup\$
    – ElPedro
    Aug 20, 2020 at 14:19
3
\$\begingroup\$

Pyth, 118 175 bytes

jkCM"CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?

Try it online!

Due to a rushed answer, my original source didn't give the correct number. I was only checking the first and last numbers and assumed the rest was correct.

\$\endgroup\$
5
  • \$\begingroup\$ Pyth uses (the wholly inadequate) Schocco for string compression, too? \$\endgroup\$
    – Shaggy
    Aug 19, 2020 at 23:21
  • \$\begingroup\$ @Shaggy Not a clue XD I picked it up yesterday afternoon and just seeing what works. \$\endgroup\$
    – Scott
    Aug 20, 2020 at 1:28
  • 4
    \$\begingroup\$ Your code does not print the right number \$\endgroup\$ Aug 20, 2020 at 2:07
  • \$\begingroup\$ It looks like Pyth _doesn't use Schocco to me but, even if it did, you're missing a good few characters from the string - your total byte count should be 3 greater than mine. \$\endgroup\$
    – Shaggy
    Aug 20, 2020 at 20:45
  • \$\begingroup\$ Hm from some digging, it appears Pyth does have some methods to compact strings and numbers - I just can't get any of them to work. I'm giving up for now and just settling for a mediocre score. \$\endgroup\$
    – Scott
    Aug 20, 2020 at 23:15
3
\$\begingroup\$

Python 3, 202 196 bytes

Saved 6 bytes thanks to Manish Kundu!!!

print(*map(ord,"CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?"),sep='')

Try it online!

Port of Giuseppe's R answer.

\$\endgroup\$
2
  • \$\begingroup\$ 196 bytes with Python 3 tio.run/##NY3LCsIwFAV/… \$\endgroup\$ Aug 19, 2020 at 21:27
  • \$\begingroup\$ @ManishKundu Sweet - tihanks! :-) \$\endgroup\$
    – Noodle9
    Aug 19, 2020 at 21:37
3
\$\begingroup\$

Deadfish~, 1442 bytes

{{i}ddddd}iiiicicciicdddciicddciiicddddddcdciiiiicddddddciiiiiiciicddcdcic{d}iiiciiicdciciiiiicdddddcdciiiicicddddddccccdccicdciiiiicddddccdcicdciiiccdciiiicicddddddcdciiiiciiiiicddcddddddcdc{i}ddc{d}iiicdc{i}ddc{d}iiicdcicccdcicdciiicddcdciccciiiicciiicdddddcdciiiiicddddcddccdciiicdcdcciiiiicdddddccccdcc{i}dcddcddddddcicdciiciiiiiic{d}iicciiiicddcdc{i}dddcc{d}iicdciiiiciiiiicddcddddddcdc{i}ddc{d}iiicdc{i}ddc{d}iiicdcicccdcicdciiicddcdciciiiccdcdcdcicdcccccciiiiiicddddciiiiiic{d}iicdc{i}ddc{d}iiicdc{i}ddcdddddcdc{i}dddcdc{d}iiicdciciicdc{i}dddcddcddddddcciiiicddddcdc{i}dddcddddddcdciccdcciiicdcdcciiiiicdddddccciicdcdccicdcciiicdddcdciiiiicddddccdcicciiiiicdddcdcdcciiiiicdddddcdciiiicdddcdciciicdcdcdciicdccccdc{i}ddc{d}iiicdc{i}ddc{d}iiiccccc{i}ddc{d}iicdciiiiicddddccdcicdciiiccdcdcc{i}dddc{d}iiicdciccciiicdddcicdciicdcdcciiiicddddccicdcdcic{i}ddcc{d}iicdciiiiiciiiicddcddddddcdc{i}ddcdddddcdciiiicdciicicddciicdddddcdcdcciiiiicdddddcciiicdddcdciiiiiciiiicc{d}iicdc{i}dddcddddddcicdciicdciiiicdciicicddciicdddddcdcdcciiiiciiiicddcddddddcciiiiicdddddcdciiiiicddddcciiiicddddcdciicdcicdccdciiiiicddddccdcicdciiiccdciiiiiic{d}iicicciiicdddcdciiiiicddddcdc{i}dc{d}iicdciciicdciiiiicic{d}iiicciiiiiicddddddcdc{i}dccdc{d}iiicdciccciiicciicddciicddciicdddcccdciiiicdcddddcciiicdddcdciciicdcdcicdcccccciiiiiicddddcdcdcdciiicddccccdc{i}ddc{d}iiicdciicdcdciccciiicdddcciiiicddcdcdcciiicdddcdcic{i}ddcddcddddddcdccicicdciiiiicdddc{d}{d}i{c}cc
\$\endgroup\$
1
  • \$\begingroup\$ Sorry, that's TIO's fault. Removed. \$\endgroup\$
    – emanresu A
    Feb 25, 2021 at 3:28
2
\$\begingroup\$

C (gcc), 213 211 210 211 bytes

f(){for(char*s="CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?";*s;)printf("%d",*s++);}

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ 211 bytes. \$\endgroup\$
    – Noodle9
    Aug 19, 2020 at 22:41
  • \$\begingroup\$ @Noodle9 Yeah, just changed to the same. \$\endgroup\$
    – gastropner
    Aug 19, 2020 at 22:41
2
\$\begingroup\$

PHP, 200 bytes

while($c=ord("CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?"[$i++]))echo$c;

Try it online!

\$\endgroup\$
2
\$\begingroup\$

Bash, 237 bytes

s="CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?";o=o
for((i=0;i<${#s};i++));do printf %d \'"${s:$i:${#o}}";done

Try it online!

Port of Giuseppe's R answer.

\$\endgroup\$
2
\$\begingroup\$

05AB1E, 121 bytes

'€ƒuð.ø’CODE GOLF & Cod±µ Cí¤ÁÛ¡¾: In ƒÜ's ›Ý, €î'½ž €ï ‹Ð €„ …¢ €€ „— ‚Ò ƒÑÿÐËyÿËرµ P؆e Nuîв¡...! A‚™ €î Šˆ²¡s Žä?’ÇJ

Try it online!

'€ƒuð.ø’...’ÇJ  # trimmed program
'€ƒ             # push "and"...
   u            # uppercase...
     .ø         # surrounded by...
    ð           # spaces
                # (ÿ in the long compressed string gets implicitly replaced with this)
             J  # join...
            Ç   # charcodes of...
       ’...’    # "CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?"
                # implicit output

The hardest part of this wasn't writing the code, it was trying to get the Markdown to work.

\$\endgroup\$
2
\$\begingroup\$

Perl 5, 190 bytes

say"CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?"=~s/./ord$&/ger

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Vyxal, 108 bytes

¬⋎ »₅ & ⟩₆ →ṗ: In ¬¾'s ɾṖ, λ•'ll be •₇ to ⟑Ẇ λλ ∧ṫ ƛ² ¬∪ AND ¦Ṡy AND ¶⊍ing ʁ꘍ ƛṅ...! λ∆ λ• »₅ers €æ?+Cṅ Needed to optimize the string little to compress it well

Try it Online!

\$\endgroup\$
1
\$\begingroup\$

Knight, 195 bytes

;=s" CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?"W=sGsT LsO++''As'\'

Try It Online!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.