text:
Approximate Mills' Constant
The Task
Write a program or function which, when passed some positive integer n as input, returns Mills' Constant accurate up to n digits.
The Definition
Mills' Constant worked out to six thousand digits may be located here.
Examples
Let f be the function described by the challenge.
>>> f(1)
1

>>> f(3)
1.31

>>> f(100)
1.306377883863080690468614492602605712916784585156713644368053759966434053766826598821501403701197396

Rules

Your program must print or return Mills' Constant for any n between 1 and 1000.
Your program must approximate Mills' Constant such that all digits between the first to the nth returned or output are accurate to Mills' Constant. Extraneous digits are disallowed.
No form of hard-coding may be used. This means directly storing the digits of Mills' Constant or storing any of Mills' Primes (including those unlisted within OEIS). This rule includes compression. The solution must generate the number, not just output it.
The final digit must be rounded according to the digit following the final digit. In other words, if digit n+1 is five or greater, add one to the final digit.
Built-in functions or constants relating directly to Mills' Constant or the Riemann zeta function may not be used.
You may assume that the Riemann hypothesis is true.

Why is f(1) 1? 1 is not a prime number. And floor(1^(3^x)) is 1 for any input.

@orlp Please read more carefully: the point of the challenge is to approximate the Mills' constant to some digit n, where n is the input.

Alright. I was thinking that f(n) meant it had to be accurate for the first n primes.

@orlp That would be difficult. There's only been 10 Mills' primes discovered so far, which requires an incredible precision for the Mills' constant.

May we hardcode the limit of n = 1000?

@orlp As in, hard coding the number to never go past 1000?

As in, assuming the input will never go over 1000, and not acquire more precision needed to cover that.

@orlp Yes, of course.

The "Definition" section doesn't actually define the number, it just states a property of it. According to Wikipedia, it's defined as the "smallest positive real number" which has that property. Also, some guidance/links for how to calculate it, would be appreciated. Not everyone here is a mathematician...

@smls This challenge is intentionally difficult. I hope my hints relating to the Riemann zeta function and the Riemann hypothesis are aides enough. I have removed the unnecessary part of the definition section.

