OFFSET
1,7
COMMENTS
Note that all sequences of this family as A000005, A001227, A038548, A117277, A334461, etc. could be prepended with a(0) = 1 when they are interpreted as sequences of number of partitions, since A000041(0) = 1. However here a(0) is omitted in accordance with the mentioned members of the same family.
For the relation to heptagonal numbers see also A334465.
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
FORMULA
The g.f. for "consecutive parts that differ by d" is Sum_{k>=1} x^(k*(d*k-d+2)/2) / (1-x^k); cf. A117277. - Joerg Arndt, Nov 30 2020
EXAMPLE
For n = 27 there are three partitions of 27 into consecutive parts that differ by 5, including 27 as a valid partition. They are [27], [16, 11] and [14, 9, 4], so a(27) = 3.
MATHEMATICA
first[n_] := Module[{res = Array[1&, n]}, For[i = 2, True, i++, start = i + 5 Binomial[i, 2]; If[start > n, Return[res]]; For[j = start, j <= n, j += i, res[[j]]++]]];
first[105] (* Jean-François Alcover, Nov 30 2020, after David A. Corneth *)
Table[Sum[If[n > 5*k*(k-1)/2 && IntegerQ[n/k - 5*(k-1)/2], 1, 0], {k, Divisors[2*n]}], {n, 1, 100}] (* Vaclav Kotesovec, Oct 23 2024 *)
PROG
(PARI) seq(N, d)=my(x='x+O('x^N)); Vec(sum(k=1, N, x^(k*(d*k-d+2)/2)/(1-x^k)));
seq(100, 5) \\ Joerg Arndt, May 06 2020
(PARI) first(n) = { my(res = vector(n, i, 1)); for(i = 2, oo, start = i + 5 * binomial(i, 2); if(start > n, return(res)); forstep(j = start, n, i, res[j]++ ) ); } \\ David A. Corneth, May 17 2020
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
Omar E. Pol, May 05 2020
STATUS
approved