login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A210337 Sum of distinct residues of all factorials mod 2^n. 1

%I #22 Dec 15 2018 23:46:33

%S 0,1,3,9,17,49,153,281,665,1433,3225,7705,17945,47641,64025,129561,

%T 293401,752153,1341977,2914841,6421017,14547481,33421849,71170585,

%U 138279449,247331353,645790233,1182661145,2558392857,5779618329,11685198361,23496358425

%N Sum of distinct residues of all factorials mod 2^n.

%H Alois P. Heinz, <a href="/A210337/b210337.txt">Table of n, a(n) for n = 0..1000</a>

%p a:= proc(n) local p, m, i, s;

%p p:= 2^n;

%p m:= 1;

%p s:= {};

%p for i to p while m<>0 do m:= m*i mod p; s:=s union {m} od;

%p add(i, i=s)

%p end:

%p seq (a(n), n=0..40); # _Alois P. Heinz_, Mar 20 2012

%t a[n_] := Module[{k=0, s={}}, While[(r = Mod[k!, 2^n]) > 0, k++; AppendTo[s,r]]; Total@Union@s]; Array[a, 32, 0] (* _Amiram Eldar_, Dec 15 2018 *)

%o (PARI) nbf(n) = my(k=1); while(k! % 2^n, k++); k; \\ A007843

%o a(n) = my(nb=nbf(n)); vecsum(Set(vector(nb, k, k! % 2^n))); \\ _Michel Marcus_, Dec 15 2018

%Y Cf. A007843, A210184, A210185.

%K nonn

%O 0,3

%A _Vladimir Shevelev_, Mar 20 2012

%E More terms from _Alois P. Heinz_, Mar 20 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)