Daydream

From Esolang
Jump to navigation Jump to search
Daydream
Paradigm(s) Declarative
Designed by User:Hakerh400
Appeared in 2022
Computational class Not applicable
Major implementations Implemented
File extension(s) .txt

Daydream is an esoteric programming language invented found by User:Hakerh400 in 2022.

Overview

Let be an infinite list of natural numbers. The initial (-th) element is . The -th element is equal to the sum of all previous elements that are not divisible by .

Source code consists of a single natural number . The output are the first elements of sequence , separated by spaces. Input is ignored.

Background

The author saw the specification of this language in a dream. Despite the language being useless, the author decided to document it anyway.

Terms of the sequence

Access Daydream/Terms to see the first 100 terms of the sequence.

Implementation

Since the language is pointless, here is a pointless implementation in Haskell:

i = id
k = const
(#) = flip
infixr 9 #
infixr 9 !
f g = g (f g)
(!) a b c = a c (b c)
t a b c = if a then b else c

main=getLine>>=(putStrLn.unwords.map show.f(((take.fromIntegral)#).
  ((map.(((#).((!)(t.(>0)).(((!).((#)((.).((sum.).filter.((>0).).
  (mod#)))))#i)))#1))#[0..]))).(read::String->Integer)