Numbers which are not the sum of distinct squares: Difference between revisions
Numbers which are not the sum of distinct squares (view source)
Revision as of 01:02, 6 October 2023
, 7 months ago→{{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"> [
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
[ nip 1 swap ] ]
2drop
temp take cut take ]
[ [] swap 0 over
Line 984 ⟶ 993:
[ dup i^ bit & not if
[ dip [ i^ join ] ] ]
drop ]
1 temp put
|