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.

Showing 1-4 of 4 results.

A328481 Number of terms required when n is expressed as a greedy sum of terms of A129912 (digital sum of n when written in greedy A129912-base).

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 1, 2, 2, 3, 3, 4, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 2, 3, 3, 4, 4, 5, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 3, 4, 4, 5, 5, 6, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 3, 4, 4, 5, 5, 6, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 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 when always choosing the largest term which is <= {what is remaining of the original number}. Thus a(5) = 3.
Number 21 is expressed as 21 = 12 + 6 + 2 + 1, thus a(21) = 4.
Number 720 is expressed as 720 = 420 + 210 + 60 + 30, thus a(720) = 4. Note that 720 = 2*360, so in this case the greedy algorithm does not produce an optimal result.
		

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_terms_in_greedy_sum(n,terms) = { my(c=0); while(n,if(terms[1] > n, listpop(terms,1), c += (n\terms[1]); n %= terms[1])); (c); };
    number_of_terms_in_greedy_sum_v1(n,terms) = { my(c=0); while(n,if(terms[1] > n, listpop(terms,1), n -= terms[1]; c++)); (c); }; \\ (Simpler variant)
    A328481(n) = number_of_terms_in_greedy_sum(n,prepare_A129912_upto(n));

Formula

a(0) = 0; and for n > 0, a(n) = 1 + a(A328480(n)).
a(A129912(n)) = a(A002110(n)) = 1.
For all n, a(n) >= A328482(n).

A328483 Maximum number of times any term appears when n is expressed as a greedy sum of terms of A129912 (maximal digit when n is expressed in greedy A129912-base).

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1
Offset: 0

Views

Author

Antti Karttunen, Oct 19 2019

Keywords

Comments

Apparently no term is larger than 2.
In the initial prefix of 30031 terms, the longest run of 1's is 4 and 2's occur only in runs of lengths 2, 8, 38, 68, 218 and 428. - Bill McEachen, Nov 21 2019, clarified by Antti Karttunen, Nov 23 2019

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 when always choosing the largest term which is <= {what is remaining of the original number}. Thus a(5) = 2 as the most frequent term (2) occurs twice.
Number 21 is expressed as 21 = 12 + 6 + 2 + 1, thus a(21) = 1 as no term occurs more than once.
Number 720 is expressed as 720 = 420 + 210 + 60 + 30, thus a(720) = 1 as no term occurs twice. Note that 720 = 2*360, so an algorithm which would search for an optimal result would yield a different value at n=720.
		

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)); };
    max_factor_of_terms_in_greedy_sum(n,terms) = { my(m=0); while(n,if(terms[1] > n, listpop(terms,1), m = max(m,(n\terms[1])); n %= terms[1])); (m); };
    A328483(n) = max_factor_of_terms_in_greedy_sum(n,prepare_A129912_upto(n));

Formula

a(A129912(n)) = a(A002110(n)) = 1.

A371091 Number of 1's in the recursive decomposition of primorial base expansion of n.

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, 4, 5, 4, 5, 5, 6, 5, 6, 3, 4, 4, 5, 4, 5, 1
Offset: 0

Views

Author

Antti Karttunen, Mar 31 2024

Keywords

Comments

Take the primorial base expansion of n (A049345), and then replace any digit larger than 1 with its own primorial base expansion, and do this recursively until no digits larger than 1 remain. a(n) is then the number of 1's in the completed decomposition. (See the examples). This decomposition offers a way to design a natural primorial based numeral system that does not require an infinite number of arbitrary glyphs for its digits, but instead suffices with just two graphically distinct subfigures whose exact positions in the whole hierarchically organized composite glyph determines the numerical value of that glyph, a bit like in Maya numerals or Babylonian cuneiform digits, but based on a primorial number system instead of vigesimal or sexagesimal.

Examples

			     n  A049345(n)     recursive              a(n) = number of 1's
                       decomposition          in the decomposition
--------------------------------------------------------------------
     0         0         ()                             0
     1         1         (1)                            1
     2        10         (1 0)                          1
     3        11         (1 1)                          2
     4        20         ((1 0) 0)                      1
     5        21         ((1 0) 1)                      2
     6       100         (1 0 0)                        1
     7       101         (1 0 1)                        2
     8       110         (1 1 0)                        2
     9       111         (1 1 1)                        3
    10       120         (1 (1 0) 0)                    2
    11       121         (1 (1 0) 1)                    3
    12       200         ((1 0) 0 0)                    1
    ..
    21       311         ((1 1) 1 1)                    4
    ..
    24       400         (((1 0) 0) 0 0)                1
    ..
    29       421         (((1 0) 0) (1 0) 1)            3
    30      1000         (1 0 0 0)                      1
    ..
    51      1311         (1 (1 1) 1 1)                  5
    ..
    59      1421         (1 ((1 0) 0) (1 0) 1)          4
    60      2000         ((1 0) 0 0 0)                  1
    ..
   111      3311         ((1 1) (1 1) 1 1)              6
   ...
   360     15000         (1 ((1 0) 1) 0 0 0)            3
   ...
  2001     93311         ((1 1 1) (1 1) (1 1) 1 1)      9
  ....
  4311    193311         (1 (1 1 1) (1 1) (1 1) 1 1)   10.
29 is decomposed in piecemeal fashion as: A049345(29) = 421 --> ("20" "10" "1") --> (((1 0) 0) (1 0) 1).
		

Crossrefs

Cf. A372559 (positions of records and the first occurrence of n).
Differs from A328482 for the first time at n=360, where a(360) = 3, while A328482(360) = 1.

Programs

Formula

a(n) = A371090(A276086(n)).
For all n, A267263(n) <= a(n) <= A276150(n).

A328480 a(0) = 0; for n > 0, a(n) = n - {the largest term of A129912 <= n}.

Original entry on oeis.org

0, 0, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
Offset: 0

Views

Author

Antti Karttunen, Oct 19 2019

Keywords

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
    A328480(n) = if(!n,n, my(u=0); for(k=1, oo, if(isA129912(k), if(k==n, return(0), if(k>n, return(n-u), u = k)))));
Showing 1-4 of 4 results.