login
A172007
Numbers which require a - in their minimal SNUSP representation
2
25, 32, 40, 49, 50, 51, 52, 54, 62, 64, 67, 72, 79, 81, 82, 85, 92, 96, 100, 102, 122, 127, 128, 129
OFFSET
1,1
COMMENTS
SNUSP is a programming language where each command is an individual letter. The four of concern here are +, -, @ and #. + increments the current data value, - decrements it, @ is a "subroutine call" and # is a "return". When an @ is encountered, a record of the location is put on a stack and execution continues. When a # is encountered, if there is a return point on the stack, the execution continues at that a single character beyond that return point. If there is no return point on the stack, execution terminates.
Thus "@@++#" would put the first two "@" return points on the stack, increment data twice, return from the second "@" to the last "+", increment the data once more, return from the first "@" to the first "+", increment the data two more times and finally terminate when it hits the "#" with no return points on the stack. The data is always initialized to zero so this effectively puts 5 into the data. In order to place a particular value into the data, there is a minimal string of these characters. In some cases, allowing the '-' command can shorten this minimal string. This sequence is a list of numbers which require a - in their minimal sequence. All the numbers represented in the above sequence save at most 2 characters by allowing the -. Whether this is a maximum savings and whether the savings can be arbitrarily large is not known (at least not to me).
EXAMPLE
Using both + and -, 25 can be represented as @-@@@+++# but if we only allow +, the minimal program is @++@@++++# so we only need 8 characters if we allow both + and - but 9 if we allow only + so that 25 requires a - in its minimal representation. It is the first value with this property and so is the first value in our sequence.
MAPLE
See A172005.
CROSSREFS
KEYWORD
nonn
AUTHOR
Darrell Plank (jar_czar(AT)msn.com), Jan 22 2010
STATUS
approved