# Output this sequence of numbers

Your challenge is to write a program or function to output this sequence of numbers.

Output requirements:

• Must contain numbers specified above
• Must be in order as specified
• Numbers must be delimited by whitespace

Shortest code in bytes wins.

• Ah, feck, I've figured out 2 formulas for this but it's too fiddly to write them up, test them & golf them down on my phone. – Shaggy Jun 12 '17 at 19:23
• OEIS Sequence – Okx Jun 12 '17 at 20:06
• A033312 – Shaggy Jun 12 '17 at 20:18
• Guessing how you've generated a sequence is a poor fit for code golf. Once one person has solved the "puzzle", everyone can copy the idea. – xnor Jun 12 '17 at 20:22
• @xnor Alright, I'll add modified version – user1761786 Jun 12 '17 at 20:23

# Python, 76 bytes

from math import*
s=2**32-5
for i in range(6499):print((s-factorial(i+1))%s)


# Python, 84 bytes

from math import*
k=s=2**32-6
for i in range(6499):s-=i*factorial(i);s%=k+1;print(s)

• Do you really need k=? As far as I can tell, k=s=... and s never changes so why not remove the k= and make %k into %s? – caird coinheringaahing Jun 12 '17 at 22:38
• @cairdcoinheringaahing thanks – Uriel Jun 12 '17 at 22:57
• You can save 1 cheap byte by not importing *; Try it online! – musicman523 Jun 24 '17 at 0:11

# Python 3, 148 bytes

a=
n=6499
N=2**32-5
exec("a+=[a[-1]*len(a)%N];"*n)
a=[i*a[i]for i in range(n)]
for i in range(1,n):a[i]=(a[i]+a[i-1])%N
print([N-i-1 for i in a])


Try it online!

Surely this can be golfed.

• Took you literally 10 minutes :) – Mr. Xcoder Jun 12 '17 at 19:26
• @Mr.Xcoder I only checked the beginning and the end though. – Leaky Nun Jun 12 '17 at 19:26

# Charcoal, 39 bytes

Ａ⁻Ｘ²¦³²¦⁵σＡ¹φＡ¹κＦ⁶⁴⁹⁹«⁺﹪⁻σφσ¶Ａ⁺κ¹κＡ×φκφ


Try it online!

## Explanation

Ａ         σ                                    Assign to s
⁻Ｘ²¦³²¦⁵                                     2 ** 32 - 5
Ａ¹φ                                Assign 1 to f (factorial)
Ａ¹κ                            Assign 1 to k
Ｆ⁶⁴⁹⁹«                     For i from 0 to 6498
⁺﹪⁻σφσ¶             (s - f) % s + "\n" (implicitly printed)
Ａ⁺κ¹κ       k = k + 1
Ａ×φκφ Assign f * k to f


# 05AB1E, 19 bytes

žJ5-6499FDN>!-sDŠ%,


Try it online!

Only checked first and last numbers. If you run it TIO will probably take a while to print them all

Explanation

žJ5-                # (2 ** 32) - 5; call this x
6499F           # for N in 0 .. 6498. Stack entering loop: [x]
D          # duplicate. Stack: [x, x]
N>        # N + 1. Stack: [x, x, N + 1]
!       # factorial. Stack: [x, x, (N + 1)!]
-      # subtract. Stack: [x, x - (N + 1)!]
s     # swap. Stack: [x - (N + 1)!, x]
D    # duplicate. Stack: [x - (N + 1)!, x, x]
Š   # cycle last three items. Stack: [x, x - (N + 1)!, x]
%  # modulus. Stack [x, (x - (N + 1)!) % x)]
, # pop and print. Stack: [x]