login
A291355
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.
3
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, 0, 0, 1652, 5878, 26778, 0, 6242, 6242, 6242, 0, 0, 0, 179878, 0, 169024, 472924, 603878, 0, 123100, 123100, 758560, 0, 0, 0, 0, 0, 0, 244698, 489396, 0, 495512
OFFSET
0,4
COMMENTS
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
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
LINKS
EXAMPLE
1 divides 1^3,
2 divides 1^3 + 3^3,
3 divides 1^3 + 3^3 + 2^3,
4 divides 1^3 + 3^3 + 2^3 + 4^3.
So [1, 3, 2, 4] satisfies all the conditions.
---------------------------------------------
a(1) = 1: [[1]];
a(3) = 2: [[1, 3, 2], [3, 1, 2]];
a(4) = 4: [[1, 3, 2, 4], [2, 4, 3, 1], [3, 1, 2, 4], [4, 2, 3, 1]];
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]].
PROG
(Ruby)
def search(a, sum, k, size, num)
if num == size + 1
@cnt += 1
else
(1..size).each{|i|
if a[i - 1] == 0 && (sum + i ** k) % num == 0
a[i - 1] = 1
search(a, sum + i ** k, k, size, num + 1)
a[i - 1] = 0
end
}
end
end
def A(k, n)
a = [0] * n
@cnt = 0
search(a, 0, k, n, 1)
@cnt
end
def A291355(n)
(0..n).map{|i| A(3, i)}
end
p A291355(20)
CROSSREFS
Cf. A291445.
Sequence in context: A119927 A212003 A096255 * A011179 A087570 A124221
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Aug 23 2017
EXTENSIONS
a(0), a(13)-a(30) from Alois P. Heinz, Aug 23 2017
a(31)-a(55) from Giovanni Resta, Aug 23 2017
STATUS
approved