Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 7231

The challenge involves mathematics. Also consider using more specific tags: [number] [number-theory] [arithmetic] [combinatorics] [graph-theory] [geometry] [abstract-algebra].

0
votes
Smalltalk Squeak 4.x flavour, 91 char in the form of a block: [:p||b|b:=Bag new.p do:[:x|p do:[:y|b add:(x dist:y)]].b valuesAndCounts asSet={4. 8}asSet] Test it with: { "Example squares:" {0@ …
answered May 3 '13 by aka.nice
2
votes
Smalltalk (Pharo 2.0) (41 ln) 3.713572066704308 Pharo -headless Pharo-2.0.image eval "FileStream stdin nextLine asNumber log:41" No syntactic sugar is Smalltalk's pride, just regular sentence ;)
answered Apr 20 '13 by aka.nice
0
votes
Squeak Smalltalk, fast version 111 octets - 25 bonus: 86 In class String, define method: d|h s t|h:=self first:1.(s:=self size-1)>0or:[^h+1*h/2].t:=self last:s.^s*9+h-1*(5 raisedTo:s)<<(s-1)+t+1*h+t …
answered Jan 16 '14 by aka.nice
2
votes
C #include "stdio.h" int main() {{ int i,j,s,d; /* auto test */ for(i=1;i<=2;i++) {{ j=i; d=diff(i,j); s=sum(j,j); if( d != 0 || s != 2*i ) ab …
answered Nov 25 '15 by aka.nice
0
votes
C, 56 bytes c=1;f(char*a){c=-c;*a&16?c+=1-*a-1[a],c&=2,c/=2:f(a+1);} Hint: only the last two bits count. The basic idea was to use least significant bit for storing result of factorial, and next …
answered Feb 10 '17 by aka.nice