Numbers which are not the sum of distinct squares: Difference between revisions

→‎{{header|Quackery}}: missed out the code for unique
(Added Quackery.)
(→‎{{header|Quackery}}: missed out the code for unique)
Line 962:
Finally, <code>missing</code> generates a list of the numbers which are not SODS from the list of SODS. (This is why we need to trim the list; so it does not include the numbers which are SODS but had not yet been added to the list.)
 
<syntaxhighlight lang="Quackery"> [ stack [] is cutswap
behead swap
witheach
[ 2dup = iff
drop done
dip join ]
join ] is unique ( [ --> [ )
 
[ stack ] is cut ( --> s )
 
[ -1 cut put
1 temp put
Line 968 ⟶ 977:
behead swap
witheach
[ tuck - -1 = iff
iff
[ dip 1+
over temp share
> if [ over temp replace
[ over i^ cuttemp replace ] ]
else i^ cut replace ] ]
[ nip 1 swap ] ]else
[ nip 1 swap ] ]
2drop
temp take cut take ] is maxrun ( [ --> n n )
 
[ [] swap 0 over
Line 984 ⟶ 993:
[ dup i^ bit & not if
[ dip [ i^ join ] ] ]
drop ] is missing ( [ --> [ )
 
1 temp put
1,462

edits