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.

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

This page as a plain text file.
%I A172008 #6 Sep 02 2023 21:37:58
%S A172008 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,
%T A172008 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,
%U A172008 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
%N A172008 Number of minimal SNUSP programs using +, @ and # that yield n.
%C A172008 Shortest SNUSP representation of a number using only + and @ is in A172005.
%C A172008 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.
%C A172008 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.
%H A172008 <a href="http://www.esolangs.org/wiki/SNUSP">SNUSP - Esolang</a>.
%H A172008 <a href="http://c2.com/cgi/wiki?SnuspLanguage">SNUSP Language</a>.
%e A172008 19 can be represented minimally in 6 ways using @, + and #: @+@+++++# +@@@++++# @++@@+++# @+@++@++# +@@@+@++# @++@@@++#. Thus a(19) = 6.
%p A172008 See A172005.
%Y A172008 Cf. A172005, A172006, A172007.
%K A172008 nonn
%O A172008 1,3
%A A172008 Darrell Plank (jar_czar(AT)msn.com), Jan 22 2010