Warped chessboardSet the chessboardBuild a working chessboardGenerate Pascal's PyramidChess Light SolverASCII Art ChessboardBuild a chessboardChessboard mazeHexaGolf: WordagonsEscape a chessboardReconstruct an arithmetic sequence

Word for a small burst of laughter that can't be held back

Is having a hidden directory under /etc safe?

Accidentally cashed a check twice

Is the decompression of compressed and encrypted data without decryption also theoretically impossible?

Strange math syntax in old basic listing

Hygienic footwear for prehensile feet?

Initialize an array of doubles at compile time

Is it possible for people to live in the eye of a permanent hypercane?

Pros and cons of writing a book review?

Please help me identify this plane

How do I remove hundreds of automatically added network printers?

What if you don't bring your credit card or debit for incidentals?

When leasing/renting out an owned property, is there a standard ratio between monthly rent and the mortgage?

What is a simple, physical situation where complex numbers emerge naturally?

Access to all elements on the page

Can a class take a different class's spell in their ritual book?

What does it mean by "d-ism of Leibniz" and "dotage of Newton" in simple English?

Why does a helium balloon rise?

What does War Machine's "Canopy! Canopy!" line mean in "Avengers: Endgame"?

Why is Colorado so different politically from nearby states?

Get value of the passed argument to script importing variables from another script

How to make thick Asian sauces?

Show sparse matrices like chessboards

Credit card offering 0.5 miles for every cent rounded up. Too good to be true?



Warped chessboard


Set the chessboardBuild a working chessboardGenerate Pascal's PyramidChess Light SolverASCII Art ChessboardBuild a chessboardChessboard mazeHexaGolf: WordagonsEscape a chessboardReconstruct an arithmetic sequence













20












$begingroup$


This challenge is about building a chessboard in which the square size, instead of being constant across the board, follows a certain non-decreasing sequence, as described below.



The board is defined iteratively. A board of size $n times n$ is enlarged to size $(n+k)times(n+k)$ by extending it down and to the right by a "layer" of squares of size $k$, where $k$ is the greatest divisor of $n$ not exceeding $sqrtn$. The squares in the diagonal are always of the same colour.



Specifically, consider the board with colours represented as # and +.




  1. Initialize the chessboard to



    #



  2. The board so far has size $1times 1$. The only divisor of $1$ is $1$, and it does not exceed $sqrt1$. So we take $k=1$, and extend the board by adding a layer of squares of size $1$, with # in the diagonal:



    #+
    +#



  3. The board built so far has size $2 times 2$. The divisors of $2$ are $1,2$, and the maximum divisor not exceeding $sqrt2$ is $1$. So again $k=1$, and the board is extended to



    #+#
    +#+
    #+#



  4. Size is $3 times 3$. $k=1$. Extend to



    #+#+
    +#+#
    #+#+
    +#+#



  5. Size is $4 times 4$. Now $k=2$, because $2$ is the maximum divisor of $4$ not exceeding $sqrt 4$. Extend with a layer of thickness $2$, formed by squares of size $2times 2$, with colour # in the diagonal:



    #+#+##
    +#+###
    #+#+++
    +#+#++
    ##++##
    ##++##



  6. Size is $6 times 6$. Now $k=2$. Extend to size $8 times 8$. Now $k=2$. Extend to size $10 times 10$. Now $k=2$. Extend to size $12 times 12$. Now $k=3$. Extend to size $15$:



    #+#+##++##++###
    +#+###++##++###
    #+#+++##++#####
    +#+#++##++##+++
    ##++##++##+++++
    ##++##++##+++++
    ++##++##++#####
    ++##++##++#####
    ##++##++##++###
    ##++##++##+++++
    ++##++##++##+++
    ++##++##++##+++
    ###+++###+++###
    ###+++###+++###
    ###+++###+++###


Note how the most recently added squares, of size $3 times 3$, have sides that partially coincide with those of the previously added squares of size $ 2 times 2 $.



The sequence formed by the values of $k$ is non-decreasing:



1 1 1 2 2 2 2 3 3 3 3 4 4 4 6 6 6 6 6 6 ...


and does not seem to be in OEIS. However, its cumulative version, which is the sequence of sizes of the board, is A139542 (thanks to @Arnauld for noticing).



The challenge



Input: a positive integer $S$ representing the number of layers in the board. If you prefer, you may also get $S-1$ instead of $S$ as input ($0$-indexed); see below.



Output: an ASCII-art representation of a board with $S$ layers.



  • Output may be through STDOUT or an argument returned by a function. In this case it may be a string with newlines, a 2D character array or an array of strings.


  • You can consistently choose any two characters for representing the board.


  • You can consistently choose the direction of growth. That is, instead of the above representations (which grow downward and rightward), you can produce any of its reflected or rotated versions.


  • Trailing or leading space is allowed (if output is through STDOUT), as long as space is not one of the two characters used for the board.


  • You can optionally use "$0$-indexed" input; that is, take as input $S-1$, which specifies a board with $S$ layers.


Shortest code in bytes wins.



Test cases



1:



#


3:



#+#
+#+
#+#


5:



#+#+##
+#+###
#+#+++
+#+#++
##++##
##++##


6:



#+#+##++
+#+###++
#+#+++##
+#+#++##
##++##++
##++##++
++##++##
++##++##


10:



#+#+##++##++###+++
+#+###++##++###+++
#+#+++##++#####+++
+#+#++##++##+++###
##++##++##+++++###
##++##++##+++++###
++##++##++#####+++
++##++##++#####+++
##++##++##++###+++
##++##++##+++++###
++##++##++##+++###
++##++##++##+++###
###+++###+++###+++
###+++###+++###+++
###+++###+++###+++
+++###+++###+++###
+++###+++###+++###
+++###+++###+++###


15:



#+#+##++##++###+++###+++####++++####
+#+###++##++###+++###+++####++++####
#+#+++##++#####+++###+++####++++####
+#+#++##++##+++###+++#######++++####
##++##++##+++++###+++###++++####++++
##++##++##+++++###+++###++++####++++
++##++##++#####+++###+++++++####++++
++##++##++#####+++###+++++++####++++
##++##++##++###+++###+++####++++####
##++##++##+++++###+++#######++++####
++##++##++##+++###+++#######++++####
++##++##++##+++###+++#######++++####
###+++###+++###+++###+++++++####++++
###+++###+++###+++###+++++++####++++
###+++###+++###+++###+++++++####++++
+++###+++###+++###+++###++++####++++
+++###+++###+++###+++#######++++####
+++###+++###+++###+++#######++++####
###+++###+++###+++###+++####++++####
###+++###+++###+++###+++####++++####
###+++###+++###+++###+++++++####++++
+++###+++###+++###+++###++++####++++
+++###+++###+++###+++###++++####++++
+++###+++###+++###+++###++++####++++
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####
++++####++++####++++####++++####++++
++++####++++####++++####++++####++++
++++####++++####++++####++++####++++
++++####++++####++++####++++####++++
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####


25:



#+#+##++##++###+++###+++####++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
+#+###++##++###+++###+++####++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
#+#+++##++#####+++###+++####++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
+#+#++##++##+++###+++#######++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
##++##++##+++++###+++###++++####++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
##++##++##+++++###+++###++++####++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
++##++##++#####+++###+++++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
++##++##++#####+++###+++++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
##++##++##++###+++###+++####++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
##++##++##+++++###+++#######++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
++##++##++##+++###+++#######++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
++##++##++##+++###+++#######++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
###+++###+++###+++###+++++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
###+++###+++###+++###+++++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
###+++###+++###+++###+++++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
+++###+++###+++###+++###++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
+++###+++###+++###+++#######++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
+++###+++###+++###+++#######++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
###+++###+++###+++###+++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
###+++###+++###+++###+++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
###+++###+++###+++###+++++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
+++###+++###+++###+++###++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
+++###+++###+++###+++###++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
+++###+++###+++###+++###++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
++++####++++####++++####++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
++++####++++####++++####++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
++++####++++####++++####++++####++++++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++####++++####++++####++++####++++++++++######++++++######++++++##############++++++++########++++++++########++++++++
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########









share|improve this question











$endgroup$











  • $begingroup$
    Is an integer matrix permitted as output (e.g. 0s and 1s), or does it have to be strings/characters?
    $endgroup$
    – Nick Kennedy
    May 18 at 4:07










  • $begingroup$
    @Nick It has to be chars, sorry
    $endgroup$
    – Luis Mendo
    May 18 at 8:47






  • 2




    $begingroup$
    Very well-written question!
    $endgroup$
    – Greg Martin
    May 18 at 17:25










  • $begingroup$
    @GregMartin Hey, thanks!
    $endgroup$
    – Luis Mendo
    May 18 at 17:44















20












$begingroup$


This challenge is about building a chessboard in which the square size, instead of being constant across the board, follows a certain non-decreasing sequence, as described below.



The board is defined iteratively. A board of size $n times n$ is enlarged to size $(n+k)times(n+k)$ by extending it down and to the right by a "layer" of squares of size $k$, where $k$ is the greatest divisor of $n$ not exceeding $sqrtn$. The squares in the diagonal are always of the same colour.



