Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
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 56148

Number theory involves properties and relationships of numbers, primarily positive integers.

0
votes
Java, 133 bytes int d(int n){String s=""+n;return n<71?n:d(Integer.parseInt(s.replaceFirst(".$",""))-Integer.parseInt(""+s.charAt(s.length()-1))*2);} I hate how verbose Integer.parseInt is. Ungolfe …
answered Aug 5 '16 by Justin
1
vote
Java 8, 220 bytes import java.util.stream.IntStream; char a(int n){return IntStream.range(1,n+2).map(i->IntStream.range(1,i).filter(k->i%k==0).sum()).mapToObj(Integer::toString).collect(java.util.str …
answered Aug 4 '16 by Justin
2
votes
Java, 163 160 bytes boolean p(int n){for(int i=2;i<n;)if(n%i++==0)return 0>1;return 1>0;} int f(int[]a,int n){return n<0||n>=a.length?1:p(n)?n<a[n]?1:1+f(a,a[n-a[n]]):1+f(a,a[n]);} p(n) is for prim …
answered Aug 4 '16 by Justin
5
votes
Java 8, 81 bytes k->{for(int i=0,j;i<=k;i++)for(j=0;j<=k;)if(i*i+j*j+i*j++==k)return 1;return 0;}; simple, naïve implementation. coincidentally same code as C# but uses -> rather than =>.
answered Aug 4 '16 by Justin