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.

A328482 Number of distinct terms required when n is expressed as a greedy sum of terms of A129912 (number of nonzero digits when n is expressed in greedy A129912-base).

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 3, 4, 4, 5, 4, 5, 2, 3, 3, 4, 3, 4, 1, 2, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 3, 4, 4, 5, 4, 5, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 3, 4, 4, 5, 4, 5, 3, 4, 4, 5
Offset: 0

Views

Author

Antti Karttunen, Oct 19 2019

Keywords

Examples

			Terms of A129912 (numbers that are products of distinct primorial numbers) begin as: 1, 2, 6, 12, 30, 60, 180, 210, 360, 420, 1260, ...
Number 5 is expressed as 5 = 2 + 2 + 1 = 2*2 + 1*1, when always choosing the largest term which is <= {what is remaining of the original number}. Thus a(5) = 2 (number of distinct terms used, 1 and 2).
Number 21 is expressed as 21 = 12 + 6 + 2 + 1, thus a(21) = 4.
		

Crossrefs

Programs

  • PARI
    isA129912(n) = { my(o=valuation(n, 2), t); if(o<1||n<2, return(n==1)); n>>=o; forprime(p=3, , t=valuation(n, p); n/=p^t; if(t>o || tA129912
    prepare_A129912_upto(n) = { my(xs=List([]), k=0); while(kA129912(k), listput(xs,k))); List(Vecrev(xs)); };
    number_of_distinct_terms_in_greedy_sum(n,terms) = { my(c=0); while(n,if(terms[1] > n, listpop(terms,1), c++; n %= terms[1])); (c); };
    A328482(n) = number_of_distinct_terms_in_greedy_sum(n,prepare_A129912_upto(n));

Formula

a(A129912(n)) = a(A002110(n)) = 1.
For all n, a(n) <= A328481(n).