Specifically, consider the board with colours represented as # and +.




  1. Initialize the chessboard to



    #



  2. The board so far has size $1times 1$. The only divisor of $1$ is $1$, and it does not exceed $sqrt1$. So we take $k=1$, and extend the board by adding a layer of squares of size $1$, with # in the diagonal:



    #+
    +#



  3. The board built so far has size $2 times 2$. The divisors of $2$ are $1,2$, and the maximum divisor not exceeding $sqrt2$ is $1$. So again $k=1$, and the board is extended to



    #+#
    +#+
    #+#



  4. Size is $3 times 3$. $k=1$. Extend to



    #+#+
    +#+#
    #+#+
    +#+#



  5. Size is $4 times 4$. Now $k=2$, because $2$ is the maximum divisor of $4$ not exceeding $sqrt 4$. Extend with a layer of thickness $2$, formed by squares of size $2times 2$, with colour # in the diagonal:



    #+#+##
    +#+###
    #+#+++
    +#+#++
    ##++##
    ##++##



  6. Size is $6 times 6$. Now $k=2$. Extend to size $8 times 8$. Now $k=2$. Extend to size $10 times 10$. Now $k=2$. Extend to size $12 times 12$. Now $k=3$. Extend to size $15$:



    #+#+##++##++###
    +#+###++##++###
    #+#+++##++#####
    +#+#++##++##+++
    ##++##++##+++++
    ##++##++##+++++
    ++##++##++#####
    ++##++##++#####
    ##++##++##++###
    ##++##++##+++++
    ++##++##++##+++
    ++##++##++##+++
    ###+++###+++###
    ###+++###+++###
    ###+++###+++###


Note how the most recently added squares, of size $3 times 3$, have sides that partially coincide with those of the previously added squares of size $ 2 times 2 $.



The sequence formed by the values of $k$ is non-decreasing:



1 1 1 2 2 2 2 3 3 3 3 4 4 4 6 6 6 6 6 6 ...


and does not seem to be in OEIS. However, its cumulative version, which is the sequence of sizes of the board, is A139542 (thanks to @Arnauld for noticing).



The challenge



Input: a positive integer $S$ representing the number of layers in the board. If you prefer, you may also get $S-1$ instead of $S$ as input ($0$-indexed); see below.



Output: an ASCII-art representation of a board with $S$ layers.



  • Output may be through STDOUT or an argument returned by a function. In this case it may be a string with newlines, a 2D character array or an array of strings.


  • You can consistently choose any two characters for representing the board.


  • You can consistently choose the direction of growth. That is, instead of the above representations (which grow downward and rightward), you can produce any of its reflected or rotated versions.


  • Trailing or leading space is allowed (if output is through STDOUT), as long as space is not one of the two characters used for the board.


  • You can optionally use "$0$-indexed" input; that is, take as input $S-1$, which specifies a board with $S$ layers.


Shortest code in bytes wins.



Test cases



1:



#


3:



#+#
+#+
#+#


5:



#+#+##
+#+###
#+#+++
+#+#++
##++##
##++##


6:



#+#+##++
+#+###++
#+#+++##
+#+#++##
##++##++
##++##++
++##++##
++##++##


10:



#+#+##++##++###+++
+#+###++##++###+++
#+#+++##++#####+++
+#+#++##++##+++###
##++##++##+++++###
##++##++##+++++###
++##++##++#####+++
++##++##++#####+++
##++##++##++###+++
##++##++##+++++###
++##++##++##+++###
++##++##++##+++###
###+++###+++###+++
###+++###+++###+++
###+++###+++###+++
+++###+++###+++###
+++###+++###+++###
+++###+++###+++###


15:



#+#+##++##++###+++###+++####++++####
+#+###++##++###+++###+++####++++####
#+#+++##++#####+++###+++####++++####
+#+#++##++##+++###+++#######++++####
##++##++##+++++###+++###++++####++++
##++##++##+++++###+++###++++####++++
++##++##++#####+++###+++++++####++++
++##++##++#####+++###+++++++####++++
##++##++##++###+++###+++####++++####
##++##++##+++++###+++#######++++####
++##++##++##+++###+++#######++++####
++##++##++##+++###+++#######++++####
###+++###+++###+++###+++++++####++++
###+++###+++###+++###+++++++####++++
###+++###+++###+++###+++++++####++++
+++###+++###+++###+++###++++####++++
+++###+++###+++###+++#######++++####
+++###+++###+++###+++#######++++####
###+++###+++###+++###+++####++++####
###+++###+++###+++###+++####++++####
###+++###+++###+++###+++++++####++++
+++###+++###+++###+++###++++####++++
+++###+++###+++###+++###++++####++++
+++###+++###+++###+++###++++####++++
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####
++++####++++####++++####++++####++++
++++####++++####++++####++++####++++
++++####++++####++++####++++####++++
++++####++++####++++####++++####++++
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####


25:



#+#+##++##++###+++###+++####++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
+#+###++##++###+++###+++####++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
#+#+++##++#####+++###+++####++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
+#+#++##++##+++###+++#######++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
##++##++##+++++###+++###++++####++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
##++##++##+++++###+++###++++####++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
++##++##++#####+++###+++++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
++##++##++#####+++###+++++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
##++##++##++###+++###+++####++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
##++##++##+++++###+++#######++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
++##++##++##+++###+++#######++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
++##++##++##+++###+++#######++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
###+++###+++###+++###+++++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
###+++###+++###+++###+++++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
###+++###+++###+++###+++++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
+++###+++###+++###+++###++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
+++###+++###+++###+++#######++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
+++###+++###+++###+++#######++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
###+++###+++###+++###+++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
###+++###+++###+++###+++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
###+++###+++###+++###+++++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
+++###+++###+++###+++###++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
+++###+++###+++###+++###++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
+++###+++###+++###+++###++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
++++####++++####++++####++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
++++####++++####++++####++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
++++####++++####++++####++++####++++++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++####++++####++++####++++####++++++++++######++++++######++++++##############++++++++########++++++++########++++++++
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########









share|improve this question











$endgroup$











  • $begingroup$
    Is an integer matrix permitted as output (e.g. 0s and 1s), or does it have to be strings/characters?
    $endgroup$
    – Nick Kennedy
    May 18 at 4:07










  • $begingroup$
    @Nick It has to be chars, sorry
    $endgroup$
    – Luis Mendo
    May 18 at 8:47






  • 2




    $begingroup$
    Very well-written question!
    $endgroup$
    – Greg Martin
    May 18 at 17:25










  • $begingroup$
    @GregMartin Hey, thanks!
    $endgroup$
    – Luis Mendo
    May 18 at 17:44













20












20








20


1



$begingroup$


This challenge is about building a chessboard in which the square size, instead of being constant across the board, follows a certain non-decreasing sequence, as described below.



The board is defined iteratively. A board of size $n times n$ is enlarged to size $(n+k)times(n+k)$ by extending it down and to the right by a "layer" of squares of size $k$, where $k$ is the greatest divisor of $n$ not exceeding $sqrtn$. The squares in the diagonal are always of the same colour.



Specifically, consider the board with colours represented as # and +.




  1. Initialize the chessboard to



    #



  2. The board so far has size $1times 1$. The only divisor of $1$ is $1$, and it does not exceed $sqrt1$. So we take $k=1$, and extend the board by adding a layer of squares of size $1$, with # in the diagonal:



    #+
    +#



  3. The board built so far has size $2 times 2$. The divisors of $2$ are $1,2$, and the maximum divisor not exceeding $sqrt2$ is $1$. So again $k=1$, and the board is extended to



    #+#
    +#+
    #+#



  4. Size is $3 times 3$. $k=1$. Extend to



    #+#+
    +#+#
    #+#+
    +#+#



  5. Size is $4 times 4$. Now $k=2$, because $2$ is the maximum divisor of $4$ not exceeding $sqrt 4$. Extend with a layer of thickness $2$, formed by squares of size $2times 2$, with colour # in the diagonal:



    #+#+##
    +#+###
    #+#+++
    +#+#++
    ##++##
    ##++##



  6. Size is $6 times 6$. Now $k=2$. Extend to size $8 times 8$. Now $k=2$. Extend to size $10 times 10$. Now $k=2$. Extend to size $12 times 12$. Now $k=3$. Extend to size $15$:



    #+#+##++##++###
    +#+###++##++###
    #+#+++##++#####
    +#+#++##++##+++
    ##++##++##+++++
    ##++##++##+++++
    ++##++##++#####
    ++##++##++#####
    ##++##++##++###
    ##++##++##+++++
    ++##++##++##+++
    ++##++##++##+++
    ###+++###+++###
    ###+++###+++###
    ###+++###+++###


Note how the most recently added squares, of size $3 times 3$, have sides that partially coincide with those of the previously added squares of size $ 2 times 2 $.



The sequence formed by the values of $k$ is non-decreasing:



1 1 1 2 2 2 2 3 3 3 3 4 4 4 6 6 6 6 6 6 ...


and does not seem to be in OEIS. However, its cumulative version, which is the sequence of sizes of the board, is A139542 (thanks to @Arnauld for noticing).



The challenge



Input: a positive integer $S$ representing the number of layers in the board. If you prefer, you may also get $S-1$ instead of $S$ as input ($0$-indexed); see below.



Output: an ASCII-art representation of a board with $S$ layers.



  • Output may be through STDOUT or an argument returned by a function. In this case it may be a string with newlines, a 2D character array or an array of strings.


  • You can consistently choose any two characters for representing the board.


  • You can consistently choose the direction of growth. That is, instead of the above representations (which grow downward and rightward), you can produce any of its reflected or rotated versions.


  • Trailing or leading space is allowed (if output is through STDOUT), as long as space is not one of the two characters used for the board.


  • You can optionally use "$0$-indexed" input; that is, take as input $S-1$, which specifies a board with $S$ layers.


Shortest code in bytes wins.



