6
Given a number, starting with 1, create new numbers (children) by taking the last digit, n, and concatenating 1 through n+1.
This seems to be a much better explanation of the sequence A071159.
Integers whose decimal expansion start with 1, do not contain zeros and each successive digit to the right is at most one greater than the previous.
1, 11, 12, 111, 112, 121, 122, 123, 1111, 1112, 1121, 1122, 1123, 1211, 1212, 1221, 1222, 1223, 1231, 1232, 1233, 1234, 11111, 11112, ...
Personally I find the description for the sequence rather unhelpful, and find it is easier to understand with a graph.
1
11-------------------------------------12
111----112 121---------122----------123
1111-1112 1121-1122-1123 1211-1212 1221-1222-1223 1231-1232-1233-1234
I find the graph rather interesting as it is very self-repeating. For instance, the left-most node on a branch is always identical to the root node. Might be easier to see on this graph.
Challenge
Submit a solution that can output the nth item of sequence A071159.
Rules
Your submission should be able to calculate any item before number 23713. A071159(23713) is the first time a 10
would appear as a single digit (12345678910; comma-separated 1,2,3,4,5,6,7,8,9,10).
What about 1213? – Ypnypn – 2014-07-16T16:29:05.907
@Ypnypn Doesn't exist. – seequ – 2014-07-16T17:01:09.613
@TheRare Which means the two sequences (normalizing sequence and A071159) are not equivalent and the task therefore does not match its description. – Howard – 2014-07-16T17:11:43.150
@tolos Can you please clarify which of the two sequences you want to have? Until then I am voting to close as "unclear what you are asking". – Howard – 2014-07-16T17:20:35.257
Btw. the variable normalizing sequence seems to be A193023.
– Howard – 2014-07-16T17:21:38.390Thanks for the sequence Howard, it's of interest for a hobby project (which needs a bit of work now =p). I left the challenge as-is and updated the description. Here's my implementation of A071159: http://codepad.org/4Zc5E7gz
– None – 2014-07-16T17:28:21.993Function? Read from stdin? Either? – isaacg – 2014-07-16T20:18:00.920