%I #23 Sep 08 2023 22:51:34
%S 2,9,16,23,30,37,51,58,65,72,79,86,100,107,114,121,128,135,149,156,
%T 163,170,177,184,198,205,212,219,226,233,247,254,261,268,275,282,296,
%U 303,310,317,324,331,345,352,359,366,373,380,394,401,408,415,422,429
%N Numbers n >= 0 such that d(n) = (n^1 + 1)*(n^2 + 2) ... (n^14 + 14) / 14!, e(n) = (n^1 + 1)*(n^2 + 2) ... (n^15 + 15) / 15!, and f(n) = (n^1 + 1)*(n^2 + 2) ... (n^16 + 16) / 16! take nonintegral values.
%C Initial terms were calculated by _Peter J. C. Moses_; see comment in A129995.
%C From _Max Alekseyev_: (Start)
%C To check whether 14! divides (n^1 + 1)*(n^2 + 2)*(n^3 + 3)*...*(n^14 +14) it is enough to check whether every prime power q from the prime factorization of 14! divides (n^1 + 1)*(n^2 + 2)*(n^3 + 3)*...*(n^14 + 14) for n=0,1,...,q-1.
%C Note that 14! = 2^11 * 3^5 * 5^2 * 7^2 * 11 * 13.
%C It is easy to verify that:
%C i) 2^11 divides (n^1 + 1)*(n^2 + 2)*(n^3 + 3)*...*(n^14 + 14) for every n=0,1,...,2^11-1;
%C ii) 3^5 divides (n^1 + 1)*(n^2 + 2)*(n^3 + 3)*...*(n^14 + 14) for every n=0,1,...,3^5-1;
%C iii) 7^2 divides (n^1 + 1)*(n^2 + 2)*(n^3 + 3)*...*(n^14 + 14) for every n=0,1,...,7^2-1,
%C except for n=2, 9, 16, 23, 30, 37 (i.e., n of the form 7m+2 but not 49m+44);
%C iv) 11 divides (n^1 + 1)*(n^2 + 2)*(n^3 + 3)*...*(n^14 + 14) for every n=0,1,...,11-1;
%C v) 13 divides (n^1 + 1)*(n^2 + 2)*(n^3 + 3)*...*(n^14 + 14) for every n=0,1,...,13-1.
%C This proves that for k=14, a(n) is nonintegral only for n in the set difference { 7m+2} \ { 49m+44 }.
%C In simple cases like { 7m+2 } \ { 49m+44 }, one can get an explicit formula.
%C Note that { 7m+2 } \ { 49m+44 } can be viewed as the arithmetic sequence 7m + 2 where m cannot be 6 modulo 7.
%C The number of nonnegative integers equal to 6 modulo 7 not exceeding m is equal to floor((m+1)/7).
%C Therefore in our sequence the (m-floor((m+1)/7))-th term equals 7m+2 when m is minimum possible.
%C Let us find the minimum m satisfying m - floor((m+1)/7) = n.
%C Let t = (m+1) mod 7. Then m - ((m+1)-t)/7 = n or 6m+t-1 = 7n, implying that m = (7n-t+1)/6.
%C Depending on the value of t we have m = floor((7n+1)/6) or m = floor((7n+1)/6) - 1.
%C Since m must be the minimum possible, we have the second case when floor((7n+1)/6) mod 7 > (7n+1) mod 6; and the first case otherwise.
%C In other words, the explicit formula for m is m = floor((7n+1)/6) - 1, if floor((7n+1)/6) mod 7 > (7n+1) mod 6; m = floor((7n+1)/6), otherwise.
%C We can also consider all possible residues of n modulo 6*7 and find out that the inequality floor((7n+1)/6) mod 7 > (7n+1) mod 6 holds for n mod 42 in { 5, 11, 17, 23, 29, 35, 41 } or alternatively n mod 6 = 5.
%C Therefore m = floor((7n+1)/6) - 1, if n mod 6 = 5; m = floor((7n+1)/6), otherwise.
%C So for the sequence {2,9,16,23,30,37,51,58,65,72,79,86,100,...} we can give formula a(n) = 7*floor((7n+1)/6) - 5, if n mod 6 = 5; a(n) = 7*floor((7n+1)/6) + 2, otherwise.
%C (End)
%H G. C. Greubel, <a href="/A131189/b131189.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,1,-1).
%F a(n) = 7*floor((7n+1)/6) - 5, if n mod 6 = 5; a(n) = 7*floor((7n+1)/6) + 2, otherwise. For e(n) and g(n), proof is similar; see also the comments. - _Max Alekseyev_
%F G.f.: x*(12*x^6+7*x^5+7*x^4+7*x^3+7*x^2+7*x+2) / ((x-1)^2*(x+1)*(x^2-x+1)*(x^2+x+1)). - _Colin Barker_, Aug 08 2013
%p a:= n-> `if`((n-1) mod 6 = 5, 7*floor((7*n-6)/6)-5, 7*floor((7*n-6)/6)+2):
%p seq(a(n), n=1..80); # _Alois P. Heinz_, Aug 08 2013
%t LinearRecurrence[{1, 0, 0, 0, 0, 1, -1}, {2, 9, 16, 23, 30, 37, 51}, 50] (* _G. C. Greubel_, Feb 19 2017 *)
%o (PARI) x='x+O('x^50); Vec(x*(12*x^6+7*x^5+7*x^4+7*x^3+7*x^2+7*x+2) / ((x-1)^2*(x+1)*(x^2-x+1)*(x^2+x+1))) \\ _G. C. Greubel_, Feb 19 2017
%K nonn,easy
%O 1,1
%A _Alexander R. Povolotsky_, Sep 25 2007
%E More terms from _Colin Barker_, Aug 08 2013