cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A013585 Smallest m such that 1!+...+m! is divisible by 2n+1, or 0 if no such m exists.

This page as a plain text file.
%I A013585 #21 Jul 19 2020 07:23:29
%S A013585 1,2,0,0,3,4,0,0,5,0,0,12,0,7,19,0,4,0,24,0,32,19,0,0,0,5,20,0,0,0,0,
%T A013585 0,0,20,12,0,7,0,0,57,7,0,0,19,0,0,0,0,6,8,83,0,0,15,33,24,0,0,0,0,12,
%U A013585 32,0,38,19,9,0,0,0,23,0,0,0,0,70,71,5,0,57,20,0,17,0,0,0,0,26,0,0,0,0,0,0,0,0,28
%N A013585 Smallest m such that 1!+...+m! is divisible by 2n+1, or 0 if no such m exists.
%C A013585 From _Robert Israel_, Nov 14 2016: (Start)
%C A013585 a(n) < 2*n for n > 1.
%C A013585 If a(n) = 0, then a((2*k+1)*n + k) = 0 for all k >= 0.
%C A013585 (End)
%D A013585 M. R. Mudge, Smarandache Notions Journal, University of Craiova, Vol. VII, No. 1, 1996.
%H A013585 Robert Israel, <a href="/A013585/b013585.txt">Table of n, a(n) for n = 0..10000</a>
%p A013585 f:= proc(n) local t,r,m;
%p A013585   r:= 1; t:= 0;
%p A013585   for m from 1 do
%p A013585     r:= r*m mod (2*n+1);
%p A013585     if r = 0 then return 0 fi;
%p A013585     t:= t + r mod (2*n+1);
%p A013585     if t = 0 then return m fi;
%p A013585   od;
%p A013585 end proc:
%p A013585 f(0):= 1:
%p A013585 map(f, [$0..100]); # _Robert Israel_, Nov 14 2016
%t A013585 a[n_] := Module[{t, r, m}, r = 1; t = 0; For[m = 1, True, m++, r = Mod[r m, 2 n + 1]; If[r == 0, Return[0]]; t = Mod[t + r, 2 n + 1]; If[t == 0, Return[m]]]];
%t A013585 a[0] = 1;
%t A013585 a /@ Range[0, 100] (* _Jean-François Alcover_, Jul 19 2020, after Maple *)
%Y A013585 Cf. A003422, A013584.
%K A013585 nonn
%O A013585 0,2
%A A013585 Michael R. Mudge (Amsorg(AT)aol.com), additional terms from _Allan C. Wechsler_