# Search Results

Results tagged with Search options user 41723
54 results

Challenges related to elementary arithmetic.

Given three sidelengths of a triangle, evaluate its aspect ratio AR given the following formula: where The closer to equilaterality a triangle is, the closer to 1 its aspect ratio is. The aspect …
asked Nov 27 '16 by Fatalize
Take a positive integer X. This number is part of the sequence we are interested in if the sum of all digits of X is a divisor of X, and if the product of all digits of X is a divisor of X. For examp …
asked Nov 29 '16 by Fatalize
Brachylog, 10 bytes <.='e3:I'* Try it online! Explanation (?)<. Output > Input .= Assign a value to the Output . 'e3 3 cannot be an element of the …
answered Nov 3 '16 by Fatalize
J, 7 questions/answers, none about J echo a%b[echo a*b[echo a-b[echo a+b[b=:?2147483647 [a=:?2147483647 It's a pretty damn cheap way to do it, I'm not gonna lie. Here are the SO answers I used: e …
answered Jul 26 '15 by Fatalize
Brachylog, 18 bytes ∧5~lLȧᵐ≥₁∧L^₃ᵐ.+?∧ Try it online! Explanation We basically describe the problem, with the additional constraint that we want the output list to be non-increasing in terms of m …
answered Apr 4 '18 by Fatalize
Brachylog, 3 bytes ḋd× Try it online! A very original answer... Explanation ḋ Take the prime factors of the Input d Remove duplicates × Multiply
answered May 11 '17 by Fatalize
Brachylog, 8 bytes ḋoọc;1xc Try it online! Explanation Example input: 60 ḋ Prime decomposition: [5,3,2,2] o Order: [2,2,3,5] ọ Occurences: [[2,2],[3,1],[5,1]] c …
answered Jun 9 '17 by Fatalize
Given an integer N, output the Nth positive number K with the following property in decimal base: For each digit I at position P of K, the number formed from K by removing the Pth digit (i.e. I) is d …
asked Jun 14 '16 by Fatalize
Brachylog, 8 bytes ;I≜+{6}ᵐ Try it online! Explanation ;I The list [Input, I] ≜ Assign a value to I: 0, then 1, then -1, then 2, etc. + Sum Input with I {6}ᵐ A …
answered May 21 '17 by Fatalize
Brachylog, 2 bytes +. Expects a list with the two numbers as input Alternatively, if you want the answer to STDOUT: +w
answered Jul 2 '16 by Fatalize
Brachylog, 13 12 bytes l+₁:?⊇ᶠ⁽⌋ᵐb↔ Try it online! Saved one byte thanks to @ais523. Explanation l+₁:? The list [length(Input) + 1, Input] ⊇ᶠ⁽ Find the length(Input) + 1 …
answered Apr 27 '17 by Fatalize
SWI-Prolog, 381 bytes s([E|T],[F|N]):-E=F,(N=[];s(T,N));s(T,[F|N]). a(A):-split_string(A," \n","",B),w(B,[],C),setof(L,s(CJMPRS,L),M),x(C,[ |M]). w([A,B|T],R,Z):-number_string(N,A),(B="",C= ;st …
answered Jul 7 '15 by Fatalize
Brachylog, 13 bytes ~c@e:{<+}a!#= Try it online! Explanation ~c Find a list of integers which when concatenated result in the Input @e Split the integers into lists of …
answered Sep 30 '16 by Fatalize
Brachylog, 6 bytes {÷|%}ᶠ Try it online! Explanation We abuse the metapredicate ᶠ findall to apply two different predicates to the Input list of two arguments: { }ᶠ Findall for the Inp …
answered Mar 27 '17 by Fatalize
Brachylog, 35 32 bytes lL,?:ef+:?:L+I,(0>?h:2*:Ir-:1+.;I.) lL,(0>?h:1--I;I0),?b:ef+:?:L:I+. Explanation lL, L is the length of the Input ( 0>? Input < 0 h:1--I I …
answered Jun 30 '16 by Fatalize

15 30 50 per page