J, 31 bytes: (":(3^9)%:([:4&p:^&3)^:9]2){.~] doesn't work because J seems to crash every time it wants to calculate the 7th or greater mills prime. RIP.

-1 the challenge isn't self contained, and the "definition" link is not particularly helpful

Difficult != obtuse

@VoteToClose I think the definition needs to be contained in the question. I shouldn't have to visit an external link to understand the challenge. Thanks. Voting to close as unclear until it's fixed.

Python 2 + gmpy2, 132 123 bytes
from gmpy2 import*
get_context().precision=9999
n=2
exec"n=next_prime(n**3);"*8
print"{:.{}f}".format(root(n,3**9),input())

The 9th Mill's prime provides enough precision for 1000 digits. So we calculate that prime, and then use it to calculate the constant.
To speed up the program a lot, replace the exec statement with:
mills = [2]
for o in [3, 30, 6, 80, 12, 450, 894, 3636, 70756, 97220, 66768, 300840]:
    mills.append(mills[-1]**3 + o)
n = mills[8]

Ah - going for the Mills' primes method instead of the Riemann zeta. Never considered that. +1

The loop can be written as exec"n=next_prime(n**3);"*8. You can also write n as an expression eval('next_prime('*8+'2'+'**3)'*8), but I think that's longer.


text:
Count the characters - bit by bit!
The simple part: Given an input string containing only printable ASCII-characters (space - tilde), count the number of occurrences of each character and return the result on any convenient format. The result for a string a%hda7a should be something like: a:3, %:1, h:1, 7:1, d:1. Sorting is unnecessary, the delimiters and formats are optional but it must be easily understood which number corresponds to which character. You shall not include characters that are not in the input string (a:3, b:0, c:0, d:1, ... is not OK).
The real challenge:
Convert every character in your code to an 8-bit binary number (or 16-bit if you're using UTF-16 or similar), and enumerate every character starting at 0.
For every character (i is the enumerator), the i%7-bit1 must be 1. The bits are numbered from the right. All other bits can be whatever you want.
Let's use the following code as an example:
[f]-xif)#f

Converting this to binary we get the array below. The first number (representing [ has a 1 in the 0'th position, so that one is OK. The second number (representing f has a 1 in the 1'st position, so that one is OK too. Continue like this, and you'll see that the code above is valid.

C  76543210  Bit number
-  --------  ----------
[  01011011  0   - OK
f  01100110  1   - OK
]  01011101  2   - OK
-  00101101  3   - OK
x  01111000  4   - OK
i  01101001  5   - OK
f  01100110  6   - OK
)  00101001  0   - OK
#  00100011  1   - OK
f  01100110  2   - OK

If we change the code into: ]f[-xif)#f we'll get the following start of the sequence:
C  76543210  Bit number
-  --------  ----------
]  01011101  0   <- OK
f  01100110  1   <- OK
[  01011011  2   <- Not OK
-  00101101  3   <- OK

As we see, the third character [ doesn't have a 1 in the 2nd position (zero-indexed), and this code is therefore not valid.
Test cases:
Input:
This is a string containing some symbols: ".#!".#&/#

Output:
   !  "  #  &  /  :  T  a  b  c  e  g  h  i  l  m  n  o  r  s  t  y  .
7  1  2  3  1  1  1  1  2  1  1  1  2  1  5  1  2  4  3  1  6  2  1  2

Any reasonable output format is OK (whatever is most convenient to you). You could for instance have: :7, !:1, ":2, #:3, &:1, /:1, T:1, a:2 ... or [ ,7][!,1][",2][#,3][&,1].... The output is on any standard way (return from function, printed to STDOUT etc.)
1i modulus 7.

This is code-golf, so the shortest code in bytes will winref.

To be of a little assistance, here are the characters you're allowed to use in the n%7th spot > http://pastie.org/pastes/10985263/text

@TidB the website is offline??

@Rod Yeah, pastie seems to have some problems. Try pastebin instead

Remember that newline is 00001010. It can be useful too! :)

Yeah, I only included the printable ASCII characters that you can identify quickly. Tabs, newlines etc. aren't included, not speaking about the extensive charset of esoteric languages :D

To be of some further assistance, here's a validation script you can use for UTF-8 encodings. Just encapsulate the input in a string like the example.

How far can we take the reasonable output format? E.g., all counts newline separated followed by a "key" of all the characters in order of their counts?

If you have 90 different input characters then it will be hard to tell which key belongs to which character, so I think I must say no to that one @Sanchises.

OK thanks. I think my current submission should be fine then.

Apologies for the lacking replies, I'm celebrating Christmas with the family and code golf is not the main priority right now. Will be back :-)

Pyke, 1 6 bytes
1cn;1c

Try it here!
1c     - chunk(size=1, input)
  n;1  - noop.
     c - count(^)

Half of this code is just no-ops...
00110001 - 1
01100011 - c
01101110 - n
00111011 - ;
00110001 - 1
01100011 - c

@EriktheOutgolfer has a valid point. I don't think this input format is valid, unless this is actually a regular string in Pyke. It would be a valid input string in MATLAB/Octave since 'abc'==['a','b','c'], so it might be in Pyke too...?

@StewieGriffin This is not how Pyke normally handles strings. If that's not OK, I can see about switching the input format but as a character list is under the accepted list of defaults though this may count as cheating under that

@EriktheOutgolfer http://meta.codegolf.stackexchange.com/a/2216/32686 or for a direct but less voted answer http://meta.codegolf.stackexchange.com/a/8963/32686

@muddyfish Oh, so that's where they were hiding. OK, I approve of your solution. Can I clarify that into the post? (It has confused at least 2 people)

Sorry for breaking your challenge with a 1-byte built-in I don't think you're actually sorry, and the challenge is not broken by this :-)

@LuisMendo and that matters why? :)

This isn't a character list; it's a list of strings. While characters lists are at +17/-0, string lists are at +2/-2, so it's hardly an accepted default. @StewieGriffin should decide whether it's valid or not.

@Dennis I did ping them earlier to ask if they thought it was valid

@StewieGriffin better?

@muddyfish, better :)

