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.

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).

This page as a plain text file.
%I A328483 #26 Nov 23 2019 14:54:41
%S A328483 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,
%T A328483 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,
%U A328483 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
%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).
%C A328483 Apparently no term is larger than 2.
%C A328483 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
%H A328483 Antti Karttunen, <a href="/A328483/b328483.txt">Table of n, a(n) for n = 0..30030</a>
%H A328483 <a href="/index/Pri#primorial_numbers">Index entries for sequences related to primorial numbers</a>
%F A328483 a(A129912(n)) = a(A002110(n)) = 1.
%e A328483 Terms of A129912 (numbers that are products of distinct primorial numbers) begin as: 1, 2, 6, 12, 30, 60, 180, 210, 360, 420, 1260, ...
%e A328483 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.
%e A328483 Number 21 is expressed as 21 = 12 + 6 + 2 + 1, thus a(21) = 1 as no term occurs more than once.
%e A328483 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.
%o A328483 (PARI)
%o A328483 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 || t<o-1, return(0)); if(t==0, return(n==1)); o=t); }; \\ From A129912
%o A328483 prepare_A129912_upto(n) = { my(xs=List([]), k=0); while(k<n, k++; if(isA129912(k), listput(xs,k))); List(Vecrev(xs)); };
%o A328483 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); };
%o A328483 A328483(n) = max_factor_of_terms_in_greedy_sum(n,prepare_A129912_upto(n));
%Y A328483 Cf. A002110, A129912, A328481, A328482.
%K A328483 nonn
%O A328483 0,5
%A A328483 _Antti Karttunen_, Oct 19 2019