login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A180009 Triangle T(n,k), read by rows, T(n,1) = mu(n), T(n,2) = T(n,k-1) - T(n-1,k), k > 2, T(n,k) = Sum_{i=1..k-1} ( T(n-i,k-1) - T(n-i,k) ). 2
1, -1, -1, -1, 0, -1, 0, 0, 0, -1, -1, -1, 1, 0, -1, 1, 2, -2, 1, 0, -1, -1, -3, 2, -1, 1, 0, -1, 0, 3, -1, 1, -1, 1, 0, -1, 0, -3, -1, -2, 2, -1, 1, 0, -1, 1, 4, 2, 2, -3, 2, -1, 1, 0, -1, -1, -5, 0, -1, 1, -2, 2, -1, 1, 0, -1, 0, 5, -3, 2, 1, 0, -2, 2, -1, 1, 0, -1, -1, -6, 3, -4, 0, 0, 1, -2, 2, -1, 1, 0, -1 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

1,17

LINKS

G. C. Greubel, Rows n = 1..100 of triangle, flattened

EXAMPLE

Table begins:

   1;

  -1, -1;

  -1,  0, -1;

   0,  0,  0, -1;

  -1, -1,  1,  0, -1;

   1,  2, -2,  1,  0, -1;

  -1, -3,  2, -1,  1,  0, -1;

   0,  3, -1,  1, -1,  1,  0, -1;

   0, -3, -1, -2,  2, -1,  1,  0, -1;

   1,  4,  2,  2, -3,  2, -1,  1,  0, -1;

  -1, -5,  0, -1,  1, -2,  2, -1,  1,  0, -1;

   0,  5, -3,  2,  1,  0, -2,  2, -1,  1,  0, -1;

  -1, -6,  3, -4,  0,  0,  1, -2,  2, -1,  1,  0, -1;

   1,  7, -1,  3,  0,  2, -1,  1, -2,  2, -1,  1,  0, -1;

   1, -6, -1, -2, -2, -3,  1,  0,  1, -2,  2, -1,  1,  0, -1;

MAPLE

T:= proc(n, k) option remember;

   if k<1 or k>n then 0

   elif k=1 then NumberTheory[Moebius](n)

   elif k=2 then T(n, k-1) - T(n-1, k)

   else add( T(n-j, k-1) - T(n-j, k), j=1..k-1 )

   fi; end;

seq(seq( T(n, k), k=1..n), n=1..15); # G. C. Greubel, Dec 17 2019

MATHEMATICA

T[n_, k_]:= T[n, k]= If[k<1 || k>n, 0, If[k==1, MoebiusMu[n], If[k==2, T[n, k-1] - T[n-1, k], Sum[T[n-j, k-1] - T[n-j, k], {j, k-1}]]]]; Table[T[n, k], {n, 15}, {k, n}]//Flatten (* G. C. Greubel, Dec 17 2019 *)

PROG

(PARI) T(n, k) = if(k<1 || k>n, 0, if(k==1, moebius(n), if(k==2, T(n, k-1) - T(n-1, k), sum(j=1, k-1, T(n-j, k-1) - T(n-j, k)) ))); \\ G. C. Greubel, Dec 17 2019

(MAGMA)

function T(n, k)

  if k lt 1 or k gt n then return 0;

  elif k eq 1 then return MoebiusMu(n);

  elif k eq 2 then return T(n, k-1) - T(n-1, k);

  else return (&+[T(n-j, k-1) - T(n-j, k): j in [1..k-1]]);

  end if; return T; end function;

[T(n, k): k in [1..n], n in [1..15]]; // G. C. Greubel, Dec 17 2019

(Sage)

@CachedFunction

def T(n, k):

    if (k<1 or k>n): return 0

    elif (k==1): return moebius(n)

    elif (k==2): return T(n, k-1) - T(n-1, k)

    else: return sum(T(n-j, k-1) - T(n-j, k) for j in (1..k-1))

[[T(n, k) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Dec 17 2019

(GAP)

T:= function(n, k)

    if k<1 or k>n then return 0;

    elif k=1 then return MoebiusMu(n);

    elif k=2 then return T(n, k-1) - T(n-1, k);

    else return Sum([1..k-1], j-> T(n-j, k-1) - T(n-j, k) );

    fi; end;

Flat(List([1..15], n-> List([1..n], k-> T(n, k) ))); # G. C. Greubel, Dec 17 2019

CROSSREFS

Cf. A008683, A180010.

Sequence in context: A055800 A060572 A163543 * A341907 A180010 A287401

Adjacent sequences:  A180006 A180007 A180008 * A180010 A180011 A180012

KEYWORD

sign,tabl

AUTHOR

Mats Granvik, Aug 06 2010

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 1 22:36 EDT 2021. Contains 346408 sequences. (Running on oeis4.)