OFFSET
0,4
COMMENTS
The indices at which k first appears, for k >= 0: 1, 3, 6, 11, 18, 29, 42, 59, 78 (A014284). Such n's are expressed as the sum of 1 and the first primes.
Runs with length >= 2 start at numbers k^2 - 1 (k >= 2).
If there are terms between runs of k and k+1, these two numbers occur alternately. Suppose that m is such a term that is b(m) terms after the first occurrence of k+1; if b(m) is odd, there are at least two even numbers in the expression of n as the sum of k+1 integers, which are not coprime to each other, so a(m) = k.
LINKS
Yifan Xie, Table of n, a(n) for n = 0..9999
FORMULA
EXAMPLE
For n = 11, 1+2+3+5=11; so a(11) = 4.
For n = 12, 1+4+7=12; so a(12) = 3.
PROG
(PARI) lista(nn) = v=[0]; f=[7, 12, 14, 19, 21, 23, 30, 32, 34, 43, 45, 47, 60, 62, 79]; for(n=1, nn, for(i=1, prime(n), v=concat(v, n))); for(n=1, 15, v[f[n]+1]=v[f[n]+1]-1); v;
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Yifan Xie, Sep 28 2023
STATUS
approved