A263283 Minimum number of characters required to express n in Peano Arithmetic.
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, 14, 14, 14, 15, 14, 15, 15, 16, 16, 15, 15, 16, 17, 16, 16, 17, 16, 17, 17, 16, 17, 18, 16, 17, 17, 17, 17, 18, 17, 18, 18, 18, 19, 20, 17, 18, 19, 18, 17, 18, 19, 20
Offset: 0
Examples
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.) 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.) 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.) 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.) 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.) 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.) 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.) 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.)
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..20000
- Daniel Hill, Spreadsheet of first 27 terms
- Index to sequences related to the complexity of n
Crossrefs
Cf. A005245.
Programs
-
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
k, break); t=v[d+1]+v[k/d+1]; if(t Charles R Greathouse IV, Nov 11 2021 -
Python
from functools import cache @cache def a(n): if n == 0: return 1 cs = a(n-1) ca = min((a(i) + a(n-i) for i in range(1, n)), default=cs) cm = min((a(j) + a(n//j) for j in range(2, n) if n%j == 0), default=cs) return 1 + min(cs, ca, cm) print([a(n) for n in range(68)]) # Michael S. Branicky, Nov 05 2021
Formula
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
Extensions
More terms from Charlie Neder, Jul 09 2018
More terms from Alois P. Heinz, Jul 09 2018
Comments