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.

Showing 1-3 of 3 results.

A057439 Values of S from sequence A007773.

Original entry on oeis.org

0, 1, 14, 38, 44, 46, 84, 86, 90, 94, 96, 100, 104, 106, 154, 156, 160, 162, 164, 166, 170, 172, 174, 176, 178, 180, 182, 184, 188, 190, 192, 196, 198, 200, 202, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 294
Offset: 1

Views

Author

Larry Reeves (larryr(AT)acm.org), Sep 08 2000

Keywords

Examples

			A007773(4)= 3: 0,2,1,3 -> 38; 0,1,2,3 -> 44; 0,1,3,2 ->46
		

Crossrefs

Cf. A007773.

Extensions

More terms from Naohiro Nomoto, Oct 29 2001

A008782 For any circular arrangement of 0..n-1, let S = sum of squares of every sum of three contiguous numbers; then a(n) = # of distinct values of S.

Original entry on oeis.org

1, 1, 1, 1, 8, 17, 55, 110, 184, 272, 384, 522, 681, 874, 1101, 1354
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A007773.

Programs

  • Maple
    A008782 := proc(n) local S,i,j,sumsq,npermut,p,per ; S := {} ; npermut := combinat[permute]([seq(i,i=0..n-1)]) ; for p from 1 to nops(npermut) do per := op(p,npermut) ; sumsq := 0 ; for i from 0 to n-1 do sumsq := sumsq + (add(op(1+(j mod n),per),j=i..i+2)) ^2 ; od ; S := S union {sumsq} ; od ; RETURN(nops(S)) ; end: for n from 1 to 20 do print(A008782(n)) ; od : # R. J. Mathar, Jun 18 2007
  • Mathematica
    a[n_] := Module[{S, i, j, Sumsq, npermut, p, per}, S = {}; npermut = Permutations[Range[0, n-1]]; For[p = 1, p <= Length[npermut], p++, per = npermut[[p]]; Sumsq = 0; For[i = 0, i <= n-1, i++, Sumsq = Sumsq + Sum[per[[1+Mod[j, n] ]], {j, i, i+2}]^2]; S = S ~Union~ {Sumsq}]; Return[Length[S]]]; Table[Print[an = a[n]]; an, {n, 1, 10}] (* Jean-François Alcover, Jan 13 2014, translated from R. J. Mathar's Maple code *)

Extensions

More terms from Reiner Martin, May 19 2001
a(11)-a(13) from Sean A. Irvine, May 05 2010
a(14)-a(16) from Donovan Johnson, Nov 30 2010

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.

Original entry on oeis.org

1, 1, 1, 3, 12, 46, 163, 405, 770, 1252, 1921, 2816, 3977, 5464, 7313
Offset: 1

Views

Author

Keywords

Examples

			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:
[0,1,2,3,4], (0+1)^3 + (1+2)^3 +(2+3)^3 +(3+4)^3 +(4+0)^3 = 560;
[0,1,2,4,3], (0+1)^3 + (1+2)^3 +(2+4)^3 +(4+3)^3 +(3+0)^3 = 614;
[0,1,3,2,4], (0+1)^3 + (1+3)^3 +(3+2)^3 +(2+4)^3 +(4+0)^3 = 470;
[0,1,4,2,3], (0+1)^3 + (1+4)^3 +(4+2)^3 +(2+3)^3 +(3+0)^3 = 494;
[0,1,3,4,2], (0+1)^3 + (1+3)^3 +(3+4)^3 +(4+2)^3 +(2+0)^3 = 632;
[0,1,4,3,2], (0+1)^3 + (1+4)^3 +(4+3)^3 +(3+2)^3 +(2+0)^3 = 602;
[0,2,1,3,4], (0+2)^3 + (2+1)^3 +(1+3)^3 +(3+4)^3 +(4+0)^3 = 506;
[0,2,1,4,3], (0+2)^3 + (2+1)^3 +(1+4)^3 +(4+3)^3 +(3+0)^3 = 530;
[0,3,1,2,4], (0+3)^3 + (3+1)^3 +(1+2)^3 +(2+4)^3 +(4+0)^3 = 398;
[0,4,1,2,3], (0+4)^3 + (4+1)^3 +(1+2)^3 +(2+3)^3 +(3+0)^3 = 368;
[0,3,1,4,2], (0+3)^3 + (3+1)^3 +(1+4)^3 +(4+2)^3 +(2+0)^3 = 440;
[0,4,1,3,2], (0+4)^3 + (4+1)^3 +(1+3)^3 +(3+2)^3 +(2+0)^3 = 386;
There are 12 different values, so a(5) = 12.
		

Crossrefs

Programs

  • Maple
    A008781 := proc(n)
        local msu,p,c,i ;
        msu := {} ;
        for p in combinat[permute](n-1) do
            c := [0,op(p)] ;
            s := 0 ;
            for i from 0 to n-1 do
                s := s+(c[i+1]+c[1+modp(i+1,n)])^3 ;
            end do:
            msu := msu union {s} ;
        end do:
        nops(msu) ;
    end proc: # R. J. Mathar, Jul 18 2017
  • Mathematica
    f[perm_] := Total[#]^3& /@ Partition[Join[{0}, perm, {0}], 2, 1] // Total;
    a[n_] := a[n] = f /@ Permutations[Range[n - 1]] // Union // Length;
    Reap[Do[Print[n, " ", a[n]]; Sow[a[n]], {n, 1, 12}]][[2, 1]] (* Jean-François Alcover, Feb 24 2020 *)

Extensions

Corrected by Naohiro Nomoto, Sep 10 2001
More terms from Vit Planocka (planocka(AT)mistral.cz), Sep 29 2002
a(12) from Alois P. Heinz, May 26 2013
a(13)-a(15) from Sean A. Irvine, Apr 04 2018
Showing 1-3 of 3 results.