Post History
Python 3, 183 181 175 bytes def f(a,b): c=a;a=str(a) for i in range(b): y=0;z=9 for j in range(len(a)): if y<int(a[j]):y=int(a[j]) if z>int(a[j]):z=int(a[j]) c=int(a)+...
Answer
#3: Post edited
# [Python 3], <s>183</s> 181 bytes- <!-- language-all: lang-python -->
- <pre><code>def f(a,b):
	c=a;a=str(a);y,z=0,9- 	for i in range(b):
- 		for j in range(len(a)):
- 			if y<int(a[j]):y=int(a[j])
- 			if z>int(a[j]):z=int(a[j])
		c=int(a)+y+z;a=str(c);y=0;z=9- 	print(c)
- </code></pre>
[Try it online!][TIO-ktc8iz68]I decided to go for outputting the `i`th value of the sequence, 0-indexed. `a` is the number to be sequenced and `b` is the index of the value to be printed.- [Python 3]: https://docs.python.org/3/
[TIO-ktc8iz68]: https://tio.run/##VY5BDsIgEEXX5RQsmZRFrXFhKV7EuBgRlMbQBtnA5RGxsXH357/5yVtieMxun/NNG2oY8isMpFESBcpX8AxBRJ5kx4@kMbOnllpHPbq7ZvWzltNWPrUrm0oaa2gcrQsMz9MFhih/eaXptNH0R9X3gja2aTVRxUR2IslisvgPVpAN2/ED5J70bw "Python 3 – Try It Online"
- # [Python 3], <s>183</s> <s>181</s> 175 bytes
- <!-- language-all: lang-python -->
- <pre><code>def f(a,b):
- 	c=a;a=str(a)
- 	for i in range(b):
- 		y=0;z=9
- 		for j in range(len(a)):
- 			if y<int(a[j]):y=int(a[j])
- 			if z>int(a[j]):z=int(a[j])
- 		c=int(a)+y+z;a=str(c)
- 	print(c)
- </code></pre>
- [Try it online!][TIO-ktckeoo7]
- I decided to go for outputting the `i`th value of the sequence, 0-indexed. `a` is the number to be sequenced and `b` is the index of the non-existent list--since no list exists--to be printed.
- [Python 3]: https://docs.python.org/3/
- [TIO-ktckeoo7]: https://tio.run/##VY69DsIwEIPn9Cky3qkd@JloOV4EMRwhgVQordIsycuHtFRUbLY/W/IYw2twx5wf2kgD3NyxrYQi7pim4IGxEmbw0krrpGf31LA0RKRdl@hU1Iz7Db@1K6ulI6yR8WxdAL72N2wj/fRK02Wj6Y@qr8M61mn9oko@@jlWmA3smwPmDw "Python 3 – Try It Online"
#2: Post edited
# [Python 3], 183 bytes- <!-- language-all: lang-python -->
<pre><code>a,b=input(),int(input());c=int(a);y,z=0,9for i in range(b):	for j in range(len(a)):		if y<int(a[j]):y=int(a[j])		if z>int(a[j]):z=int(a[j])	c=int(a)+y+z;a=str(c);y=0;z=9print(c)- </code></pre>
[Try it online!][TIO-ktc5stau]I decided to go for outputting the `i`th value of the sequence, 0-indexed. `a` is the number to be sequenced and `b` is the index of the value to be printed. Standard I/O is used only, unless a golfed solution would use a function.- [Python 3]: https://docs.python.org/3/
[TIO-ktc5stau]: https://tio.run/##TY7NDoMgEITP8hQc2cjB2JPS7Ys0PSDRFtOsBOkBXp5K/@xtZr7M7rgYbgsdctZyQEvuEQRIS0F8NCiDxWpQUSZsZMemxXPLLXGv6TqKAXpWlWzes/tIW6OAyk48Hl8XzvMF@og//YbptMP0D79/61gnpXENXphtBDYqYcecL9RAzi1rnw "Python 3 – Try It Online"
- # [Python 3], <s>183</s> 181 bytes
- <!-- language-all: lang-python -->
- <pre><code>def f(a,b):
- 	c=a;a=str(a);y,z=0,9
- 	for i in range(b):
- 		for j in range(len(a)):
- 			if y<int(a[j]):y=int(a[j])
- 			if z>int(a[j]):z=int(a[j])
- 		c=int(a)+y+z;a=str(c);y=0;z=9
- 	print(c)
- </code></pre>
- [Try it online!][TIO-ktc8iz68]
- I decided to go for outputting the `i`th value of the sequence, 0-indexed. `a` is the number to be sequenced and `b` is the index of the value to be printed.
- [Python 3]: https://docs.python.org/3/
- [TIO-ktc8iz68]: https://tio.run/##VY5BDsIgEEXX5RQsmZRFrXFhKV7EuBgRlMbQBtnA5RGxsXH357/5yVtieMxun/NNG2oY8isMpFESBcpX8AxBRJ5kx4@kMbOnllpHPbq7ZvWzltNWPrUrm0oaa2gcrQsMz9MFhih/eaXptNH0R9X3gja2aTVRxUR2IslisvgPVpAN2/ED5J70bw "Python 3 – Try It Online"
#1: Initial revision
# [Python 3], 183 bytes <!-- language-all: lang-python --> <pre><code>a,b=input(),int(input());c=int(a);y,z=0,9 for i in range(b): 	for j in range(len(a)): 		if y<int(a[j]):y=int(a[j]) 		if z>int(a[j]):z=int(a[j]) 	c=int(a)+y+z;a=str(c);y=0;z=9 print(c) </code></pre> [Try it online!][TIO-ktc5stau] I decided to go for outputting the `i`th value of the sequence, 0-indexed. `a` is the number to be sequenced and `b` is the index of the value to be printed. Standard I/O is used only, unless a golfed solution would use a function. [Python 3]: https://docs.python.org/3/ [TIO-ktc5stau]: https://tio.run/##TY7NDoMgEITP8hQc2cjB2JPS7Ys0PSDRFtOsBOkBXp5K/@xtZr7M7rgYbgsdctZyQEvuEQRIS0F8NCiDxWpQUSZsZMemxXPLLXGv6TqKAXpWlWzes/tIW6OAyk48Hl8XzvMF@og//YbptMP0D79/61gnpXENXphtBDYqYcecL9RAzi1rnw "Python 3 – Try It Online"