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!)
A332662 Put-and-count: An enumeration of N X N where N = {0, 1, 2, ...}. The terms are interleaved x and y coordinates. Or: A row-wise storage scheme for sequences of regular triangles. 7
0, 0, 0, 1, 1, 0, 2, 0, 0, 2, 1, 1, 2, 1, 3, 0, 4, 0, 5, 0, 0, 3, 1, 2, 2, 2, 3, 1, 4, 1, 5, 1, 6, 0, 7, 0, 8, 0, 9, 0, 0, 4, 1, 3, 2, 3, 3, 2, 4, 2, 5, 2, 6, 1, 7, 1, 8, 1, 9, 1, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 0, 5, 1, 4, 2, 4, 3, 3, 4, 3, 5, 3, 6, 2, 7, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,7

COMMENTS

Other enumerations of N X N designed with storage allocation for extensible arrays in mind include A319514 and A319571.

LINKS

Peter Luschny, Table of n, a(n) for n = 0..10000

EXAMPLE

Illustrating the linear storage layout of a sequence of regular triangles.

(A) [ 0], [ 2,  3], [ 7,  8,  9], [16, 17, 18, 19], [30, 31, 32, 33, 34], ...

(B) [ 1], [ 5,  6], [13, 14, 15], [26, 27, 28, 29], ...

(C) [ 4], [11, 12], [23, 24, 25], ...

(D) [10], [21, 22], ...

(E) [20], ...

...

The first column is A000292.

The start values of all partial rows (in ascending order) are 0 plus A014370.

The start values of the partial rows in the first row are A005581 (without first 0).

The start values of the partial rows on the main diagonal are A331987.

The end values of all partial rows (in ascending order) are A332023.

The end values of the partial rows in the first row are A062748.

The end values of the partial rows on the main diagonal are A332698.

MAPLE

count := (k, A) -> ListTools:-Occurrences(k, A): t := n -> n*(n+1)/2:

PutAndCount := proc(N) local L, n, v, c, seq; L := NULL; seq := NULL;

for n from 1 to N do

   for v from 0 to t(n)-1 do

     # How often did you see v in this sequence before?

     c := count(v, [seq]);

     L := L, v, c; seq := seq, v;

od od; L end:  PutAndCount(6);

# Returning 'seq' instead of 'L' gives the x-coordinates (A332663).

PROG

(Julia)

function a_list(N)

    a = Int[]

    for n in 1:N

        i = 0

        for j in ((k:-1:1) for k in 1:n)

            t = n - j[1]

            for m in j

                push!(a, i, t)

                i += 1

end end end; a end

a_list(5) |> println

CROSSREFS

A332663 (x-coordinates), A056559 (y-coordinates).

Cf. A000292, A014370, A002260, A005581, A319514, A319571, A331987.

Cf. A332023, A062748, A332698.

Sequence in context: A081827 A100286 A280912 * A029303 A281640 A281452

Adjacent sequences:  A332659 A332660 A332661 * A332663 A332664 A332665

KEYWORD

nonn

AUTHOR

Peter Luschny, Feb 18 2020

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 October 24 18:08 EDT 2021. Contains 348233 sequences. (Running on oeis4.)