Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #45 Aug 26 2017 13:19:43
%S 1,1,0,2,4,8,0,8,16,24,0,46,46,46,0,218,1658,6542,0,0,2172,6200,0,0,0,
%T 0,0,1652,5878,26778,0,6242,6242,6242,0,0,0,179878,0,169024,472924,
%U 603878,0,123100,123100,758560,0,0,0,0,0,0,244698,489396,0,495512
%N Number of permutations s_1,s_2,...,s_n of 1,2,...,n such that for all j=1,2,...,n, j divides Sum_{i=1..j} s_i^3.
%C a(n) = 0 if n == 2 mod 4 as in this case n does not divide (n(n+1)/2)^2. In addition, a(4m+2) <= a(4m+3) <= a(4m+4) <= a(4m+5) for all m. - _Chai Wah Wu_, Aug 23 2017
%C The similar sequence b(n) in which the element of the permutation are squared instead of cubed, seems much more sparse. For 1 < n <= 250, the only nonzero terms are b(11)=12 and b(23)=480. - _Giovanni Resta_, Aug 23 2017
%H Giovanni Resta, <a href="/A291355/b291355.txt">Table of n, a(n) for n = 0..100</a>
%e 1 divides 1^3,
%e 2 divides 1^3 + 3^3,
%e 3 divides 1^3 + 3^3 + 2^3,
%e 4 divides 1^3 + 3^3 + 2^3 + 4^3.
%e So [1, 3, 2, 4] satisfies all the conditions.
%e ---------------------------------------------
%e a(1) = 1: [[1]];
%e a(3) = 2: [[1, 3, 2], [3, 1, 2]];
%e a(4) = 4: [[1, 3, 2, 4], [2, 4, 3, 1], [3, 1, 2, 4], [4, 2, 3, 1]];
%e a(5) = 8: [[1, 3, 2, 4, 5], [2, 4, 3, 1, 5], [2, 4, 3, 5, 1], [3, 1, 2, 4, 5], [3, 5, 4, 2, 1], [4, 2, 3, 1, 5], [4, 2, 3, 5, 1], [5, 3, 4, 2, 1]].
%o (Ruby)
%o def search(a, sum, k, size, num)
%o if num == size + 1
%o @cnt += 1
%o else
%o (1..size).each{|i|
%o if a[i - 1] == 0 && (sum + i ** k) % num == 0
%o a[i - 1] = 1
%o search(a, sum + i ** k, k, size, num + 1)
%o a[i - 1] = 0
%o end
%o }
%o end
%o end
%o def A(k, n)
%o a = [0] * n
%o @cnt = 0
%o search(a, 0, k, n, 1)
%o @cnt
%o end
%o def A291355(n)
%o (0..n).map{|i| A(3, i)}
%o end
%o p A291355(20)
%Y Cf. A291445.
%K nonn
%O 0,4
%A _Seiichi Manyama_, Aug 23 2017
%E a(0), a(13)-a(30) from _Alois P. Heinz_, Aug 23 2017
%E a(31)-a(55) from _Giovanni Resta_, Aug 23 2017