Test cases



1:



#


3:



#+#
+#+
#+#


5:



#+#+##
+#+###
#+#+++
+#+#++
##++##
##++##


6:



#+#+##++
+#+###++
#+#+++##
+#+#++##
##++##++
##++##++
++##++##
++##++##


10:



#+#+##++##++###+++
+#+###++##++###+++
#+#+++##++#####+++
+#+#++##++##+++###
##++##++##+++++###
##++##++##+++++###
++##++##++#####+++
++##++##++#####+++
##++##++##++###+++
##++##++##+++++###
++##++##++##+++###
++##++##++##+++###
###+++###+++###+++
###+++###+++###+++
###+++###+++###+++
+++###+++###+++###
+++###+++###+++###
+++###+++###+++###


15:



#+#+##++##++###+++###+++####++++####
+#+###++##++###+++###+++####++++####
#+#+++##++#####+++###+++####++++####
+#+#++##++##+++###+++#######++++####
##++##++##+++++###+++###++++####++++
##++##++##+++++###+++###++++####++++
++##++##++#####+++###+++++++####++++
++##++##++#####+++###+++++++####++++
##++##++##++###+++###+++####++++####
##++##++##+++++###+++#######++++####
++##++##++##+++###+++#######++++####
++##++##++##+++###+++#######++++####
###+++###+++###+++###+++++++####++++
###+++###+++###+++###+++++++####++++
###+++###+++###+++###+++++++####++++
+++###+++###+++###+++###++++####++++
+++###+++###+++###+++#######++++####
+++###+++###+++###+++#######++++####
###+++###+++###+++###+++####++++####
###+++###+++###+++###+++####++++####
###+++###+++###+++###+++++++####++++
+++###+++###+++###+++###++++####++++
+++###+++###+++###+++###++++####++++
+++###+++###+++###+++###++++####++++
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####
++++####++++####++++####++++####++++
++++####++++####++++####++++####++++
++++####++++####++++####++++####++++
++++####++++####++++####++++####++++
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####


25:



#+#+##++##++###+++###+++####++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
+#+###++##++###+++###+++####++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
#+#+++##++#####+++###+++####++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
+#+#++##++##+++###+++#######++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
##++##++##+++++###+++###++++####++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
##++##++##+++++###+++###++++####++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
++##++##++#####+++###+++++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
++##++##++#####+++###+++++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
##++##++##++###+++###+++####++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
##++##++##+++++###+++#######++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
++##++##++##+++###+++#######++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
++##++##++##+++###+++#######++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
###+++###+++###+++###+++++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
###+++###+++###+++###+++++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
###+++###+++###+++###+++++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
+++###+++###+++###+++###++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
+++###+++###+++###+++#######++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
+++###+++###+++###+++#######++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
###+++###+++###+++###+++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
###+++###+++###+++###+++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
###+++###+++###+++###+++++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
+++###+++###+++###+++###++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
+++###+++###+++###+++###++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
+++###+++###+++###+++###++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
++++####++++####++++####++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
++++####++++####++++####++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
++++####++++####++++####++++####++++++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++####++++####++++####++++####++++++++++######++++++######++++++##############++++++++########++++++++########++++++++
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########









share|improve this question











$endgroup$




This challenge is about building a chessboard in which the square size, instead of being constant across the board, follows a certain non-decreasing sequence, as described below.



The board is defined iteratively. A board of size $n times n$ is enlarged to size $(n+k)times(n+k)$ by extending it down and to the right by a "layer" of squares of size $k$, where $k$ is the greatest divisor of $n$ not exceeding $sqrtn$. The squares in the diagonal are always of the same colour.



Specifically, consider the board with colours represented as # and +.




  1. Initialize the chessboard to



    #



  2. The board so far has size $1times 1$. The only divisor of $1$ is $1$, and it does not exceed $sqrt1$. So we take $k=1$, and extend the board by adding a layer of squares of size $1$, with # in the diagonal:



    #+
    +#



  3. The board built so far has size $2 times 2$. The divisors of $2$ are $1,2$, and the maximum divisor not exceeding $sqrt2$ is $1$. So again $k=1$, and the board is extended to



    #+#
    +#+
    #+#



  4. Size is $3 times 3$. $k=1$. Extend to



    #+#+
    +#+#
    #+#+
    +#+#



  5. Size is $4 times 4$. Now $k=2$, because $2$ is the maximum divisor of $4$ not exceeding $sqrt 4$. Extend with a layer of thickness $2$, formed by squares of size $2times 2$, with colour # in the diagonal:



    #+#+##
    +#+###
    #+#+++
    +#+#++
    ##++##
    ##++##



  6. Size is $6 times 6$. Now $k=2$. Extend to size $8 times 8$. Now $k=2$. Extend to size $10 times 10$. Now $k=2$. Extend to size $12 times 12$. Now $k=3$. Extend to size $15$:



    #+#+##++##++###
    +#+###++##++###
    #+#+++##++#####
    +#+#++##++##+++
    ##++##++##+++++
    ##++##++##+++++
    ++##++##++#####
    ++##++##++#####
    ##++##++##++###
    ##++##++##+++++
    ++##++##++##+++
    ++##++##++##+++
    ###+++###+++###
    ###+++###+++###
    ###+++###+++###


Note how the most recently added squares, of size $3 times 3$, have sides that partially coincide with those of the previously added squares of size $ 2 times 2 $.



The sequence formed by the values of $k$ is non-decreasing:



1 1 1 2 2 2 2 3 3 3 3 4 4 4 6 6 6 6 6 6 ...


and does not seem to be in OEIS. However, its cumulative version, which is the sequence of sizes of the board, is A139542 (thanks to @Arnauld for noticing).



The challenge



Input: a positive integer $S$ representing the number of layers in the board. If you prefer, you may also get $S-1$ instead of $S$ as input ($0$-indexed); see below.



Output: an ASCII-art representation of a board with $S$ layers.



  • Output may be through STDOUT or an argument returned by a function. In this case it may be a string with newlines, a 2D character array or an array of strings.


  • You can consistently choose any two characters for representing the board.


  • You can consistently choose the direction of growth. That is, instead of the above representations (which grow downward and rightward), you can produce any of its reflected or rotated versions.


  • Trailing or leading space is allowed (if output is through STDOUT), as long as space is not one of the two characters used for the board.


  • You can optionally use "$0$-indexed" input; that is, take as input $S-1$, which specifies a board with $S$ layers.


Shortest code in bytes wins.



Test cases



1:



#


3:



#+#
+#+
#+#


5:



#+#+##
+#+###
#+#+++
+#+#++
##++##
##++##


6:



#+#+##++
+#+###++
#+#+++##
+#+#++##
##++##++
##++##++
++##++##
++##++##


10:



#+#+##++##++###+++
+#+###++##++###+++
#+#+++##++#####+++
+#+#++##++##+++###
##++##++##+++++###
##++##++##+++++###
++##++##++#####+++
++##++##++#####+++
##++##++##++###+++
##++##++##+++++###
++##++##++##+++###
++##++##++##+++###
###+++###+++###+++
###+++###+++###+++
###+++###+++###+++
+++###+++###+++###
+++###+++###+++###
+++###+++###+++###


15:



#+#+##++##++###+++###+++####++++####
+#+###++##++###+++###+++####++++####
#+#+++##++#####+++###+++####++++####
+#+#++##++##+++###+++#######++++####
##++##++##+++++###+++###++++####++++
##++##++##+++++###+++###++++####++++
++##++##++#####+++###+++++++####++++
++##++##++#####+++###+++++++####++++
##++##++##++###+++###+++####++++####
##++##++##+++++###+++#######++++####
++##++##++##+++###+++#######++++####
++##++##++##+++###+++#######++++####
###+++###+++###+++###+++++++####++++
###+++###+++###+++###+++++++####++++
###+++###+++###+++###+++++++####++++
+++###+++###+++###+++###++++####++++
+++###+++###+++###+++#######++++####
+++###+++###+++###+++#######++++####
###+++###+++###+++###+++####++++####
###+++###+++###+++###+++####++++####
###+++###+++###+++###+++++++####++++
+++###+++###+++###+++###++++####++++
+++###+++###+++###+++###++++####++++
+++###+++###+++###+++###++++####++++
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####
++++####++++####++++####++++####++++
++++####++++####++++####++++####++++
++++####++++####++++####++++####++++
++++####++++####++++####++++####++++
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####
####++++####++++####++++####++++####


25:



#+#+##++##++###+++###+++####++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
+#+###++##++###+++###+++####++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
#+#+++##++#####+++###+++####++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
+#+#++##++##+++###+++#######++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
##++##++##+++++###+++###++++####++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
##++##++##+++++###+++###++++####++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
++##++##++#####+++###+++++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
++##++##++#####+++###+++++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
##++##++##++###+++###+++####++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
##++##++##+++++###+++#######++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
++##++##++##+++###+++#######++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
++##++##++##+++###+++#######++++####++++++######++++++######++++++##############++++++++########++++++++########++++++++
###+++###+++###+++###+++++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
###+++###+++###+++###+++++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
###+++###+++###+++###+++++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
+++###+++###+++###+++###++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
+++###+++###+++###+++#######++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
+++###+++###+++###+++#######++++##########++++++######++++++######++++++++++++++########++++++++########++++++++########
###+++###+++###+++###+++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
###+++###+++###+++###+++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
###+++###+++###+++###+++++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
+++###+++###+++###+++###++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
+++###+++###+++###+++###++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
+++###+++###+++###+++###++++####++++++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
####++++####++++####++++####++++##########++++++######++++++######++++++########++++++++########++++++++########++++++++
++++####++++####++++####++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
++++####++++####++++####++++####++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
++++####++++####++++####++++####++++++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++####++++####++++####++++####++++++++++######++++++######++++++##############++++++++########++++++++########++++++++
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
####++++####++++####++++####++++####++++++######++++++######++++++######++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
++++++######++++++######++++++######++++++######++++++######++++++##############++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++########++++++++########++++++++########++++++++
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
######++++++######++++++######++++++######++++++######++++++######++++++++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++######++++++######++++++######++++++######++++++######++++++######++++++++########++++++++########++++++++########
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########
########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########++++++++########






