Skip to main content
added 134 characters in body
Source Link
user1502040
  • 3.9k
  • 14
  • 23

Haskell, 215 Characters

a=[1..]
b c(d:e)=(d`div`2):b(c+1)(f e)where f e=g++f h where(_:g, h)=splitAt(c+1)e
c@(_:d)=b 1 a
main=print.cycle.take 6$zipWith3(\e f g->(+g).(*3).head$filter((==f-e).(\h->length$filter((==0).mod h)[1..h]))a) c d a

Can you unravel the logic?

Spoiler:

c (line 3) is the result of halving the numbers in A056526, and main is then generated from A130826.

Haskell, 215 Characters

a=[1..]
b c(d:e)=(d`div`2):b(c+1)(f e)where f e=g++f h where(_:g, h)=splitAt(c+1)e
c@(_:d)=b 1 a
main=print.cycle.take 6$zipWith3(\e f g->(+g).(*3).head$filter((==f-e).(\h->length$filter((==0).mod h)[1..h]))a) c d a

Can you unravel the logic?

Haskell, 215 Characters

a=[1..]
b c(d:e)=(d`div`2):b(c+1)(f e)where f e=g++f h where(_:g, h)=splitAt(c+1)e
c@(_:d)=b 1 a
main=print.cycle.take 6$zipWith3(\e f g->(+g).(*3).head$filter((==f-e).(\h->length$filter((==0).mod h)[1..h]))a) c d a

Can you unravel the logic?

Spoiler:

c (line 3) is the result of halving the numbers in A056526, and main is then generated from A130826.

deleted 4 characters in body
Source Link
user1502040
  • 3.9k
  • 14
  • 23

Haskell, 215 Characters

a=[1..]
b c(d:e)=(d`div`2):b(c+1)(f e)where f e=g++f h where(_:g, h)=splitAt(c+1)e 
c@(_:d)=b 1 a
main=print.cycle.take 6$zipWith6$zipWith3(\e f g->(+f+g).(*3).head$filter((==e==f-e).(\g\h->length$filter((==0).mod gh)[1..g]h]))a)(zipWith(-)d c) d a

Can you unravel the logic?

Haskell, 215 Characters

a=[1..]
b c(d:e)=(d`div`2):b(c+1)(f e)where f e=g++f h where(_:g, h)=splitAt(c+1)e 
c@(_:d)=b 1 a
main=print.cycle.take 6$zipWith(\e f->(+f).(*3).head$filter((==e).(\g->length$filter((==0).mod g)[1..g]))a)(zipWith(-)d c)a

Can you unravel the logic?

Haskell, 215 Characters

a=[1..]
b c(d:e)=(d`div`2):b(c+1)(f e)where f e=g++f h where(_:g, h)=splitAt(c+1)e
c@(_:d)=b 1 a
main=print.cycle.take 6$zipWith3(\e f g->(+g).(*3).head$filter((==f-e).(\h->length$filter((==0).mod h)[1..h]))a) c d a

Can you unravel the logic?

Source Link
user1502040
  • 3.9k
  • 14
  • 23

Haskell, 215 Characters

a=[1..]
b c(d:e)=(d`div`2):b(c+1)(f e)where f e=g++f h where(_:g, h)=splitAt(c+1)e 
c@(_:d)=b 1 a
main=print.cycle.take 6$zipWith(\e f->(+f).(*3).head$filter((==e).(\g->length$filter((==0).mod g)[1..g]))a)(zipWith(-)d c)a

Can you unravel the logic?