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!)
A300307 Number of solutions to 1 +- 3 +- 6 +- ... +- n*(n+1)/2 == 0 mod n. 4

%I #28 Mar 05 2018 05:02:36

%S 1,2,0,4,4,16,12,32,20,112,88,384,308,1264,1056,4096,3852,15120,13820,

%T 52608,49824,190848,182356,704512,671540,2582128,2475220,9615744,

%U 9256428,35868672,34636840,134217728,130021392,505292976,491156304,1909836416,1857282536

%N Number of solutions to 1 +- 3 +- 6 +- ... +- n*(n+1)/2 == 0 mod n.

%H Seiichi Manyama, <a href="/A300307/b300307.txt">Table of n, a(n) for n = 1..2^11</a>

%F a(2^n) = 2^A000325(n) for n>0 (conjectured).

%e Solutions for n = 7:

%e ------------------------------

%e 1 +3 +6 +10 +15 +21 +28 = 84.

%e 1 +3 +6 +10 +15 +21 -28 = 28.

%e 1 +3 +6 +10 +15 -21 +28 = 42.

%e 1 +3 +6 +10 +15 -21 -28 = -14.

%e 1 +3 -6 +10 -15 +21 +28 = 42.

%e 1 +3 -6 +10 -15 +21 -28 = -14.

%e 1 +3 -6 +10 -15 -21 +28 = 0.

%e 1 +3 -6 +10 -15 -21 -28 = -56.

%e 1 -3 +6 -10 -15 +21 +28 = 28.

%e 1 -3 +6 -10 -15 +21 -28 = -28.

%e 1 -3 +6 -10 -15 -21 +28 = -14.

%e 1 -3 +6 -10 -15 -21 -28 = -70.

%o (Ruby)

%o def A(n)

%o ary = [1] + Array.new(n - 1, 0)

%o (1..n).each{|i|

%o it = i * (i + 1)

%o a = ary.clone

%o (0..n - 1).each{|j| a[(j + it) % n] += ary[j]}

%o ary = a

%o }

%o ary[(n * (n + 1) * (n + 2) / 6) % n] / 2

%o end

%o def A300307(n)

%o (1..n).map{|i| A(i)}

%o end

%o p A300307(100)

%Y Cf. A000079, A000217, A000325, A058498, A300190, A300218.

%K nonn

%O 1,2

%A _Seiichi Manyama_, Mar 02 2018

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 23 11:35 EDT 2024. Contains 371912 sequences. (Running on oeis4.)