login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A257232 Triangle T(n, k) with the natural numbers in columns with nonprime k and the nonnegative numbers in columns with prime k, for 1 <= k <= n. 3
1, 2, 0, 3, 1, 0, 4, 2, 1, 1, 5, 3, 2, 2, 0, 6, 4, 3, 3, 1, 1, 7, 5, 4, 4, 2, 2, 0, 8, 6, 5, 5, 3, 3, 1, 1, 9, 7, 6, 6, 4, 4, 2, 2, 1, 10, 8, 7, 7, 5, 5, 3, 3, 2, 1, 11, 9, 8, 8, 6, 6, 4, 4, 3, 2, 0 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

This triangle is motivated by sequence A256885 by Wesley Ivan Hurt, which is the sequence of row sums for n >= 1.

Row n ends in a 0 if n is prime; otherwise it ends in 1.

The alternating row sums give 1, seven times 2, six times 3, six times 4, four times 5, twice 6, ..., and the multiplicity sequence 1, 7, 6, 6, 4, 2, ... is given in A257233.

LINKS

Reinhard Zumkeller, Rows n = 1..125 of triangle, flattened

FORMULA

T(n, k) = n - (k-1) - [isprime(k)], with [isprime(k)] = A010051(k), for  1 <= k <= n.

O.g.f. for column k (with leading zeros): x^k/(1-x)^2 if k is nonprime else x^(k+1)/(1-x)^2.

T(n+1,k) = T(n,k) + 1, 1 <= k <= n, T(n+1,n+1) = 1 - A010051(n+1). - Reinhard Zumkeller, Apr 21 2015

EXAMPLE

The triangle T(n, k) begins:

n\k  1  2  3  4  5  6  7  8  9 10 11 ...

1:   1

2:   2  0

3:   3  1  0

4:   4  2  1  1

5:   5  3  2  2  0

6:   6  4  3  3  1  1

7:   7  5  4  4  2  2  0

8:   8  6  5  5  3  3  1  1

9:   9  7  6  6  4  4  2  2  1

10: 10  8  7  7  5  5  3  3  2  1

11: 11  9  8  8  6  6  4  4  3  2  0

...

MATHEMATICA

Table[n - (k - 1) - Boole[PrimeQ@ k], {n, 11}, {k, n}] // Flatten (* Michael De Vlieger, Apr 19 2015 *)

PROG

(Haskell)

a257232 n k = a257232_tabl !! (n-1) !! (k-1)

a257232_row n = a257232_tabl !! (n-1)

a257232_tabl = iterate

               (\xs@(x:_) -> map (+ 1) xs ++ [1 - a010051 (x + 1)]) [1]

-- Reinhard Zumkeller, Apr 21 2015

CROSSREFS

Cf. A256885 (row sums), A257233 (multiplicities for alternating row sums).

Cf. A010051.

Sequence in context: A003988 A185914 A144257 * A208544 A208535 A284856

Adjacent sequences:  A257229 A257230 A257231 * A257233 A257234 A257235

KEYWORD

nonn,easy,tabl

AUTHOR

Wolfdieter Lang, Apr 19 2015

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 22 02:46 EDT 2018. Contains 316431 sequences. (Running on oeis4.)