login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A336825
a(n) is the smallest positive integer which is expressed by the greedy algorithm as the sum of exactly n prime-powers (including 1).
0
1, 6, 95, 360748
OFFSET
1,2
COMMENTS
Analogous to A066352 with prime-powers replacing primes.
LINKS
Steven and Jonathan Hoseana, The prime-power map, arXiv:2008.01368 [math.DS], 2020.
FORMULA
a(1) = 1 and, for every positive integer n, a(n+1) = a(n) + q1(n), where (q1(n), q2(n)) is the first pair of consecutive prime-powers with q2(n) - q1(n) >= a(n) + 1.
EXAMPLE
The greedy algorithm expresses every positive integer as a sum of prime-powers (including 1) by choosing the largest possible summand at each step. Consider the following initial data of such expressions:
1 = 1,
2 = 2,
3 = 3,
4 = 4,
5 = 5,
6 = 5 + 1,
7 = 7,
8 = 7 + 1,
9 = 9,
10 = 9 + 1.
The smallest positive integer which is expressed by the greedy algorithm as the sum of exactly 1 prime-power is a(1) = 1. The smallest positive integer which is expressed by the greedy algorithm as the sum of exactly 2 prime-powers is a(2) = 6. Similarly, a(3) = 95 (95 = 89 + 5 + 1) and a(4) = 360748 (360748 = 360653 + 89 + 5 + 1).
PROG
(PARI) ispp(n) = isprimepower(n) || (n==1); \\ A000961
f(n) = while(!ispp(n), n--); n; \\ A031218
nbs(n) = my(nb=0); while(n, n -= f(n); nb++); nb;
a(n) = my(k=1); while (nbs(k) != n, k++); k; \\ Michel Marcus, Aug 05 2020
CROSSREFS
Cf. A066352, A000961 (power of primes), A031218.
Sequence in context: A326436 A243802 A119627 * A376155 A116158 A275561
KEYWORD
nonn,more
AUTHOR
Jonathan Hoseana, Aug 04 2020
STATUS
approved