Skip to main content
34 of 39
replaced http://meta.codegolf.stackexchange.com/ with https://codegolf.meta.stackexchange.com/

Answer-Chaining - Positive divisors of a number

This an open challenge, so your answer depends on the one before yours.


#Task:

Print all the positive divisors of a number x taken as input.

###Input:

A single number x which is the number (in base 10) whose positive divisors should be computed.

###Output:

All the positive divisors of x. Any format is allowed, including \n,,,; and whitespace as separators, as long as it's understandable. The output can be an array of Integers or Strings, too (e.g: [1, 2, 3, 5, 30]). You may output the divisors to stdout, console or the equivalent in your language or they can be returned from a function.


#Rules

  • A user may not answer twice in a row
  • Your answer may remove, add or replace at most 15 characters from the previous answer (whitespace does not count), besides for Answer 2 which can "transform" up to 20 characters to get things started
  • You are not allowed to post an answer in a programming language that already has an answer, the exception being a completely different version of that language (e.g: If I post an answer in Python 2.7, you can submit one in Python 3, but not in Python 2.6)
  • Standard loopholes are not allowed
  • You are not allowed to use built-ins for getting divisors, for the sake of this challenge
  • You must include the answer's number and the language name in the question's title and the number of characters changed from the previous answer

#Scoring

The user with the most submissions once the things settle out wins. In case of a tie, the user with the highest score on one of their answer wins. If there is a tie at the score as well, then the user with the oldest submission(oldest highest-scored answer) will be declared the winner.

Note: "settle out" <=> 7 5 days have passed since the last answer was submitted


##Examples:

Input, Output:

14 => [1, 2, 7, 14]
25 => [1, 5, 25]
65 => [1, 5, 13, 65]
114 => [1, 2, 3, 6, 19, 38, 57, 114]

Or any other equivalent output satisfying the mentioned conditions.


Final Note: This question is better if you sort the answers by the oldest. I'll post the first answer in Python 2.7, so you should post the second answer depending on that one. Good luck and have fun!


Leaderboard:

This list may be outdated, fell free to edit it:

1) Wheat Wizard [Current Leader 🏆]: 6 answers - Python 1.6, 05AB1E, Actually, Del|m|t, WSF, Brain-Flak

2) Riley: 3 answers - Seriously, CJam, 2sable

3) Jonathan Allan: 2 answers - Python 3, Jelly

3) ETHproductions: 2 answers - Japt, Pyth

5) Mistah Figgins: 1 answer - Befunge-98

5) Riker: 1 answer - MATL

5) dzaima: 1 answer - SOGL 0.8.2

5) LegionMammal978: 1 answer - Whitespace

5) Nick Clifford: 1 answer - Ohm

5) Lynn: 1 answer - GolfScript

5) MickyT: 1 answer - Cubix

Distance calculator

You can use this snippet to calculate the distance between two entries:

function L(s,t){if(s===t)return 0;var S=s.length,T=t.length;if(S*T===0)return S+T;for(var i=0,v0=[],v1=[];i<=T;i++)v0[i]=i;for(i=0;i<S;i++){v1[0]=i+1;for(var j=0;j<T;j++)v1[j+1]=Math.min(v1[j]+1,v0[j+1]+1,v0[j]+(s[i]!=t[j]));for(j=0;j<=T;j++)v0[j]=v1[j]}return v1[T]}
<textarea id=A rows=10></textarea><textarea id=B rows=10></textarea><br>
Distance: <span id=O>0</span> <button onclick="O.innerHTML=L(A.value.replace(/\s/g,''),B.value.replace(/\s/g,''))">Run</button>

Mr. Xcoder
  • 42.5k
  • 9
  • 81
  • 214