Skip to main content
deleted 9 characters in body
Source Link
Magic Octopus Urn
  • 20.9k
  • 6
  • 66
  • 140
FN©ƒ®Ne0})  # Generate, iteratively, the current pascal row, interspersed with 0's.   ¹®-Å0* Å0 # Calculate the number of zeros to middle pad it.   .ø˜¨ˆ}¯øO # Surround with the zeros, transpose and sum. 

Basically all it does is generate this:

0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 2 0 1 0 0 0 0 0 0 0 1 0 3 0 3 0 1 0 0 0 0 0 1 0 4 0 6 0 4 0 1 0 0 

Transpose it:

0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 4 0 1 0 3 0 1 0 2 0 6 0 1 0 3 0 0 0 1 0 4 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 

Then sums each row:

0 1 1 5 4 9 4 5 1 1 0 

If a leading and trailing 0 are not acceptable, I can add 0K®>-Å to the end to fixisntead of ®-Å fixes it for a +2+1 byte penalty.

This removes all zeros from the end result, and as no valid sums are to be 0, it is fine.

¦¨ would also work for this fix.

FN©ƒ®Ne0})  # Generate, iteratively, the current pascal row, interspersed with 0's.   ¹®-Å0*  # Calculate the number of zeros to middle pad it.   .ø˜¨ˆ}¯øO # Surround with the zeros, transpose and sum. 

If a leading and trailing 0 are not acceptable, I can add 0K to the end to fix it for a +2 byte penalty.

This removes all zeros from the end result, and as no valid sums are to be 0, it is fine.

¦¨ would also work for this fix.

FN©ƒ®Ne0}) # Generate, iteratively, the current pascal row, interspersed with 0's. ¹®-Å0 # Calculate the number of zeros to middle pad it. .ø˜¨ˆ}¯øO # Surround with the zeros, transpose and sum. 

Basically all it does is generate this:

0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 2 0 1 0 0 0 0 0 0 0 1 0 3 0 3 0 1 0 0 0 0 0 1 0 4 0 6 0 4 0 1 0 0 

Transpose it:

0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 4 0 1 0 3 0 1 0 2 0 6 0 1 0 3 0 0 0 1 0 4 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 

Then sums each row:

0 1 1 5 4 9 4 5 1 1 0 

If a leading and trailing 0 are not acceptable, ®>-Å isntead of ®-Å fixes it for a +1 byte penalty.

deleted 47 characters in body
Source Link
Magic Octopus Urn
  • 20.9k
  • 6
  • 66
  • 140

05AB1E, 34 32 28 25 24 bytes

-4 thanks to Emigna.

FN©ƒ®Ne0})¹®-Å0.ø˜¨ˆ}¯øO 

Try it online!


FN©ƒ®Ne0}) # Generate, iteratively, the current pascal row, interspersed with 0's. ¹®-Å0* # Calculate the number of zeros to middle pad it. .ø˜¨ˆ}¯øO # Surround with the zeros, transpose and sum. 

If a leading and trailing 0 are not acceptable, I can add 0K to the end to fix it for a +2 byte penalty.

This removes all zeros from the end result, and as no valid sums are to be 0, it is fine.

¦¨ would also work for this fix.


Result for 50:

[0, 1, 1, 50, 49, 1224, 1175, 19551, 18376, 229125, 210749, 2100384, 1889635, 15679951, 13790316, 97994765, 84204449, 523088334, 438883885, 2421229251, 1982345366, 9833394285, 7851048919, 35371393434, 27520344515, 113548602181, 86028257666, 327340174085, 241311916419, 851817398634, 610505482215, 2009517658701, 1399012176486, 4313184213360, 2914172036874, 8448367214664, 5534195177790, 15139356846901, 9605161669111, 24871748205410, 15266586536299, 37524050574849, 22257464038550, 52060859526501, 29803395487951, 66492351226050, 36688955738099, 78239857877649, 41550902139550, 84859704298201, 43308802158651, 84859704298201, 41550902139550, 78239857877649, 36688955738099, 66492351226050, 29803395487951, 52060859526501, 22257464038550, 37524050574849, 15266586536299, 24871748205410, 9605161669111, 15139356846901, 5534195177790, 8448367214664, 2914172036874, 4313184213360, 1399012176486, 2009517658701, 610505482215, 851817398634, 241311916419, 327340174085, 86028257666, 113548602181, 27520344515, 35371393434, 7851048919, 9833394285, 1982345366, 2421229251, 438883885, 523088334, 84204449, 97994765, 13790316, 15679951, 1889635, 2100384, 210749, 229125, 18376, 19551, 1175, 1224, 49, 50, 1, 1, 0] 

05AB1E, 34 32 28 25 24 bytes

-4 thanks to Emigna.