Pyth, 12 8 7 bytes
-1 byte thanks to @Loovjo
m+d/Qd{
      { # remove all duplicated elements from the (implicit) input
m       # map each element (d) of the parameter (the set from previous operation)
   /Qd  # count the occurrences of d in Q
 +d     # concatenate with d

binary representation

01101101 m
00101011 +
01100100 d
00101111 /
01010001 Q
01100100 d
01111011 {

Try here

Nice! :) The output 13 for 111 looks strange, but it can't be misunderstood (there can't be any single character 13 that's used 1 time), so this is perfectly valid!

Befunge-93, 150 bytes
={<{p+}3/}*77\%*7{7:\+{}{1g}+3/*77\%*7{7:}=:_{}{}={}{}{v#{}{}`x1:~
}-}=*}{2*}97}:<$}={$_v#}!:-*84g+3/*77\%*7{7:}=:}:}+}1{}<_{@#
}{}{}={}{}{}={^.},\={<

Try it online!
I started by writing this as a regular Befunge program, which I golfed as much as possible. I then added padding to make sure the various characters in the program only appeared in permitted positions. This padding relied on the fact that unsupported commands are ignored in Befunge-93, so I just needed a sequence of unused characters whose bits aligned with the positions required (the sequence I used was ={}{}{}).
The complicated bit was that the various branches between lines needed to line up correctly (e.g. the v arrow in one line, would need to line up with the < arrow below it). This was further complicated by the fact that the bridge command (#) could not be separated from its adjacent branching arrow. Initially I tried generating the padding programatically, but in the end it was mostly a manual process.
Because of the size of the program I'm not going to list the full character analysis, but this is a sample from the beginning and the end:
= 00111101 0
{ 01111011 1
< 00111100 2
{ 01111011 3
p 01110000 4
+ 00101011 5
} 01111101 6
3 00110011 0
/ 00101111 1
...
{ 01111011 1
^ 01011110 2
. 00101110 3
} 01111101 4
, 00101100 5
\ 01011100 6
= 00111101 0
{ 01111011 1
< 00111100 2

The line breaks are treated as a newline characters, so will either be in position 1 or 3.

MATL, 17 bytes
u"G91x@=zD91x@uRD

Displays the count, then the corresponding character, all newline-separated. Biggest difficulty is the @ which is 0b01000000; I hope I can find a way to make do without it.
Try it online!
Explanation:
u"  % Implicit input. Take (u)nique characters and loop (") over them.
G   % Take the input a(G)ain
91x % Filler: push 91, delete immediately.
@   % Push current character of loop
=   % Check for equality with earlier G
z   % Count number of equal characters
D   % Display
91x % More filler!
@   % Get loop character again
uR  % Filler: two NOPs for the single-character @
D   % Display. Implicitly end loop.

MATL, 15 bytes (questionable output)
If just leaving two row vectors on the stack is allowed (function-like behaviour as per this Meta post), we can get down to
u"G91x@=zv]v!Gu

But here, the output is not quite as neatly ordered.

The stack is implicitly printed at the end of the program and the output format is flexible as per the challenge, so I don't see any problem with the second approach

@LuisMendo I'm not sure. If you have 90 different input characters then it will be hard to tell which key belongs to which character, so I think I must say no to that one Sanchises. – Stewie Griffin 2 hours ago was the reply to a proposed hybrid (counts individually D'd, Gu at the end of the program), and I'm not sure if the 15-byte version is sufficiently different.

@StewieGriffin Could you perhaps see if the 15-byte version (Try it online!) is OK or not?

Not sure it Stewie will get the ping on this post, better use the challenge post

Don't know about you, but I don't think it's easily understood here :) I prefer the 17 byte solution, but feel free to keep the 15 byte one in the answer too! Nice answer by the way :)

@StewieGriffin Thanks! I'll just keep it like this. I agree that the 15 byte version is difficult to read, but it does nicely leave both vectors on the stack, making this much like a 'function' - but the challenge wording does seem to prefer stdout-like output. Thanks for a nice puzzle though!

CJam, 14 bytes
q__|_ @sfe=]zp

Try it here.
The space before the @ and the s after it are filler characters inserted to make the ASCII codes fit the required pattern: the space does nothing, and the s just converts a string into a string.  Other than that, this is a pretty simple and straightforward implementation of the challenge task:

q_               "read the input and make a copy of it";
  _|             "collapse repeated characters in the copy";
    _            "save a copy of the collapsed string";
      @          "pull the original input string to the top of the stack";
       s         "(does nothing here)";
        fe=      "for each character in the collapsed string, count the ...";
                 "... number of times it occurs in the original string";
           ]z    "pair up the counts with the saved copy of the collapsed string";
             p   "print the string representation of the result";

For the input foobar123, this code outputs [['f 1] ['o 2] ['b 1] ['a 1] ['r 1] ['1 2] ['2 2] ['3 1]].  If simply printing the counts on one line and the corresponding characters on another, as in:
[1 2 1 1 1 2 2 1]
fobar123

is considered an acceptable output format, then the ]z may be omitted to save two bytes, for a total of 12 bytes.  Yes, the shortened code will still pass the bit pattern requirement.
Ps. I also wrote a simple source code checker for this challenge.  Given a line of code as input, it will first echo that line and then print the same line with each character replaced by its (n % 7)-th ASCII bit.  If the second line is all ones, the input is valid.

Jelly, 6 bytes in Jelly's codepage
ṢZṢṀŒr

Try it online!
This is a function that returns a list of (character, count) pairs. (Jelly represents such lists as text, e.g. if they're sent to standard output, by concatenating the elements, which is why you have to treat this as a function rather than a complete program. (Here's the same program with some code appended to call the function and then print the internal structure to standard output, proving that the output's in an unambiguous format.)
Binary representation and explanation:

  76543210

Ṣ 10110111   Sort the characters of the input
Z 01011010   Transpose the list (it's 1D, so this effectively wraps it in a list)
Ṣ 10110111   Sort the list (a no-op, as it has only one element)
Ṁ 11001000   Take the largest (i.e. only) element
Œ 00010011   First byte of a two-byte command
r 01110010   Run-length encode

It can be seen that the second, third, and fourth characters cancel each other out and are only there to maintain the bit pattern we need. Œr is just too convenient, though, and padding the program so that we can use it probably gives us a shorter program than trying to solve the problem without the builtin would.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Pyramid of broken strings
Given a string n, create a pyramid of the string split into pieces relative to the current row.
The first row contains the string unmodified.
The second row contains the string separated into halves by a pipe.
The third row separates it by thirds...
And so on. The length of each substring, where l is the length of string n is equal to
floor(l/n)
Characters left over are put in their own substring. The last row used is the first one where substrings are 2 in length.
Test Cases:
Input: Hello, world.
Output:
Hello, world.

Hello,| world|.

Hell|o, w|orld|.

Hel|lo,| wo|rld|.

He|ll|o,| w|or|ld|.

Input: abcdefghij
Output:
abcdefghij

abcde|fghij

abc|def|ghi|j

ab|cd|ef|gh|ij

Input: 01234567890abcdef
Output:
01234567890abcdef

01234567|890abcde|f

01234|56789|0abcd|ef

0123|4567|890a|bcde|f

012|345|678|90a|bcd|ef

01|23|45|67|89|0a|bc|de|f

Extra rules:

You can write a full program or a function, whichever uses less code.
Input will always be at least 4 characters in length.
You MUST use line breaks if your language supports them. If not possible, replace line breaks with :
Input will always be printable ASCII.
Minus 100% if your program solves P vs. NP.

Leaderboard:

var QUESTION_ID=104297,OVERRIDE_USER=62384;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?([\d.]+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

0 bytes: return: false

Detailed solution required.

Related 1 ... Related 2.

Nice first challenge! A few clarification questions -- is the input only printable ASCII (I strongly suggest "yes")? What does "line breaks are necessary when possible" mean?

Just edited original question.

Your input of 0123456789abcdef produces output with a second 0 after the 9

Fixed that as well. I really need to do a better job proof reading.

Additionally, shouldn't your first output be 01234567|890abcde|f?

Second output, but yes

@JulianLachniet I added a leaderboard snippet, feel free to remove if you want to c:

"MUST use line breaks" -- So we can't write it as a function that output an array of strings?

No, that's not the point of the challenge.

What is the point of the rule "Minus 100% if your program solves P vs. NP."?

It's a joke. P vs NP is an unsolved problem in computing. The joke is that if  you can solve it, I will stop caring about the fact the your program doesn't solve the challenge.

The real unsolved problem in computing is "tabs or spaces"...

No, the real problem is Internet Explorer.

Oh I understand minus is good. I thought you were penalizing people for solving P=NP!

JavaScript (ES6), 103 101 91 84 bytes
Fixed to respect challenge requirements
f=(s,n=0,p=s.length/++n|0)=>p>1?s.match(eval('/.{1,'+p+'}/g')).join`|`+'\n'+f(s,n):''

Lambda f that takes input string as first parameter s and recursively prints to console the split string. Pretty straightforward: as long as the substring length, p, is above 1, print the string split by a '|' every p characters, then proceed with appending the following level. This then calls the function again with p being t / n floored, where t is the original string length and n being an incremented divider.

I don't think dividing n by 2 each time is correct.

@Neil you are correct, mistake on my part. I fixed the problem and saved 2 bytes in the process.

@ETHproductions I thought of that, but I don't know if that would count as STDOUT... I guess I would need to do alert(f(s)) just after right?

Perl, 46 + 1 = 47 bytes
Run with the -n flag
say s/.{$=}(?=.)/$&|/gr while($==y///c/++$,)-2

Try it online!
Code breakdown
-n                                              #Reads input into the $_ variable
say s/.{$=}(?=.)/$&|/gr while($==y///c/++$,)-2
                                 y///c          #Transliteration.  Implicitly operates on $_, replacing every character with itself and counting replacements
                                                #y///c effectively returns the length of $_
                                      /++$,     #Increments $, (which starts off at 0) and divides the length of $_ by $,
                              $==               #Stores the result of this division into $=
                                                #$= forces its contents to be an integer, so it truncates any decimal
                             (             )-2  #Returns 0 if $= is equal to 2
                        while                   #Evaluates its RHS as the condition.  If truthy, evaluates its LHS.
    s/          /   /gr                         #Substitution.  Implicitly operates on $_.
                                                #Searches for its first argument and replaces it with its second argument, repeating until it's done, and returns the new string.  $_ is not modified.
      .{$=}                                     #Looks for a string of $= characters...
           (?=.)                                #...that is followed by at least one non-newline character, but does not include this character in the match...
                 $&|                            #...and replaces it with itself followed by a pipe character.
say                                             #Output the result of the substitution.

This doesn't seem to work for longer inputs.

Pyth, 16 bytes
Vh/lQ3j\|cQ/lQhN

V                # For N in range(1, \/ )
 h/lQ3           # 1+lenght(input)/3
      j\|        # join with '|'
         cQ      # chop input in
           /lQhN # lenght(input)/(N+1) pieces

try here

This might work for the test cases but I don't think it works for longer inputs.

C, 145 131 128 125 bytes
l,n,i=1,j;f(char*s){l=strlen(s);puts(s);do{n=l/++i;for(j=0;j<l;)j&&(j%n||putchar('|')),putchar(s[j++]);puts("");}while(n>2);}

This is a function that takes a string as its argument and prints the output to STDOUT.
l,n,i=1,j;       // declare some variables
f(char*s){       // declare the function
l=strlen(s);     // get the length of the string
puts(s);         // output the initial version, with trailing newline
do{n=l/++i;      // n is the number of characters per "section",
                 //  and we'll do-while n>2 to stop at the right time
for(j=0;j<l;)    // loop through the characters of the string
j&&(             // if j != 0,
j%n||            // and j % n == 0,
putchar('|')),   // insert a | before this character
putchar(s[j++]); // print the character
puts("");        // print a newline after the loop
}while(n>2);}

How does this work once i*i>l? It looks as if it will start to repeat sections.

@Neil I'm not sure what you mean. Could you give an example?

@Neil Ah, never mind, I see what you're saying. That appears to be a hole in the specification, which explicitly states that the length of each substring is floor(l/n); I'm not sure what the intended behavior is for longer inputs or if the OP anticipated that.

Pyth, 17 bytes
jmj\|cQ/lQdSh/lQ3

Explanation
     cQ/lQ         Divide into equal pieces (with the last shorter)
  j\|              Join with pipes
 m        d        Map to each row index...
           Sh/lQ3  ... up to the first row with substrings of length 2
j                  Join with newlines

Javascript, 98 Bytes
a=>{for(b=1;2<=a.length/b;)eval("console.log(a.match(/.{1,"+(a.length/b|0)+"}/g).join('|'))"),b++}

Function x(a). Call using
console.log(x("ABCDEF"))

Ruby -n, 60 bytes
z= ~/$/
(z/3+1).times{|n|puts $_.scan(/.{1,#{z/(n+1)}}/)*?|}

Attempt This Online!

Python 3, 123 bytes
f=lambda s:print(*['|'.join(s[i:i+n]for i in range(0,len(s),n))for n in[len(s)//i for i in range(1,len(s)//2+1)]],sep='\n')

At longer strings some parts will be repeated, as the formula for the length of the substring is floor(l/n). For example with a string 13 chars long, the string split into 5's would be the same as the string split into 6's as floor(13/5)==floor(13/6). I'm not sure if the OP expected this or if it was an oversight.

Vyxal, 13 bytes
₌LżḭvẇUṪ\|vj⁋

Try it Online!
12 with j flag
Explained
₌LżḭvẇUṪ\|vj⁋
₌Lż            # Push len(input) and [1..len(input)]
   ḭ           # Floor divide the length by each number in the range
    vẇ         # And wrap the input into chunks of each length
      UṪ       # Uniquify the list and remove the last item (which will be the input split into chunks of length 1)
        \|vj   # Join each list on "|"
            ⁋  # And join that on newlines

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Locally invert a Polynomial
Challenge
Given a polynomial \$p\$ with real coefficients of order \$1\$ and degree \$n\$, find another polynomial \$q\$ of degree at most \$n\$ such that \$(p∘q)(X) = p(q(X)) \equiv X \mod X^{n+1}\$, or in other words such that \$p(q(X)) = X + h(X)\$ where \$h\$ is an arbitrary polynomial with \$ord(h) \geqslant  n+1\$. The polynomial \$q\$ is uniquely determined by \$p\$.
For a polynomial \$p(X) = a_nX^n + a_{n+1}X^{n+1} + ... + a_m X^m\$ where \$n \leqslant m\$ and \$a_n ≠ 0\$,\$a_m ≠ 0\$, we say \$n\$ is the order of \$p\$ and \$m\$ is the degree of \$p\$.
Simplification: You can assume that \$p\$ has integer coefficients, and \$a_1 = 1\$ (so \$p(X) = X + \text{[some integral polynomial of order 2]}\$). In this case \$q\$ has integral coefficients too.
The purpose of this simplification is to avoid the issues with floating point numbers. There is however a non-integral example for illustration purposes.
Examples

Consider the Taylor series of \$\exp(x)-1 = x + x^2/2 + x^3/6 + x^4/24 + ...\$ and \$\ln(x+1) = x - x^2/2 + x^3/3 - x^4/4 + ... \$ then obviously \$\ln(\exp(x)-1+1)= x\$.
If we just consider the Taylor polynomials of degree 4 of those two functions we get with the notation from below (see testcases) \$p = [-1/4,1/3,-1/2,1,0]\$ and \$q = [1/24, 1/6, 1/2, 1,0]\$ and \$(p∘q)(X) \equiv X \mod X^5\$

Consider the polynomial \$p(X) = X + X^2 + X^3 + X^4\$. Then for \$q(X) = X - X^2 + X^3 - X^4\$ we get

$$(p \circ q)(X) = p(q(X)) = X - 2X^5 + 3X^6 - 10X^7 +...+ X^{16} \equiv X \mod X^5$$
Testcases
Here the input and output polynomials are written as lists of coefficients (with the coefficient of the highest degree monomial first, the constant term last):
p = [4,3,2,0];  q=[0.3125,-.375,0.5,0]

Integral Testcases:
p = [1,0]; q = [1,0]

p = [9,8,7,6,5,4,3,2,1,0]; q = [4862,-1430,429,-132,42,-14,5,-2,1,0]

p = [-1,3,-3,1,0]; q = [91,15,3,1,0]

Python 2 + sympy, 128 bytes
We locally invert the polynomial by assuming that q(x) = x, composing it with p, checking the coefficient for x2, and subtracting it from q. Let's say the coefficient was 4, then the new polynomial becomes q(x) = x - 4x2. We then again compose this with p, but look up the coefficient for x3. Etc...
from sympy import*
i=input()
p=Poly(i,var('x'));q=p*0+x
n=2
for _ in i[2:]:q-=compose(p,q).nth(n)*x**n;n+=1
print q.all_coeffs()

Mathematica, 45 bytes
Normal@InverseSeries[#+O@x^(#~Exponent~x+1)]&

Yeah, Mathematica has a builtin for that....
Unnamed function taking as input a polynomial in the variable x, such as -x^4+3x^3-3x^2+x for the last test case, and returning a polynomial with similar syntax, such as x+3x^2+15x^3+91x^4 for the last test case.
#+O@x^(#~Exponent~x+1) turns the input # into a power series object, truncated at the degree of #; InverseSeries does what it says; and Normal turns the resulting truncated power series back into a polynomial. (We could save those initial 7 bytes if an answer in the form x+3x^2+15x^3+91x^4+O[x]^5 were acceptable. Indeed, if that were an acceptable format for both input and output, then InverseSeries alone would be a 13-byte solution.)

JavaScript (ES6), 138 bytes
a=>a.reduce((r,_,i)=>[...r,i<2?i:a.map(l=>c=p.map((m,j)=>(r.map((n,k)=>p[k+=j]=m*n+(p[k]||0)),m*l+(c[j]||0)),p=[]),c=[],p=[1])&&-c[i]],[])

Port of @orlp's answer. I/O is in the form of arrays of coefficients in reverse order i.e. the first two coefficients are always 0 and 1.

Pari/GP, 29 bytes
p->Pol(serreverse(p+O(x^#p)))

Try it online!

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/