code-golf ascii-art integer






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 17 at 22:38







Luis Mendo

















asked May 17 at 18:31









Luis MendoLuis Mendo

76k889298




76k889298











  • $begingroup$
    Is an integer matrix permitted as output (e.g. 0s and 1s), or does it have to be strings/characters?
    $endgroup$
    – Nick Kennedy
    May 18 at 4:07










  • $begingroup$
    @Nick It has to be chars, sorry
    $endgroup$
    – Luis Mendo
    May 18 at 8:47






  • 2




    $begingroup$
    Very well-written question!
    $endgroup$
    – Greg Martin
    May 18 at 17:25










  • $begingroup$
    @GregMartin Hey, thanks!
    $endgroup$
    – Luis Mendo
    May 18 at 17:44
















  • $begingroup$
    Is an integer matrix permitted as output (e.g. 0s and 1s), or does it have to be strings/characters?
    $endgroup$
    – Nick Kennedy
    May 18 at 4:07










  • $begingroup$
    @Nick It has to be chars, sorry
    $endgroup$
    – Luis Mendo
    May 18 at 8:47






  • 2




    $begingroup$
    Very well-written question!
    $endgroup$
    – Greg Martin
    May 18 at 17:25










  • $begingroup$
    @GregMartin Hey, thanks!
    $endgroup$
    – Luis Mendo
    May 18 at 17:44















$begingroup$
Is an integer matrix permitted as output (e.g. 0s and 1s), or does it have to be strings/characters?
$endgroup$
– Nick Kennedy
May 18 at 4:07




$begingroup$
Is an integer matrix permitted as output (e.g. 0s and 1s), or does it have to be strings/characters?
$endgroup$
– Nick Kennedy
May 18 at 4:07












$begingroup$
@Nick It has to be chars, sorry
$endgroup$
– Luis Mendo
May 18 at 8:47




$begingroup$
@Nick It has to be chars, sorry
$endgroup$
– Luis Mendo
May 18 at 8:47




2




2




$begingroup$
Very well-written question!
$endgroup$
– Greg Martin
May 18 at 17:25




$begingroup$
Very well-written question!
$endgroup$
– Greg Martin
May 18 at 17:25












$begingroup$
@GregMartin Hey, thanks!
$endgroup$
– Luis Mendo
May 18 at 17:44




$begingroup$
@GregMartin Hey, thanks!
$endgroup$
– Luis Mendo
May 18 at 17:44










8 Answers
8






active

oldest

votes


















5












$begingroup$


Canvas, 34 32 bytes



0#0⁸[#+¶+#xx*yx+m⤢αm;nlw√{y;%‽²X


Try it here!






share|improve this answer











$endgroup$












  • $begingroup$
    Input can now be 0-indexed; in case that helps
    $endgroup$
    – Luis Mendo
    May 17 at 20:58


















4












$begingroup$


Python 2, 217 215 212 bytes





def f(x):
b=['1'];n=1
for i in range(x):P=max(j*(n%j<(j<=n**.5))for j in range(1,1+n));n+=P;b=[l+P*`j/P%2^i%2`for j,l in enumerate(b)];s=len(b[0]);b+=[((v*P+`1^int(v)`*P)*s)[:s]for v in b[0][len(b):]]
return b


Try it online!



0-indexed, uses 0 and 1 as characters






share|improve this answer











$endgroup$








  • 1




    $begingroup$
    @LuisMendo saved 2 bytes :D
    $endgroup$
    – Rod
    May 21 at 12:41


















3












$begingroup$


Python 2, 184 178 176 169 bytes





def h(j,a=['1'],R=range):
for i in R(j):L=len(a);k=max(x for x in R(1,L+1)if(x*x<=L)>L%x);a=[a[m]+k*`(i+m/k)%2`for m in R(L)]+[((`i%2`*k+`~i%2`*k)*L)[:L+k]]*k
return a


Try it online!



Uses 1, 0 for #, -; uses 0-indexing.






share|improve this answer











