login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A172007 Numbers which require a - in their minimal SNUSP representation 2

%I #1 Jun 01 2010 03:00:00

%S 25,32,40,49,50,51,52,54,62,64,67,72,79,81,82,85,92,96,100,102,122,

%T 127,128,129

%N Numbers which require a - in their minimal SNUSP representation

%C 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.

%C 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).

%H <a href="http://www.esolangs.org/wiki/SNUSP">SNUSP - Esolang</a>

%H <a href="http://c2.com/cgi/wiki?SnuspLanguage">SNUSP Language</a>

%e 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.

%p See A172005.

%Y A172005, A172006

%K nonn

%O 1,1

%A Darrell Plank (jar_czar(AT)msn.com), Jan 22 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 30 17:27 EDT 2024. Contains 375545 sequences. (Running on oeis4.)