FN©ƒ®Ne0})¹®-Å0.ø˜¨ˆ}¯øO 

Try it online!


FN©ƒ®Ne0}) # Generate, iteratively, the current pascal row, interspersed with 0's. ¹®-Å0* # Calculate the number of zeros to middle pad it. .ø˜¨ˆ}¯øO # Surround with the zeros, transpose and sum. 

If a leading and trailing 0 are not acceptable, I can add 0K to the end to fix it for a +2 byte penalty.

05AB1E, 34 32 28 25 24 bytes

-4 thanks to Emigna.

FN©ƒ®Ne0})¹®-Å0.ø˜¨ˆ}¯øO 

Try it online!


FN©ƒ®Ne0}) # Generate, iteratively, the current pascal row, interspersed with 0's. ¹®-Å0* # Calculate the number of zeros to middle pad it. .ø˜¨ˆ}¯øO # Surround with the zeros, transpose and sum. 

If a leading and trailing 0 are not acceptable, I can add 0K to the end to fix it for a +2 byte penalty.

This removes all zeros from the end result, and as no valid sums are to be 0, it is fine.

¦¨ would also work for this fix.


Result for 50:

[0, 1, 1, 50, 49, 1224, 1175, 19551, 18376, 229125, 210749, 2100384, 1889635, 15679951, 13790316, 97994765, 84204449, 523088334, 438883885, 2421229251, 1982345366, 9833394285, 7851048919, 35371393434, 27520344515, 113548602181, 86028257666, 327340174085, 241311916419, 851817398634, 610505482215, 2009517658701, 1399012176486, 4313184213360, 2914172036874, 8448367214664, 5534195177790, 15139356846901, 9605161669111, 24871748205410, 15266586536299, 37524050574849, 22257464038550, 52060859526501, 29803395487951, 66492351226050, 36688955738099, 78239857877649, 41550902139550, 84859704298201, 43308802158651, 84859704298201, 41550902139550, 78239857877649, 36688955738099, 66492351226050, 29803395487951, 52060859526501, 22257464038550, 37524050574849, 15266586536299, 24871748205410, 9605161669111, 15139356846901, 5534195177790, 8448367214664, 2914172036874, 4313184213360, 1399012176486, 2009517658701, 610505482215, 851817398634, 241311916419, 327340174085, 86028257666, 113548602181, 27520344515, 35371393434, 7851048919, 9833394285, 1982345366, 2421229251, 438883885, 523088334, 84204449, 97994765, 13790316, 15679951, 1889635, 2100384, 210749, 229125, 18376, 19551, 1175, 1224, 49, 50, 1, 1, 0] 
deleted 47 characters in body
Source Link
Magic Octopus Urn
  • 20.9k
  • 6
  • 66
  • 140

05AB1E, 34 32 28 25 24 bytes

-4 thanks to Emigna.

FN©ƒ®Ne0})¹®-Å0.ø˜¨ˆ}¯øO 

Try it online!

STILL consolidating the code... Will explain soon.

 
FN©ƒ®Ne0}) # Generate, iteratively, the current pascal row, interspersed with 0's. ¹®-Å0* # Calculate the number of zeros to middle pad it. .ø˜¨ˆ}¯øO # Surround with the zeros, transpose and sum. 

If a leading and trailing 0 are not acceptable, I can add 0K to the end to fix it for a +2 byte penalty.

05AB1E, 34 32 28 25 24 bytes

-4 thanks to Emigna.

FN©ƒ®Ne0})¹®-Å0.ø˜¨ˆ}¯øO 

Try it online!

STILL consolidating the code... Will explain soon.

FN©ƒ®Ne0}) # Generate, iteratively, the current pascal row, interspersed with 0's. ¹®-Å0* # Calculate the number of zeros to middle pad it. .ø˜¨ˆ}¯øO # Surround with the zeros, transpose and sum. 

05AB1E, 34 32 28 25 24 bytes

-4 thanks to Emigna.

FN©ƒ®Ne0})¹®-Å0.ø˜¨ˆ}¯øO 

Try it online!

 
FN©ƒ®Ne0}) # Generate, iteratively, the current pascal row, interspersed with 0's. ¹®-Å0* # Calculate the number of zeros to middle pad it. .ø˜¨ˆ}¯øO # Surround with the zeros, transpose and sum. 

If a leading and trailing 0 are not acceptable, I can add 0K to the end to fix it for a +2 byte penalty.

added 32 characters in body
Source Link
Magic Octopus Urn
  • 20.9k
  • 6
  • 66
  • 140
Loading
added 8 characters in body
Source Link
Magic Octopus Urn
  • 20.9k
  • 6
  • 66
  • 140
Loading
Source Link
Magic Octopus Urn
  • 20.9k
  • 6
  • 66
  • 140
Loading