$endgroup$




















    3












    $begingroup$


    Jelly, 40 31 bytes



    1SÆD>Ðḟ½ƊṀṭƲ³¡Äż$Ḷ:Ḃ^þ`ʋ/€ḷ""/Y


    Try it online!



    A full program taking the zero-indexed $S-1$ as input and writing to stdout ASCII art using 0 = #, 1 = +.



    Without the trailing Y, this returns a list of lists of integers, but this is out of spec for this challenge.



    Explanation



    This program works in three stages.



    1. Generate a list of values of $k$ and the cumulative sum of $k$

    2. Generate a checkerboard for each of these with the tile size of $k$ and the board size of the cumulative sum

    3. Work through the list of checkerboards, each time replacing the top-left section of the next board with the existing board.

    Stage 1



    1 | Start with 1
    Ʋ³¡ | Loop through the following the number of times indicated by the first argument to the program; this generates a list of values of k
    S | - Sum
    Ɗ | - Following three links as a monad
    ÆD | - List of divisors
    >Ðḟ½ | - Exclude those greater than the square root
    Ṁ | - Maximum
    ṭ | - Concatenate this to the end of the current list of values of k
    Äż$ | Zip the cumulative sum of the values of k with the values


    Stage 2



     ʋ/€ | For each pair of k and cumulative sum, call the following as a dyad with the cumulative sum of k as the left argument and k as the right (e.g. 15, 3)
    Ḷ | - Lowered range [0, 1 ... , 13, 14]
    : | - Integer division by k [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]
    Ḃ | - Mod 2 [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0]
    ^þ` | - Outer product using xor function and same argument to both side


    Stage 3



     / | Reduce using the following:
    ḷ"" | - Replace the top left portion of the next matrix with the current one
    Y | Finally join by newlines





    share|improve this answer











    $endgroup$












    • $begingroup$
      I think the asker actually wants the # and + characters. But wow, still impressive, I understood about half of it. And how do you even program in such a language? Is there a table of characters and their meaning where you just copy from?
      $endgroup$
      – Fabian Röling
      May 18 at 22:36










    • $begingroup$
      @FabianRöling The OP states any two characters were acceptable. There’s a good introductory tutorial for Jelly at the github.com/DennisMitchell/jelly. If you know Python, the source is also fairly readable. Even with the tutorial and lists of atoms and Quicks, I found it took a little time and in some cases reference to the source to get my head round it.
      $endgroup$
      – Nick Kennedy
      May 19 at 0:35


















    2












    $begingroup$

    JavaScript (ES7), 164 bytes



    Input is 0-indexed. Outputs a matrix with $0$ for # and $1$ for +.





    n=>(b=[1],g=(a,w,d=w**.5|0)=>b[n]?a:w%d?g(a,w,d-1):g(a.concat(Array(d).fill(b.push(d)&&i++)),w+d))([0],i=1).map((_,y,a)=>a.map((_,x)=>(x/b[v=a[x>y?x:y]]^y/b[v])&1))


    Try it online!






    share|improve this answer











    $endgroup$




















      1












      $begingroup$


      Charcoal, 37 bytes



      FN«≔⊕⌈Φ₂⊕Lυ¬﹪Lυ⊕κηFη«PL⭆⊞Oυω§#+÷⁻κμη↙


      Try it online! Link is to verbose version of code. 1-indexed. Output grows down and left (down and right costs an extra byte, but can grow up for the same byte count). Explanation:



      FN«


      Loop $S$ times.



      ≔⊕⌈Φ₂⊕Lυ¬﹪Lυ⊕κη


      Calculate $kleqsqrtn+1$. This only makes a difference when $n=0$ in which case this formula allows $k=1$.



      Fη«


      Loop $k$ times, once for each new row and column.



      PL⭆⊞Oυω§#+÷⁻κμη


      Output the row and column, being sure to alternate between the # and + characters in such a way that # is always the first character but that there is a boundary at the end of the string (because we're drawing from the diagonal outwards). ⊞Oυω makes each row one character longer each time, which also keeps track of $n$ as the length.






      Move down and left ready for the next row.






      share|improve this answer











      $endgroup$




















        1












        $begingroup$

        Haskell, 149 146 bytes



        (iterate g["#"]!!)
        g b|let e=(<$[1..d]);l=length b;d=last[i|i<-[1..l],i*i<=l,mod l i<1];m="+#"++m=(e$take(l+d)$e=<<'#':m)++zipWith(++)(e=<<e<$>m)b


        This is 0 indexed, returns a list of strings and grows upwards and leftwards.



        Try it online!



        (iterate g["#"]!!) -- start with ["#"], repeatedly add a layer
        -- (via function 'g'), collect all results in
        -- a list and index it with the input number

        g b | let -- add a single layer to chessboard 'b'

        l=length b -- let 'l' be the size of 'b'
        d=last[i|i<-[1..l],i*i<=l,mod l i<1] -- let 'd' be the size of the new layer
        e=(<$[1..d]) -- let 'e' be a functions that makes 'd'
        -- copies of it's argument
        m="#+"++m -- let 'm' be an infinite string of "+#+#+..."

        = -- return
        zipWith(++) -- concatenate pairwise
        (e=<<e<$>m) -- a list of squares made by expanding each
        -- char in 'm' to size 'd'-by-'d'
        b -- and 'b' (zipWith truncates the infinite
        -- list of squares to the length of 'b')
        --
        ++ -- and prepend
        --
        (e$take(l+d)$e=<<'#':m) -- the top layer, i.e. a list of 'd' strings
        -- each with the pattern 'd' times '#'
        -- followed by 'd' times '+', etc., each
        -- shortened to the correct size of 'l'+'g'





        share|improve this answer











        $endgroup$




















          1












          $begingroup$


          Perl 6, 156 144 155 154 bytes



          +11 to fix a bug reported by nimi.





          $!=-1;join "
          ",(1,my k=max grep $_%%*,1.. .sqrt;++$!;flat .kv.map(->i,l l~($!+i/k)%2+),substr(($!%2 x k~1-$!%2 x k)x$_,0,$_+k)xx k...*)[$_]


          Roughly based on Chas Brown's Python solution. Takes S zero-indexedly. Outputs 0 and 1.



          Try it online!






          share|improve this answer











          $endgroup$












          • $begingroup$
            Fixed. Now the corners should share the same colour.
            $endgroup$
            – bb94
            May 21 at 5:03











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "200"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f185744%2fwarped-chessboard%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          8 Answers
          8






          active

          oldest

          votes








          8 Answers
          8






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          5












          $begingroup$


          Canvas, 34 32 bytes



          0#0⁸[#+¶+#xx*yx+m⤢αm;nlw√{y;%‽²X


          Try it here!






          share|improve this answer











          $endgroup$












          • $begingroup$
            Input can now be 0-indexed; in case that helps
            $endgroup$
            – Luis Mendo
            May 17 at 20:58















          5












          $begingroup$


          Canvas, 34 32 bytes



          0#0⁸[#+¶+#xx*yx+m⤢αm;nlw√{y;%‽²X


          Try it here!






          share|improve this answer











          $endgroup$












          • $begingroup$
            Input can now be 0-indexed; in case that helps
            $endgroup$
            – Luis Mendo
            May 17 at 20:58













          5












          5








          5





          $begingroup$


          Canvas, 34 32 bytes



          0#0⁸[#+¶+#xx*yx+m⤢αm;nlw√{y;%‽²X


          Try it here!






          share|improve this answer











          $endgroup$




          Canvas, 34 32 bytes



          0#0⁸[#+¶+#xx*yx+m⤢αm;nlw√{y;%‽²X


          Try it here!







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 17 at 20:18

























          answered May 17 at 19:19









          dzaimadzaima

          16.3k22061




          16.3k22061











          • $begingroup$
            Input can now be 0-indexed; in case that helps
            $endgroup$
            – Luis Mendo
            May 17 at 20:58
















          • $begingroup$
            Input can now be 0-indexed; in case that helps
            $endgroup$
            – Luis Mendo
            May 17 at 20:58















          $begingroup$
          Input can now be 0-indexed; in case that helps
          $endgroup$
          – Luis Mendo
          May 17 at 20:58




          $begingroup$
          Input can now be 0-indexed; in case that helps
          $endgroup$
          – Luis Mendo
          May 17 at 20:58











          4












          $begingroup$


          Python 2, 217 215 212 bytes





          def f(x):
          b=['1'];n=1
          for i in range(x):P=max(j*(n%j<(j<=n**.5))for j in range(1,1+n));n+=P;b=[l+P*`j/P%2^i%2`for j,l in enumerate(b)];s=len(b[0]);b+=[((v*P+`1^int(v)`*P)*s)[:s]for v in b[0][len(b):]]
          return b


          Try it online!



          0-indexed, uses 0 and 1 as characters






          share|improve this answer











          $endgroup$








          • 1




            $begingroup$
            @LuisMendo saved 2 bytes :D
            $endgroup$
            – Rod
            May 21 at 12:41















          4












          $begingroup$


          Python 2, 217 215 212 bytes





          def f(x):
          b=['1'];n=1
          for i in range(x):P=max(j*(n%j<(j<=n**.5))for j in range(1,1+n));n+=P;b=[l+P*`j/P%2^i%2`for j,l in enumerate(b)];s=len(b[0]);b+=[((v*P+`1^int(v)`*P)*s)[:s]for v in b[0][len(b):]]
          return b


          Try it online!



          0-indexed, uses 0 and 1 as characters






          share|improve this answer











          $endgroup$








          • 1




            $begingroup$
            @LuisMendo saved 2 bytes :D
            $endgroup$
            – Rod
            May 21 at 12:41













          4












          4








          4





          $begingroup$


          Python 2, 217 215 212 bytes





          def f(x):
          b=['1'];n=1
          for i in range(x):P=max(j*(n%j<(j<=n**.5))for j in range(1,1+n));n+=P;b=[l+P*`j/P%2^i%2`for j,l in enumerate(b)];s=len(b[0]);b+=[((v*P+`1^int(v)`*P)*s)[:s]for v in b[0][len(b):]]
          return b


          Try it online!



          0-indexed, uses 0 and 1 as characters






          share|improve this answer











          $endgroup$




          Python 2, 217 215 212 bytes





          def f(x):
          b=['1'];n=1
          for i in range(x):P=max(j*(n%j<(j<=n**.5))for j in range(1,1+n));n+=P;b=[l+P*`j/P%2^i%2`for j,l in enumerate(b)];s=len(b[0]);b+=[((v*P+`1^int(v)`*P)*s)[:s]for v in b[0][len(b):]]
          return b


          Try it online!



          0-indexed, uses 0 and 1 as characters







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 21 at 12:46

























          answered May 17 at 19:45









          RodRod

          16.6k41983




          16.6k41983







          • 1




            $begingroup$
            @LuisMendo saved 2 bytes :D
            $endgroup$
            – Rod
            May 21 at 12:41












          • 1




            $begingroup$
            @LuisMendo saved 2 bytes :D
            $endgroup$
            – Rod
            May 21 at 12:41







          1




          1




          $begingroup$
          @LuisMendo saved 2 bytes :D
          $endgroup$
          – Rod
          May 21 at 12:41




          $begingroup$
          @LuisMendo saved 2 bytes :D
          $endgroup$
          – Rod
          May 21 at 12:41











          3












          $begingroup$


          Python 2, 184 178 176 169 bytes





          def h(j,a=['1'],R=range):
          for i in R(j):L=len(a);k=max(x for x in R(1,L+1)if(x*x<=L)>L%x);a=[a[m]+k*`(i+m/k)%2`for m in R(L)]+[((`i%2`*k+`~i%2`*k)*L)[:L+k]]*k
          return a


          Try it online!



          Uses 1, 0 for #, -; uses 0-indexing.






          share|improve this answer











          $endgroup$

















            3












            $begingroup$


            Python 2, 184 178 176 169 bytes





            def h(j,a=['1'],R=range):
            for i in R(j):L=len(a);k=max(x for x in R(1,L+1)if(x*x<=L)>L%x);a=[a[m]+k*`(i+m/k)%2`for m in R(L)]+[((`i%2`*k+`~i%2`*k)*L)[:L+k]]*k
            return a


            Try it online!



            Uses 1, 0 for #, -; uses 0-indexing.






            share|improve this answer











            $endgroup$















              3












              3








              3





              $begingroup$


              Python 2, 184 178 176 169 bytes





              def h(j,a=['1'],R=range):
              for i in R(j):L=len(a);k=max(x for x in R(1,L+1)if(x*x<=L)>L%x);a=[a[m]+k*`(i+m/k)%2`for m in R(L)]+[((`i%2`*k+`~i%2`*k)*L)[:L+k]]*k
              return a


              Try it online!



              Uses 1, 0 for #, -; uses 0-indexing.






              share|improve this answer











              $endgroup$




              Python 2, 184 178 176 169 bytes





              def h(j,a=['1'],R=range):
              for i in R(j):L=len(a);k=max(x for x in R(1,L+1)if(x*x<=L)>L%x);a=[a[m]+k*`(i+m/k)%2`for m in R(L)]+[((`i%2`*k+`~i%2`*k)*L)[:L+k]]*k
              return a


              Try it online!



              Uses 1, 0 for #, -; uses 0-indexing.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited May 18 at 0:12

























              answered May 17 at 22:13









              Chas BrownChas Brown

              5,5491623




              5,5491623





















                  3












                  $begingroup$


                  Jelly, 40 31 bytes



                  1SÆD>Ðḟ½ƊṀṭƲ³¡Äż$Ḷ:Ḃ^þ`ʋ/€ḷ""/Y


                  Try it online!



                  A full program taking the zero-indexed $S-1$ as input and writing to stdout ASCII art using 0 = #, 1 = +.



                  Without the trailing Y, this returns a list of lists of integers, but this is out of spec for this challenge.



                  Explanation



                  This program works in three stages.



                  1. Generate a list of values of $k$ and the cumulative sum of $k$

                  2. Generate a checkerboard for each of these with the tile size of $k$ and the board size of the cumulative sum

                  3. Work through the list of checkerboards, each time replacing the top-left section of the next board with the existing board.

                  Stage 1



                  1 | Start with 1
                  Ʋ³¡ | Loop through the following the number of times indicated by the first argument to the program; this generates a list of values of k
                  S | - Sum
                  Ɗ | - Following three links as a monad
                  ÆD | - List of divisors
                  >Ðḟ½ | - Exclude those greater than the square root
                  Ṁ | - Maximum
                  ṭ | - Concatenate this to the end of the current list of values of k
                  Äż$ | Zip the cumulative sum of the values of k with the values


                  Stage 2



                   ʋ/€ | For each pair of k and cumulative sum, call the following as a dyad with the cumulative sum of k as the left argument and k as the right (e.g. 15, 3)
                  Ḷ | - Lowered range [0, 1 ... , 13, 14]
                  : | - Integer division by k [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]
                  Ḃ | - Mod 2 [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0]
                  ^þ` | - Outer product using xor function and same argument to both side


                  Stage 3



                   / | Reduce using the following:
                  ḷ"" | - Replace the top left portion of the next matrix with the current one
                  Y | Finally join by newlines





                  share|improve this answer











                  $endgroup$












                  • $begingroup$
                    I think the asker actually wants the # and + characters. But wow, still impressive, I understood about half of it. And how do you even program in such a language? Is there a table of characters and their meaning where you just copy from?
                    $endgroup$
                    – Fabian Röling
                    May 18 at 22:36










                  • $begingroup$
                    @FabianRöling The OP states any two characters were acceptable. There’s a good introductory tutorial for Jelly at the github.com/DennisMitchell/jelly. If you know Python, the source is also fairly readable. Even with the tutorial and lists of atoms and Quicks, I found it took a little time and in some cases reference to the source to get my head round it.
                    $endgroup$
                    – Nick Kennedy
                    May 19 at 0:35















                  3












                  $begingroup$


                  Jelly, 40 31 bytes



                  1SÆD>Ðḟ½ƊṀṭƲ³¡Äż$Ḷ:Ḃ^þ`ʋ/€ḷ""/Y


                  Try it online!



                  A full program taking the zero-indexed $S-1$ as input and writing to stdout ASCII art using 0 = #, 1 = +.



                  Without the trailing Y, this returns a list of lists of integers, but this is out of spec for this challenge.



                  Explanation



                  This program works in three stages.



                  1. Generate a list of values of $k$ and the cumulative sum of $k$

                  2. Generate a checkerboard for each of these with the tile size of $k$ and the board size of the cumulative sum

                  3. Work through the list of checkerboards, each time replacing the top-left section of the next board with the existing board.

                  Stage 1



                  1 | Start with 1
                  Ʋ³¡ | Loop through the following the number of times indicated by the first argument to the program; this generates a list of values of k
                  S | - Sum
                  Ɗ | - Following three links as a monad
                  ÆD | - List of divisors
                  >Ðḟ½ | - Exclude those greater than the square root
                  Ṁ | - Maximum
                  ṭ | - Concatenate this to the end of the current list of values of k
                  Äż$ | Zip the cumulative sum of the values of k with the values


                  Stage 2



                   ʋ/€ | For each pair of k and cumulative sum, call the following as a dyad with the cumulative sum of k as the left argument and k as the right (e.g. 15, 3)
                  Ḷ | - Lowered range [0, 1 ... , 13, 14]
                  : | - Integer division by k [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]
                  Ḃ | - Mod 2 [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0]
                  ^þ` | - Outer product using xor function and same argument to both side


                  Stage 3



                   / | Reduce using the following:
                  ḷ"" | - Replace the top left portion of the next matrix with the current one
                  Y | Finally join by newlines





                  share|improve this answer











                  $endgroup$












                  • $begingroup$
                    I think the asker actually wants the # and + characters. But wow, still impressive, I understood about half of it. And how do you even program in such a language? Is there a table of characters and their meaning where you just copy from?
                    $endgroup$
                    – Fabian Röling
                    May 18 at 22:36










                  • $begingroup$
                    @FabianRöling The OP states any two characters were acceptable. There’s a good introductory tutorial for Jelly at the github.com/DennisMitchell/jelly. If you know Python, the source is also fairly readable. Even with the tutorial and lists of atoms and Quicks, I found it took a little time and in some cases reference to the source to get my head round it.
                    $endgroup$
                    – Nick Kennedy
                    May 19 at 0:35













                  3












                  3








                  3





                  $begingroup$


                  Jelly, 40 31 bytes



                  1SÆD>Ðḟ½ƊṀṭƲ³¡Äż$Ḷ:Ḃ^þ`ʋ/€ḷ""/Y


                  Try it online!



                  A full program taking the zero-indexed $S-1$ as input and writing to stdout ASCII art using 0 = #, 1 = +.



                  Without the trailing Y, this returns a list of lists of integers, but this is out of spec for this challenge.



                  Explanation



                  This program works in three stages.



                  1. Generate a list of values of $k$ and the cumulative sum of $k$

                  2. Generate a checkerboard for each of these with the tile size of $k$ and the board size of the cumulative sum

                  3. Work through the list of checkerboards, each time replacing the top-left section of the next board with the existing board.

                  Stage 1



                  1 | Start with 1
                  Ʋ³¡ | Loop through the following the number of times indicated by the first argument to the program; this generates a list of values of k
                  S | - Sum
                  Ɗ | - Following three links as a monad
                  ÆD | - List of divisors
                  >Ðḟ½ | - Exclude those greater than the square root
                  Ṁ | - Maximum
                  ṭ | - Concatenate this to the end of the current list of values of k
                  Äż$ | Zip the cumulative sum of the values of k with the values


                  Stage 2



                   ʋ/€ | For each pair of k and cumulative sum, call the following as a dyad with the cumulative sum of k as the left argument and k as the right (e.g. 15, 3)
                  Ḷ | - Lowered range [0, 1 ... , 13, 14]
                  : | - Integer division by k [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]
                  Ḃ | - Mod 2 [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0]
                  ^þ` | - Outer product using xor function and same argument to both side


                  Stage 3



                   / | Reduce using the following:
                  ḷ"" | - Replace the top left portion of the next matrix with the current one
                  Y | Finally join by newlines





                  share|improve this answer











                  $endgroup$




                  Jelly, 40 31 bytes



                  1SÆD>Ðḟ½ƊṀṭƲ³¡Äż$Ḷ:Ḃ^þ`ʋ/€ḷ""/Y


                  Try it online!



                  A full program taking the zero-indexed $S-1$ as input and writing to stdout ASCII art using 0 = #, 1 = +.



                  Without the trailing Y, this returns a list of lists of integers, but this is out of spec for this challenge.



                  Explanation



                  This program works in three stages.



                  1. Generate a list of values of $k$ and the cumulative sum of $k$

                  2. Generate a checkerboard for each of these with the tile size of $k$ and the board size of the cumulative sum

                  3. Work through the list of checkerboards, each time replacing the top-left section of the next board with the existing board.

                  Stage 1



                  1 | Start with 1
                  Ʋ³¡ | Loop through the following the number of times indicated by the first argument to the program; this generates a list of values of k
                  S | - Sum
                  Ɗ | - Following three links as a monad
                  ÆD | - List of divisors
                  >Ðḟ½ | - Exclude those greater than the square root
                  Ṁ | - Maximum
                  ṭ | - Concatenate this to the end of the current list of values of k
                  Äż$ | Zip the cumulative sum of the values of k with the values


                  Stage 2



                   ʋ/€ | For each pair of k and cumulative sum, call the following as a dyad with the cumulative sum of k as the left argument and k as the right (e.g. 15, 3)
                  Ḷ | - Lowered range [0, 1 ... , 13, 14]
                  : | - Integer division by k [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]
                  Ḃ | - Mod 2 [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0]
                  ^þ` | - Outer product using xor function and same argument to both side


                  Stage 3



                   / | Reduce using the following:
                  ḷ"" | - Replace the top left portion of the next matrix with the current one
                  Y | Finally join by newlines






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited May 18 at 17:38

























                  answered May 18 at 4:23









                  Nick KennedyNick Kennedy

                  2,65469




                  2,65469











                  • $begingroup$
                    I think the asker actually wants the # and + characters. But wow, still impressive, I understood about half of it. And how do you even program in such a language? Is there a table of characters and their meaning where you just copy from?
                    $endgroup$
                    – Fabian Röling
                    May 18 at 22:36










                  • $begingroup$
                    @FabianRöling The OP states any two characters were acceptable. There’s a good introductory tutorial for Jelly at the github.com/DennisMitchell/jelly. If you know Python, the source is also fairly readable. Even with the tutorial and lists of atoms and Quicks, I found it took a little time and in some cases reference to the source to get my head round it.
                    $endgroup$
                    – Nick Kennedy
                    May 19 at 0:35
















                  • $begingroup$
                    I think the asker actually wants the # and + characters. But wow, still impressive, I understood about half of it. And how do you even program in such a language? Is there a table of characters and their meaning where you just copy from?
                    $endgroup$
                    – Fabian Röling
                    May 18 at 22:36










                  • $begingroup$
                    @FabianRöling The OP states any two characters were acceptable. There’s a good introductory tutorial for Jelly at the github.com/DennisMitchell/jelly. If you know Python, the source is also fairly readable. Even with the tutorial and lists of atoms and Quicks, I found it took a little time and in some cases reference to the source to get my head round it.
                    $endgroup$
                    – Nick Kennedy
                    May 19 at 0:35















                  $begingroup$
                  I think the asker actually wants the # and + characters. But wow, still impressive, I understood about half of it. And how do you even program in such a language? Is there a table of characters and their meaning where you just copy from?
                  $endgroup$
                  – Fabian Röling
                  May 18 at 22:36




                  $begingroup$
                  I think the asker actually wants the # and + characters. But wow, still impressive, I understood about half of it. And how do you even program in such a language? Is there a table of characters and their meaning where you just copy from?
                  $endgroup$
                  – Fabian Röling
                  May 18 at 22:36












                  $begingroup$
                  @FabianRöling The OP states any two characters were acceptable. There’s a good introductory tutorial for Jelly at the github.com/DennisMitchell/jelly. If you know Python, the source is also fairly readable. Even with the tutorial and lists of atoms and Quicks, I found it took a little time and in some cases reference to the source to get my head round it.
                  $endgroup$
                  – Nick Kennedy
                  May 19 at 0:35




                  $begingroup$
                  @FabianRöling The OP states any two characters were acceptable. There’s a good introductory tutorial for Jelly at the github.com/DennisMitchell/jelly. If you know Python, the source is also fairly readable. Even with the tutorial and lists of atoms and Quicks, I found it took a little time and in some cases reference to the source to get my head round it.
                  $endgroup$
                  – Nick Kennedy
                  May 19 at 0:35











                  2












                  $begingroup$

                  JavaScript (ES7), 164 bytes



                  Input is 0-indexed. Outputs a matrix with $0$ for # and $1$ for +.





                  n=>(b=[1],g=(a,w,d=w**.5|0)=>b[n]?a:w%d?g(a,w,d-1):g(a.concat(Array(d).fill(b.push(d)&&i++)),w+d))([0],i=1).map((_,y,a)=>a.map((_,x)=>(x/b[v=a[x>y?x:y]]^y/b[v])&1))


                  Try it online!






                  share|improve this answer











                  $endgroup$

















                    2












                    $begingroup$

                    JavaScript (ES7), 164 bytes



                    Input is 0-indexed. Outputs a matrix with $0$ for # and $1$ for +.





                    n=>(b=[1],g=(a,w,d=w**.5|0)=>b[n]?a:w%d?g(a,w,d-1):g(a.concat(Array(d).fill(b.push(d)&&i++)),w+d))([0],i=1).map((_,y,a)=>a.map((_,x)=>(x/b[v=a[x>y?x:y]]^y/b[v])&1))


                    Try it online!






                    share|improve this answer











                    $endgroup$















                      2












                      2








                      2





                      $begingroup$

                      JavaScript (ES7), 164 bytes



                      Input is 0-indexed. Outputs a matrix with $0$ for # and $1$ for +.





                      n=>(b=[1],g=(a,w,d=w**.5|0)=>b[n]?a:w%d?g(a,w,d-1):g(a.concat(Array(d).fill(b.push(d)&&i++)),w+d))([0],i=1).map((_,y,a)=>a.map((_,x)=>(x/b[v=a[x>y?x:y]]^y/b[v])&1))


                      Try it online!






                      share|improve this answer











                      $endgroup$



                      JavaScript (ES7), 164 bytes



                      Input is 0-indexed. Outputs a matrix with $0$ for # and $1$ for +.





                      n=>(b=[1],g=(a,w,d=w**.5|0)=>b[n]?a:w%d?g(a,w,d-1):g(a.concat(Array(d).fill(b.push(d)&&i++)),w+d))([0],i=1).map((_,y,a)=>a.map((_,x)=>(x/b[v=a[x>y?x:y]]^y/b[v])&1))


                      Try it online!







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited May 17 at 22:33

























                      answered May 17 at 20:50









                      ArnauldArnauld

                      85.2k7100349




                      85.2k7100349





















                          1












                          $begingroup$


                          Charcoal, 37 bytes



                          FN«≔⊕⌈Φ₂⊕Lυ¬﹪Lυ⊕κηFη«PL⭆⊞Oυω§#+÷⁻κμη↙


                          Try it online! Link is to verbose version of code. 1-indexed. Output grows down and left (down and right costs an extra byte, but can grow up for the same byte count). Explanation:



                          FN«


                          Loop $S$ times.



                          ≔⊕⌈Φ₂⊕Lυ¬﹪Lυ⊕κη


                          Calculate $kleqsqrtn+1$. This only makes a difference when $n=0$ in which case this formula allows $k=1$.



                          Fη«


                          Loop $k$ times, once for each new row and column.



                          PL⭆⊞Oυω§#+÷⁻κμη


                          Output the row and column, being sure to alternate between the # and + characters in such a way that # is always the first character but that there is a boundary at the end of the string (because we're drawing from the diagonal outwards). ⊞Oυω makes each row one character longer each time, which also keeps track of $n$ as the length.






                          Move down and left ready for the next row.






                          share|improve this answer











                          $endgroup$

















                            1












                            $begingroup$


                            Charcoal, 37 bytes



                            FN«≔⊕⌈Φ₂⊕Lυ¬﹪Lυ⊕κηFη«PL⭆⊞Oυω§#+÷⁻κμη↙


                            Try it online! Link is to verbose version of code. 1-indexed. Output grows down and left (down and right costs an extra byte, but can grow up for the same byte count). Explanation:



                            FN«


                            Loop $S$ times.



                            ≔⊕⌈Φ₂⊕Lυ¬﹪Lυ⊕κη


                            Calculate $kleqsqrtn+1$. This only makes a difference when $n=0$ in which case this formula allows $k=1$.



                            Fη«


                            Loop $k$ times, once for each new row and column.



                            PL⭆⊞Oυω§#+÷⁻κμη


                            Output the row and column, being sure to alternate between the # and + characters in such a way that # is always the first character but that there is a boundary at the end of the string (because we're drawing from the diagonal outwards). ⊞Oυω makes each row one character longer each time, which also keeps track of $n$ as the length.






                            Move down and left ready for the next row.






                            share|improve this answer











                            $endgroup$















                              1












                              1








                              1





                              $begingroup$


                              Charcoal, 37 bytes



                              FN«≔⊕⌈Φ₂⊕Lυ¬﹪Lυ⊕κηFη«PL⭆⊞Oυω§#+÷⁻κμη↙


                              Try it online! Link is to verbose version of code. 1-indexed. Output grows down and left (down and right costs an extra byte, but can grow up for the same byte count). Explanation:



                              FN«


                              Loop $S$ times.



                              ≔⊕⌈Φ₂⊕Lυ¬﹪Lυ⊕κη


                              Calculate $kleqsqrtn+1$. This only makes a difference when $n=0$ in which case this formula allows $k=1$.



                              Fη«


                              Loop $k$ times, once for each new row and column.



                              PL⭆⊞Oυω§#+÷⁻κμη


                              Output the row and column, being sure to alternate between the # and + characters in such a way that # is always the first character but that there is a boundary at the end of the string (because we're drawing from the diagonal outwards). ⊞Oυω makes each row one character longer each time, which also keeps track of $n$ as the length.






                              Move down and left ready for the next row.






                              share|improve this answer











                              $endgroup$




                              Charcoal, 37 bytes



                              FN«≔⊕⌈Φ₂⊕Lυ¬﹪Lυ⊕κηFη«PL⭆⊞Oυω§#+÷⁻κμη↙


                              Try it online! Link is to verbose version of code. 1-indexed. Output grows down and left (down and right costs an extra byte, but can grow up for the same byte count). Explanation:



                              FN«


                              Loop $S$ times.



                              ≔⊕⌈Φ₂⊕Lυ¬﹪Lυ⊕κη


                              Calculate $kleqsqrtn+1$. This only makes a difference when $n=0$ in which case this formula allows $k=1$.



                              Fη«


                              Loop $k$ times, once for each new row and column.



                              PL⭆⊞Oυω§#+÷⁻κμη


                              Output the row and column, being sure to alternate between the # and + characters in such a way that # is always the first character but that there is a boundary at the end of the string (because we're drawing from the diagonal outwards). ⊞Oυω makes each row one character longer each time, which also keeps track of $n$ as the length.






                              Move down and left ready for the next row.







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited May 18 at 15:31

























                              answered May 18 at 15:25









                              NeilNeil

                              84.6k845183




                              84.6k845183





















                                  1












                                  $begingroup$

                                  Haskell, 149 146 bytes



                                  (iterate g["#"]!!)
                                  g b|let e=(<$[1..d]);l=length b;d=last[i|i<-[1..l],i*i<=l,mod l i<1];m="+#"++m=(e$take(l+d)$e=<<'#':m)++zipWith(++)(e=<<e<$>m)b


                                  This is 0 indexed, returns a list of strings and grows upwards and leftwards.



                                  Try it online!



                                  (iterate g["#"]!!) -- start with ["#"], repeatedly add a layer
                                  -- (via function 'g'), collect all results in
                                  -- a list and index it with the input number

                                  g b | let -- add a single layer to chessboard 'b'

                                  l=length b -- let 'l' be the size of 'b'
                                  d=last[i|i<-[1..l],i*i<=l,mod l i<1] -- let 'd' be the size of the new layer
                                  e=(<$[1..d]) -- let 'e' be a functions that makes 'd'
                                  -- copies of it's argument
                                  m="#+"++m -- let 'm' be an infinite string of "+#+#+..."

                                  = -- return
                                  zipWith(++) -- concatenate pairwise
                                  (e=<<e<$>m) -- a list of squares made by expanding each
                                  -- char in 'm' to size 'd'-by-'d'
                                  b -- and 'b' (zipWith truncates the infinite
                                  -- list of squares to the length of 'b')
                                  --
                                  ++ -- and prepend
                                  --
                                  (e$take(l+d)$e=<<'#':m) -- the top layer, i.e. a list of 'd' strings
                                  -- each with the pattern 'd' times '#'
                                  -- followed by 'd' times '+', etc., each
                                  -- shortened to the correct size of 'l'+'g'





                                  share|improve this answer











                                  $endgroup$

















                                    1












                                    $begingroup$

                                    Haskell, 149 146 bytes



                                    (iterate g["#"]!!)
                                    g b|let e=(<$[1..d]);l=length b;d=last[i|i<-[1..l],i*i<=l,mod l i<1];m="+#"++m=(e$take(l+d)$e=<<'#':m)++zipWith(++)(e=<<e<$>m)b


                                    This is 0 indexed, returns a list of strings and grows upwards and leftwards.



                                    Try it online!



                                    (iterate g["#"]!!) -- start with ["#"], repeatedly add a layer
                                    -- (via function 'g'), collect all results in
                                    -- a list and index it with the input number

                                    g b | let -- add a single layer to chessboard 'b'

                                    l=length b -- let 'l' be the size of 'b'
                                    d=last[i|i<-[1..l],i*i<=l,mod l i<1] -- let 'd' be the size of the new layer
                                    e=(<$[1..d]) -- let 'e' be a functions that makes 'd'
                                    -- copies of it's argument
                                    m="#+"++m -- let 'm' be an infinite string of "+#+#+..."

                                    = -- return
                                    zipWith(++) -- concatenate pairwise
                                    (e=<<e<$>m) -- a list of squares made by expanding each
                                    -- char in 'm' to size 'd'-by-'d'
                                    b -- and 'b' (zipWith truncates the infinite
                                    -- list of squares to the length of 'b')
                                    --
                                    ++ -- and prepend
                                    --
                                    (e$take(l+d)$e=<<'#':m) -- the top layer, i.e. a list of 'd' strings
                                    -- each with the pattern 'd' times '#'
                                    -- followed by 'd' times '+', etc., each
                                    -- shortened to the correct size of 'l'+'g'





                                    share|improve this answer











                                    $endgroup$















                                      1












                                      1








                                      1





                                      $begingroup$

                                      Haskell, 149 146 bytes



                                      (iterate g["#"]!!)
                                      g b|let e=(<$[1..d]);l=length b;d=last[i|i<-[1..l],i*i<=l,mod l i<1];m="+#"++m=(e$take(l+d)$e=<<'#':m)++zipWith(++)(e=<<e<$>m)b


                                      This is 0 indexed, returns a list of strings and grows upwards and leftwards.



                                      Try it online!



                                      (iterate g["#"]!!) -- start with ["#"], repeatedly add a layer
                                      -- (via function 'g'), collect all results in
                                      -- a list and index it with the input number

                                      g b | let -- add a single layer to chessboard 'b'

                                      l=length b -- let 'l' be the size of 'b'
                                      d=last[i|i<-[1..l],i*i<=l,mod l i<1] -- let 'd' be the size of the new layer
                                      e=(<$[1..d]) -- let 'e' be a functions that makes 'd'
                                      -- copies of it's argument
                                      m="#+"++m -- let 'm' be an infinite string of "+#+#+..."

                                      = -- return
                                      zipWith(++) -- concatenate pairwise
                                      (e=<<e<$>m) -- a list of squares made by expanding each
                                      -- char in 'm' to size 'd'-by-'d'
                                      b -- and 'b' (zipWith truncates the infinite
                                      -- list of squares to the length of 'b')
                                      --
                                      ++ -- and prepend
                                      --
                                      (e$take(l+d)$e=<<'#':m) -- the top layer, i.e. a list of 'd' strings
                                      -- each with the pattern 'd' times '#'
                                      -- followed by 'd' times '+', etc., each
                                      -- shortened to the correct size of 'l'+'g'





                                      share|improve this answer











                                      $endgroup$



                                      Haskell, 149 146 bytes



                                      (iterate g["#"]!!)
                                      g b|let e=(<$[1..d]);l=length b;d=last[i|i<-[1..l],i*i<=l,mod l i<1];m="+#"++m=(e$take(l+d)$e=<<'#':m)++zipWith(++)(e=<<e<$>m)b


                                      This is 0 indexed, returns a list of strings and grows upwards and leftwards.



                                      Try it online!



                                      (iterate g["#"]!!) -- start with ["#"], repeatedly add a layer
                                      -- (via function 'g'), collect all results in
                                      -- a list and index it with the input number

                                      g b | let -- add a single layer to chessboard 'b'

                                      l=length b -- let 'l' be the size of 'b'
                                      d=last[i|i<-[1..l],i*i<=l,mod l i<1] -- let 'd' be the size of the new layer
                                      e=(<$[1..d]) -- let 'e' be a functions that makes 'd'
                                      -- copies of it's argument
                                      m="#+"++m -- let 'm' be an infinite string of "+#+#+..."

                                      = -- return
                                      zipWith(++) -- concatenate pairwise
                                      (e=<<e<$>m) -- a list of squares made by expanding each
                                      -- char in 'm' to size 'd'-by-'d'
                                      b -- and 'b' (zipWith truncates the infinite
                                      -- list of squares to the length of 'b')
                                      --
                                      ++ -- and prepend
                                      --
                                      (e$take(l+d)$e=<<'#':m) -- the top layer, i.e. a list of 'd' strings
                                      -- each with the pattern 'd' times '#'
                                      -- followed by 'd' times '+', etc., each
                                      -- shortened to the correct size of 'l'+'g'






                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited May 18 at 21:58

























                                      answered May 18 at 15:47









                                      niminimi

                                      33.2k32491




                                      33.2k32491





















                                          1












                                          $begingroup$


                                          Perl 6, 156 144 155 154 bytes



                                          +11 to fix a bug reported by nimi.





                                          $!=-1;join "
                                          ",(1,my k=max grep $_%%*,1.. .sqrt;++$!;flat .kv.map(->i,l l~($!+i/k)%2+),substr(($!%2 x k~1-$!%2 x k)x$_,0,$_+k)xx k...*)[$_]


                                          Roughly based on Chas Brown's Python solution. Takes S zero-indexedly. Outputs 0 and 1.



                                          Try it online!






                                          share|improve this answer











                                          $endgroup$












                                          • $begingroup$
                                            Fixed. Now the corners should share the same colour.
                                            $endgroup$
                                            – bb94
                                            May 21 at 5:03















                                          1












                                          $begingroup$


                                          Perl 6, 156 144 155 154 bytes



                                          +11 to fix a bug reported by nimi.





                                          $!=-1;join "
                                          ",(1,my k=max grep $_%%*,1.. .sqrt;++$!;flat .kv.map(->i,l l~($!+i/k)%2+),substr(($!%2 x k~1-$!%2 x k)x$_,0,$_+k)xx k...*)[$_]


                                          Roughly based on Chas Brown's Python solution. Takes S zero-indexedly. Outputs 0 and 1.



                                          Try it online!






                                          share|improve this answer











                                          $endgroup$












                                          • $begingroup$
                                            Fixed. Now the corners should share the same colour.
                                            $endgroup$
                                            – bb94
                                            May 21 at 5:03













                                          1












                                          1








                                          1





                                          $begingroup$


                                          Perl 6, 156 144 155 154 bytes



                                          +11 to fix a bug reported by nimi.





                                          $!=-1;join "
                                          ",(1,my k=max grep $_%%*,1.. .sqrt;++$!;flat .kv.map(->i,l l~($!+i/k)%2+),substr(($!%2 x k~1-$!%2 x k)x$_,0,$_+k)xx k...*)[$_]


                                          Roughly based on Chas Brown's Python solution. Takes S zero-indexedly. Outputs 0 and 1.



                                          Try it online!






                                          share|improve this answer











                                          $endgroup$




                                          Perl 6, 156 144 155 154 bytes



                                          +11 to fix a bug reported by nimi.





                                          $!=-1;join "
                                          ",(1,my k=max grep $_%%*,1.. .sqrt;++$!;flat .kv.map(->i,l l~($!+i/k)%2+),substr(($!%2 x k~1-$!%2 x k)x$_,0,$_+k)xx k...*)[$_]


                                          Roughly based on Chas Brown's Python solution. Takes S zero-indexedly. Outputs 0 and 1.



                                          Try it online!







                                          share|improve this answer














                                          share|improve this answer



                                          share|improve this answer








                                          edited May 21 at 4:59

























                                          answered May 19 at 18:00









                                          bb94bb94

                                          1,431715




                                          1,431715











                                          • $begingroup$
                                            Fixed. Now the corners should share the same colour.
                                            $endgroup$
                                            – bb94
                                            May 21 at 5:03
















                                          • $begingroup$
                                            Fixed. Now the corners should share the same colour.
                                            $endgroup$
                                            – bb94
                                            May 21 at 5:03















                                          $begingroup$
                                          Fixed. Now the corners should share the same colour.
                                          $endgroup$
                                          – bb94
                                          May 21 at 5:03




                                          $begingroup$
                                          Fixed. Now the corners should share the same colour.
                                          $endgroup$
                                          – bb94
                                          May 21 at 5:03

















                                          draft saved

                                          draft discarded
















































                                          If this is an answer to a challenge…



                                          • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                                          • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                                            Explanations of your answer make it more interesting to read and are very much encouraged.


                                          • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.


                                          More generally…



                                          • …Please make sure to answer the question and provide sufficient detail.


                                          • …Avoid asking for help, clarification or responding to other answers (use comments instead).




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function ()
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f185744%2fwarped-chessboard%23new-answer', 'question_page');

                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                                          Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                                          Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020