login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A152722 Triangle read by rows: T(n,0) = prime(n+2), T(n,1) = 1 - T(n,0), T(n,k) = T(n-1,k-1), T(1,0) = 1 T(n,n) = -1, 1

%I #26 Apr 12 2019 13:11:06

%S -1,1,-1,7,-6,-1,11,-10,-6,-1,13,-12,-10,-6,-1,17,-16,-12,-10,-6,-1,

%T 19,-18,-16,-12,-10,-6,-1,23,-22,-18,-16,-12,-10,-6,-1,29,-28,-22,-18,

%U -16,-12,-10,-6,-1,31,-30,-28,-22,-18,-16,-12,-10,-6,-1,37,-36,-30,-28,-22,-18,-16,-12,-10,-6,-1

%N Triangle read by rows: T(n,0) = prime(n+2), T(n,1) = 1 - T(n,0), T(n,k) = T(n-1,k-1), T(1,0) = 1 T(n,n) = -1,

%H G. C. Greubel, <a href="/A152722/b152722.txt">Rows n = 0..50 of triangle, flattened</a>

%F T(n,n) = -1, T(1,0) = 1, T(n,0) = prime(n+2), T(n,1) = 1 - prime(n+2), T(n,k) = T(n-1,k-1). - _G. C. Greubel_, Apr 07 2019

%e Triangle begins as:

%e -1;

%e 1, -1;

%e 7, -6, -1;

%e 11, -10, -6, -1;

%e 13, -12, -10, -6, -1;

%e 17, -16, -12, -10, -6, -1;

%e 19, -18, -16, -12, -10, -6, -1;

%e 23, -22, -18, -16, -12, -10, -6, -1;

%e 29, -28, -22, -18, -16, -12, -10, -6, -1;

%t T[n_, n_]:= -1; T[1, 0]:= 1; T[n_, 0]:= Prime[n+2]; T[n_, 1]:= 1 - Prime[n+2]; T[n_, k_]:= T[n-1, k-1]; Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* _G. C. Greubel_, Apr 07 2019 *)

%o (PARI) {T(n,k) = if(k==n, -1, if(n==1 && k==0, 1, if(k==0, prime(n+2), if(k==1, 1-prime(n+2), T(n-1,k-1) ))))}; \\ _G. C. Greubel_, Apr 07 2019

%o (Sage)

%o @CachedFunction

%o def T(n,k):

%o if k==n: return -1

%o elif n==1 and k==0: return 1

%o elif k==0: return nth_prime(n+2)

%o elif k==1: return 1 - nth_prime(n+2)

%o else: return T(n-1,k-1)

%o [[T(n,k) for k in (0..n)] for n in (0..10)] # _G. C. Greubel_, Apr 07 2019

%Y Cf. A152568, A027293.

%K sign,tabl,less,obsc

%O 0,4

%A _Roger L. Bagula_ and _Alexander R. Povolotsky_, Dec 11 2008

%E Edited by _G. C. Greubel_, Apr 07 2019

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 29 09:16 EDT 2024. Contains 375511 sequences. (Running on oeis4.)