login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers n such that Sum_{k=1..n} k!/2^k is an integer.
5

%I #29 Apr 04 2019 21:33:13

%S 0,2,5,12,14,25,29,54,60,62,3445,108995,3625182,13951972,28010901,

%T 7165572247,14335792539,114636743486,229264368709,458534096494

%N Numbers n such that Sum_{k=1..n} k!/2^k is an integer.

%C This sequence lists the indices n for which A215976(n)=0 (power of 2 in denominator) and for which A215990 (numerator of the sum) may be even.

%H B. M. M. de Weger, <a href="https://listserv.nodak.edu/cgi-bin/wa.exe?A2=NMBRTHRY;5a41ecf9.1208">Sums with factorials</a>, NMBRTHRY list, Aug 28 2012

%F A215974(n) = A215972(n)-1 for all n. (The two sequences differ only in the use of the upper limit. The present convention seems more natural, the other one was used in the post on the NmbrThry list.)

%e a(1)=0 is in the sequence because sum(..., 1 <= k <= 0)=0 (empty sum) is an integer.

%e 1 is not in the sequence because 1!/2^1 = 1/2 is not an integer.

%e a(2)=2 is in the sequence because 1!/2^1 + 2!/2^2 = 1 is an integer.

%t sum = 0; Select[Range[0, 10^4], IntegerQ[sum += #!/2^#] &] (* _Robert Price_, Apr 04 2019 *)

%o (PARI) is_A215974(n)=denominator(sum(k=1,n,k!/2^k))==1

%o (PARI) s=0;for(k=1,9e9,denominator(s+=k!/2^k)==1&print1(k,","))

%Y Cf. A215972, A216056.

%K nonn,more

%O 1,2

%A _M. F. Hasler_, Aug 29 2012

%E Terms through a(20) from Aart Blokhuis and Benne de Weger, Aug 30 2012, who thank Jan Willem Knopper for efficient programming. - _N. J. A. Sloane_, Aug 30 2012