cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A172007 Numbers which require a - in their minimal SNUSP representation.

Original entry on oeis.org

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

Views

Author

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

Keywords

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

Examples

			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.
		

Crossrefs

Programs

A172008 Number of minimal SNUSP programs using +, @ and # that yield n.

Original entry on oeis.org

1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 2, 4, 2, 2, 4, 2, 6, 2, 2, 2, 8, 8, 4, 2, 2, 2, 2, 2, 2, 6, 2, 2, 10, 10, 4, 2, 8, 8, 2, 2, 4, 8, 2, 2, 2, 6, 14, 2, 4, 4, 8, 8, 2, 4, 2, 4, 2, 2, 2, 4, 6, 6, 2, 2, 2, 2, 4, 4, 18, 18, 2, 2, 4, 2, 8, 2, 10, 2, 2, 2, 4, 4, 6, 4, 4, 4, 2, 2, 2, 4, 6, 6, 2, 2, 2, 8, 2, 2, 6, 6, 2
Offset: 1

Views

Author

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

Keywords

Comments

Shortest SNUSP representation of a number using only + and @ is in A172005.
SNUSP is a programming language where each command is an individual letter. The three of concern here are + and @ and #. + increments the current data value, @ 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 are one or more minimal strings of these characters. The i-th term of the sequence gives the number of minimal SNUSP programs using only these characters. After 2, all sequences end in either +++ or @++, which are equivalent, so all values above a(2) are even.

Examples

			19 can be represented minimally in 6 ways using @, + and #: @+@+++++# +@@@++++# @++@@+++# @+@++@++# +@@@+@++# @++@@@++#. Thus a(19) = 6.
		

Crossrefs

Programs

A172009 Number of minimal SNUSP programs using +, -, @ and # that yield n.

Original entry on oeis.org

1, 1, 2, 2, 2, 2, 2, 2, 6, 12, 4, 8, 2, 4, 4, 10, 4, 2, 12, 4, 2, 6, 8, 10, 2, 2, 2, 2, 2, 2, 10, 2, 8, 2, 14, 22, 8, 2, 18, 8, 4, 14, 4, 12, 2, 4, 2, 8, 6, 2, 6, 6, 10, 2, 2, 4, 6, 4, 4, 2, 4, 2, 22, 8, 2, 4, 2, 2, 4, 6, 24, 6, 2, 2, 12, 2, 12, 4, 2, 2, 6, 6, 12, 18, 6, 4, 6, 6, 2, 2, 2, 2, 8, 12, 2, 2, 2
Offset: 1

Views

Author

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

Keywords

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 are one or more minimal strings of these characters. The i-th term of the sequence is the number of minimal SNUSP programs using only these characters. After 2, all sequences end in either +++ or @++, which are equivalent, so all values above a(2) are even.

Examples

			There are 12 minimal programs which yield 10: +@+++++# @@-++++# -@@++++# -@+@+++# +@-@+++# ++@@+++# +@++@++# @@-+@++# -@@+@++# -@+@@++# +@-@@++# ++@@@++#. Thus a(10) = 12.
		

Crossrefs

Programs

Showing 1-3 of 3 results.