Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 51 characters in body
Source Link

Bash + Core utilities, (削除) 27 (削除ここまで), 25 bytes

seq -f8d%f*7-v1+2/n 45|dc

Try it online!


Changed seq formatting from %0.f to %f for a 2-byte savings.

Modified to print on one line, with no delimiters, instead of having a newline after each number, just because I like that better. Same number of bytes.


This uses the formula $$\left\lfloor\frac{\big\lfloor\sqrt{8n-7}\big\rfloor+1}2\right\rfloor$$

for the \$n^{th}\$ digit, where \$n\$ goes from 1 to 45.

Bash, (削除) 27 (削除ここまで), 25 bytes

seq -f8d%f*7-v1+2/n 45|dc

Try it online!


Changed seq formatting from %0.f to %f for a 2-byte savings.

Modified to print on one line, instead of having a newline after each number. Same number of bytes.


This uses the formula $$\left\lfloor\frac{\big\lfloor\sqrt{8n-7}\big\rfloor+1}2\right\rfloor$$

for the \$n^{th}\$ digit, where \$n\$ goes from 1 to 45.

Bash + Core utilities, (削除) 27 (削除ここまで), 25 bytes

seq -f8d%f*7-v1+2/n 45|dc

Try it online!


Changed seq formatting from %0.f to %f for a 2-byte savings.

Modified to print on one line, with no delimiters, instead of having a newline after each number, just because I like that better. Same number of bytes.


This uses the formula $$\left\lfloor\frac{\big\lfloor\sqrt{8n-7}\big\rfloor+1}2\right\rfloor$$

for the \$n^{th}\$ digit, where \$n\$ goes from 1 to 45.

added 70 characters in body
Source Link

Bash, 27(削除) 27 (削除ここまで), 25 bytes

seq -f8d%0.f*7f8d%f*7-v1+2/n 45|dc

Try it online! Try it online!


Changed seq formatting from %0.f to %f for a 2-byte savings.

Modified to print on one line, instead of having a newline after each number. Same number of bytes.


This uses the formula $$\left\lfloor\frac{\big\lfloor\sqrt{8n-7}\big\rfloor+1}2\right\rfloor$$

for the \$n^{th}\$ digit, where \$n\$ goes from 1 to 45.

Bash, 27 bytes

seq -f8d%0.f*7-v1+2/n 45|dc

Try it online!


Modified to print on one line, instead of having a newline after each number. Same number of bytes.


This uses the formula $$\left\lfloor\frac{\big\lfloor\sqrt{8n-7}\big\rfloor+1}2\right\rfloor$$

for the \$n^{th}\$ digit, where \$n\$ goes from 1 to 45.

Bash, (削除) 27 (削除ここまで), 25 bytes

seq -f8d%f*7-v1+2/n 45|dc

Try it online!


Changed seq formatting from %0.f to %f for a 2-byte savings.

Modified to print on one line, instead of having a newline after each number. Same number of bytes.


This uses the formula $$\left\lfloor\frac{\big\lfloor\sqrt{8n-7}\big\rfloor+1}2\right\rfloor$$

for the \$n^{th}\$ digit, where \$n\$ goes from 1 to 45.

added 108 characters in body
Source Link

Bash + GNU utilities, 27 bytes

seq -f8d%0.f*7-v1+2/pn 45|dc

Try it online! Try it online!


Modified to print on one line, instead of having a newline after each number. Same number of bytes.


This uses the formula $$\left\lfloor\frac{\big\lfloor\sqrt{8n-7}\big\rfloor+1}2\right\rfloor$$

for the \$n^{th}\$ digit, where \$n\$ goes from 1 to 45.

Bash + GNU utilities, 27 bytes

seq -f8d%0.f*7-v1+2/p 45|dc

Try it online!

This uses the formula $$\left\lfloor\frac{\big\lfloor\sqrt{8n-7}\big\rfloor+1}2\right\rfloor$$

for the \$n^{th}\$ digit, where \$n\$ goes from 1 to 45.

Bash, 27 bytes

seq -f8d%0.f*7-v1+2/n 45|dc

Try it online!


Modified to print on one line, instead of having a newline after each number. Same number of bytes.


This uses the formula $$\left\lfloor\frac{\big\lfloor\sqrt{8n-7}\big\rfloor+1}2\right\rfloor$$

for the \$n^{th}\$ digit, where \$n\$ goes from 1 to 45.

added 11 characters in body
Source Link
Loading
added 14 characters in body
Source Link
Loading
Source Link
Loading

AltStyle によって変換されたページ (->オリジナル) /