login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A173500 Number of sequences of length n with terms from {0,1,...,n-1} such that the sum of terms is 0 modulo n and the i-th term is not i or 2i modulo n. 2

%I

%S 0,0,0,6,64,854,13392,244944,5124266,120795956,3169804000,91666666668,

%T 2897010809280,99350833566282,3674884626652666,145845089585448960,

%U 6182031393612132352,278750799336055446646,13322922112485213149376

%N Number of sequences of length n with terms from {0,1,...,n-1} such that the sum of terms is 0 modulo n and the i-th term is not i or 2i modulo n.

%H Robert Israel, <a href="/A173500/b173500.txt">Table of n, a(n) for n = 1..200</a>

%H Art of Problem Solving forum, <a href="http://www.artofproblemsolving.com/Forum/viewtopic.php?t=31946">45th IMO Team Selection Test Lincoln, Nebraska</a>.

%F For prime p, a(p) = (p-1)*((p-2)^(p-1)-1)/p.

%e For n=4 the a(4)=6 sequences are 0103, 0112, 0301, 3113, 3302 and 3311. - _Robert Israel_, Aug 30 2020

%p f:= proc(n)

%p local g;

%p g:= proc(i,s) option remember;

%p if i = 0 then if s=0 then return 1 else return 0 fi fi;

%p add(procname(i-1,s-k mod n),k= {$0..n-1} minus {2*i mod n,i})

%p end proc;

%p g(n,0)

%p end proc:

%p map(f, [$1..30]); # _Robert Israel_, Aug 30 2020

%Y Cf. A173499.

%K nonn

%O 1,4

%A _Max Alekseyev_, Feb 20 2010

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 26 08:00 EDT 2021. Contains 348267 sequences. (Running on oeis4.)