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!)
A263283 Minimum number of characters required to express n in Peano Arithmetic. 2

%I #39 Dec 15 2021 13:26:37

%S 1,2,3,4,5,6,7,8,9,9,10,11,10,11,12,11,11,12,12,13,12,13,14,15,13,13,

%T 14,14,14,15,14,15,15,16,16,15,15,16,17,16,16,17,16,17,17,16,17,18,16,

%U 17,17,17,17,18,17,18,18,18,19,20,17,18,19,18,17,18,19,20

%N Minimum number of characters required to express n in Peano Arithmetic.

%C This sequence is the minimum number of characters needed in Peano Arithmetic to represent the number, where the characters are (i) '0' naming 0, (ii) 's' expressing the successor operation, (iii) '+' expressing the operation of addition, and (iv) 'x' expressing the operation of multiplication. Brackets are not used; Polish notation is employed instead, in which the operator is written before the terms rather than between them. Although in some cases there are different formulas of the same minimal length that represent the same number, the construction of the formulas is not arbitrary. It is not arbitrary that we start from 0, and it is not arbitrary that the only operations allowed are succession, addition, and multiplication. Finally, it is not arbitrary to use Polish notation to ensure shortness of formulas.

%C Another way of thinking of it would be: the minimum number of uses of operations necessary to give the number in Peano Arithmetic, where (i) 0 is considered to be a 0-ary operation, (ii) succession is a unary operation, (iii) addition is a binary operation, and (iv) multiplication is a binary operation. This way of thinking has the advantage that it doesn't look fishy not to mention brackets.

%C For all n > 0, one has 6 * log_4(n) - 1 <= a(n) <= 7 * log_3(n) + 3, with the left inequality being an equality if and only if n is a power of 4 (except for n = 1). One can prove the lower bound by induction, while the upper bound follows from translating the base-3 expansion of n into the language of Peano Arithmetic (using Horner's method and always using 's' symbols rather than additions). - _RĂ©mi Peyre_, Nov 06 2021

%C When is addition first used? Specifically: (1) What is the first index n where there is a formula of length a(n) containing the addition operator? and (2) What is the first index n such that all formulas of length a(n) contain at least one addition operator? For n up to 10^5, there are no formulas of length a(n) using addition, only successor, multiplication, and 0. Note that if the answer to (2) is "never", then this sequence is also the minimum number of characters required to express n in Skolem Arithmetic. - _Charles R Greathouse IV_, Nov 17 2021

%H Alois P. Heinz, <a href="/A263283/b263283.txt">Table of n, a(n) for n = 0..20000</a>

%H Daniel Hill, <a href="/A263283/a263283.pdf">Spreadsheet of first 27 terms</a>

%H <a href="/index/Com#complexity">Index to sequences related to the complexity of n</a>

%F a(n) = 1 + min {a(n-1), a(i)+a(n-i), a(j)+a(n/j)} where 0 <= i <= n and j|n. - _Charlie Neder_, Jul 09 2018

%e So the name for 0 is simply '0', a formula of length 1. (Equivalently, 0 is formed by one use of the 0-ary operation, 0.)

%e The name for 1 is 's0', a formula of length 2. (Equivalently, 1 is formed by two uses of operations: the 0-ary operation, 0, and succession applied once to it.)

%e The name for 2 is 'ss0', a formula of length 3. (Equivalently, 2 is formed by three uses of operations: the 0-ary operation, 0, and succession applied twice to it.)

%e The name for 3 is 'sss0', a formula of length 4. (Equivalently, 3 is formed by four uses of operations: the 0-ary operation, 0, and succession applied thrice to it.)

%e The name for 9 is 'xsss0sss0', a formula of length 9. (Equivalently, 9 is formed by nine uses of operations: the 0-ary operation, 0, twice, succession applied thrice to each value of these operations, and multiplication applied to these two new values.)

%e The name for 10 is 'sxsss0sss0', a formula of length 10. (Equivalently, 10 is formed by ten uses of operations: the 0-ary operation, 0, twice, succession applied thrice to each value of these operations, multiplication applied to these two new values, and then succession applied to this last value.)

%e The name for 12 is 'xsss0ssss0', a formula of length 10. (Equivalently, 12 is formed by ten uses of operations: the 0-ary operation, 0, twice, succession applied thrice to one value of these operations and four times to the other, and then multiplication applied to these two new values.)

%e The name for 14 is 'xss0sssssss0', a formula of length 12. (Equivalently, 14 is formed by twelve uses of operations: the 0-ary operation, 0, twice, succession applied twice to one value of these operations and seven times to the other, and then multiplication applied to these two new values.)

%o (Python)

%o from functools import cache

%o @cache

%o def a(n):

%o if n == 0: return 1

%o cs = a(n-1)

%o ca = min((a(i) + a(n-i) for i in range(1, n)), default=cs)

%o cm = min((a(j) + a(n//j) for j in range(2, n) if n%j == 0), default=cs)

%o return 1 + min(cs, ca, cm)

%o print([a(n) for n in range(68)]) # _Michael S. Branicky_, Nov 05 2021

%o (PARI) first(n)=my(v=vector(n+1)); v[1]=1; for(k=1,n, my(r=v[k],t); for(i=12,k\2, t=v[i+1]+v[k+1-i]; if(t<r, r=t)); fordiv(k, d, if(d==1,next); if(d^2>k, break); t=v[d+1]+v[k/d+1]; if(t<r, r=t)); v[k+1]=r+1); v \\ _Charles R Greathouse IV_, Nov 11 2021

%Y Cf. A005245.

%K nonn,nice

%O 0,2

%A _Daniel Hill_, Oct 13 2015

%E More terms from _Charlie Neder_, Jul 09 2018

%E More terms from _Alois P. Heinz_, Jul 09 2018

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 April 25 08:27 EDT 2024. Contains 371964 sequences. (Running on oeis4.)