cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A008781 For any circular arrangement of 0..n-1, let S be the sum of cubes of every sum of two contiguous numbers; then a(n) is the number of distinct values of S.

This page as a plain text file.
%I A008781 #23 Feb 24 2020 10:35:41
%S A008781 1,1,1,3,12,46,163,405,770,1252,1921,2816,3977,5464,7313
%N A008781 For any circular arrangement of 0..n-1, let S be the sum of cubes of every sum of two contiguous numbers; then a(n) is the number of distinct values of S.
%e A008781 Consider n = 5: and the circular arrangements of {0,1,2,3,4}. Here are the values of [ A, B, C, D, E ] (A+B)^3 + (B+C)^3 +(C+D)^3 +(D+E)^3 +(E+A)^3:
%e A008781 [0,1,2,3,4], (0+1)^3 + (1+2)^3 +(2+3)^3 +(3+4)^3 +(4+0)^3 = 560;
%e A008781 [0,1,2,4,3], (0+1)^3 + (1+2)^3 +(2+4)^3 +(4+3)^3 +(3+0)^3 = 614;
%e A008781 [0,1,3,2,4], (0+1)^3 + (1+3)^3 +(3+2)^3 +(2+4)^3 +(4+0)^3 = 470;
%e A008781 [0,1,4,2,3], (0+1)^3 + (1+4)^3 +(4+2)^3 +(2+3)^3 +(3+0)^3 = 494;
%e A008781 [0,1,3,4,2], (0+1)^3 + (1+3)^3 +(3+4)^3 +(4+2)^3 +(2+0)^3 = 632;
%e A008781 [0,1,4,3,2], (0+1)^3 + (1+4)^3 +(4+3)^3 +(3+2)^3 +(2+0)^3 = 602;
%e A008781 [0,2,1,3,4], (0+2)^3 + (2+1)^3 +(1+3)^3 +(3+4)^3 +(4+0)^3 = 506;
%e A008781 [0,2,1,4,3], (0+2)^3 + (2+1)^3 +(1+4)^3 +(4+3)^3 +(3+0)^3 = 530;
%e A008781 [0,3,1,2,4], (0+3)^3 + (3+1)^3 +(1+2)^3 +(2+4)^3 +(4+0)^3 = 398;
%e A008781 [0,4,1,2,3], (0+4)^3 + (4+1)^3 +(1+2)^3 +(2+3)^3 +(3+0)^3 = 368;
%e A008781 [0,3,1,4,2], (0+3)^3 + (3+1)^3 +(1+4)^3 +(4+2)^3 +(2+0)^3 = 440;
%e A008781 [0,4,1,3,2], (0+4)^3 + (4+1)^3 +(1+3)^3 +(3+2)^3 +(2+0)^3 = 386;
%e A008781 There are 12 different values, so a(5) = 12.
%p A008781 A008781 := proc(n)
%p A008781     local msu,p,c,i ;
%p A008781     msu := {} ;
%p A008781     for p in combinat[permute](n-1) do
%p A008781         c := [0,op(p)] ;
%p A008781         s := 0 ;
%p A008781         for i from 0 to n-1 do
%p A008781             s := s+(c[i+1]+c[1+modp(i+1,n)])^3 ;
%p A008781         end do:
%p A008781         msu := msu union {s} ;
%p A008781     end do:
%p A008781     nops(msu) ;
%p A008781 end proc: # _R. J. Mathar_, Jul 18 2017
%t A008781 f[perm_] := Total[#]^3& /@ Partition[Join[{0}, perm, {0}], 2, 1] // Total;
%t A008781 a[n_] := a[n] = f /@ Permutations[Range[n - 1]] // Union // Length;
%t A008781 Reap[Do[Print[n, " ", a[n]]; Sow[a[n]], {n, 1, 12}]][[2, 1]] (* _Jean-François Alcover_, Feb 24 2020 *)
%Y A008781 Cf. A007773, A008782.
%K A008781 nonn
%O A008781 1,4
%A A008781 _Olivier Gérard_
%E A008781 Corrected by _Naohiro Nomoto_, Sep 10 2001
%E A008781 More terms from Vit Planocka (planocka(AT)mistral.cz), Sep 29 2002
%E A008781 a(12) from _Alois P. Heinz_, May 26 2013
%E A008781 a(13)-a(15) from _Sean A. Irvine_, Apr 04 2018