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!)
A133344 Complexity of the number n, counting 1's and built using +, *, ^ and # representing concatenation. 5

%I #17 Nov 06 2013 19:09:12

%S 1,2,3,4,5,5,6,5,5,6,2,3,4,5,6,6,7,6,6,7,3,4,5,5,6,6,6,7,7,8,4,5,5,6,

%T 7,6,7,8,7,8,5,5,6,6,7,7,8,7,8,8,6,7,7,8,7,8,9,9,9,8,6,6,6,7,8,7,8,8,

%U 8,9,7,8,8,8,9,10,8,9,10,10,6,7,8,7,8,8

%N Complexity of the number n, counting 1's and built using +, *, ^ and # representing concatenation.

%C The complexity of an integer n is the least number of 1's needed to represent it using only additions, multiplications, exponentiation and parentheses. This allows juxtaposition of numbers to form larger integers, so for example, 2 = 1+1 has complexity 2, but unlike A003037, so does 11 = 1#1 (concatenating two numbers is an allowed operation). Similarly a(111) = 3. The complexity of a number has been defined in several different ways by different authors. See the Index to the OEIS for other definitions.

%H Alois P. Heinz, <a href="/A133344/b133344.txt">Table of n, a(n) for n = 1..10000</a>

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

%e An example (usually nonunique) of the derivation of the first 22 values.

%e a(1) = 1, the number of 1's in "1."

%e a(2) = 2, the number of 1's in "1+1 = 2."

%e a(3) = 3, the number of 1's in "1+1+1 = 3."

%e a(4) = 4, the number of 1's in "1+1+1+1 = 4."

%e a(5) = 5, the number of 1's in "1+1+1+1+1 = 5."

%e a(6) = 5, since there are 5 1's in "((1+1)*(1+1+1)) = 6."

%e a(7) = 6, since there are 6 1's in "1+(((1+1)*(1+1+1))) = 7."

%e a(8) = 5, since there are 5 1's in "(1+1)^(1+1+1) = 8."

%e a(9) = 5, since there are 5 1's in "(1+1+1)^(1+1) = 9."

%e a(10) = 6 since there are 6 1's in "1+((1+1+1)^(1+1)) = ten.

%e a(11) = 2 since there are 2 1's in "1#1 = eleven."

%e a(12) = 3 since there are 3 1's in "1+(1#1) = twelve."

%e a(13) = 4 since there are 4 1's in "1+1+(1#1) = thirteen."

%e a(14) = 5 since there are 5 1's in "1+1+1+(1#1) = fourteen."

%e a(16) = 6 since there are 6 1's in "(1+1+1+1)^(1+1)."

%e a(17) = 7 since there are 7 1's in "1+((1+1+1+1)^(1+1))."

%e a(18) = 6 since there are 6 1's in "1#((1+1)^(1+1+1))."

%e a(19) = 6 since there are 6 1's in "1#((1+1+1)^(1+1))."

%e a(20) = 7 since there are 7 1's in "(1#1)+((1+1+1)^(1+1))."

%e a(21) = 3 since there are 3 1's in "(1+1)#1."

%e a(22) = 4 since 22 = (1+1)*(1#1) = (1#1)+(1#1) = (1+1)#(1+1).

%p with(numtheory):

%p a:= proc(n) option remember; local r; `if`(n=1, 1, min(

%p seq(a(i)+a(n-i), i=1..n-1),

%p seq(a(d)+a(n/d), d=divisors(n) minus {1, n}),

%p seq(`if`(cat("", n)[i+1]<>"0", a(iquo(n, 10^(length(n)-i),

%p 'r'))+a(r), NULL), i=1..length(n)-1),

%p seq(a(root(n, p))+a(p), p=divisors(igcd(seq(i[2],

%p i=ifactors(n)[2]))) minus {0, 1})))

%p end:

%p seq(a(n), n=1..120); # _Alois P. Heinz_, Nov 06 2013

%Y Cf. A003037, A025280, A005520, A005245, A005421, A117618.

%K base,nonn

%O 1,2

%A _Jonathan Vos Post_, Oct 20 2007

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 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)