Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Happy-numbers/FALSE/happy-numbers.false
Normal file
15
Task/Happy-numbers/FALSE/happy-numbers.false
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
[$10/$10*@\-$*\]m: {modulo squared and division}
|
||||
[$m;![$9>][m;!@@+\]#$*+]s: {sum of squares}
|
||||
[$0[1ø1>][1ø3+ø3ø=|\1-\]#\%]f: {look for duplicates}
|
||||
|
||||
{check happy number}
|
||||
[
|
||||
$1[f;!~2ø1=~&][1+\s;!@]# {loop over sequence until 1 or duplicate}
|
||||
1ø1= {return value}
|
||||
\[$0=~][@%1-]#% {drop sequence and counter}
|
||||
]h:
|
||||
|
||||
0 1
|
||||
"Happy numbers:"
|
||||
[1ø8=~][h;![" "$.\1+\]?1+]#
|
||||
%%
|
||||
Loading…
Add table
Add a link
Reference in a new issue