OFFSET
1,2
COMMENTS
From Petros Hadjicostas, Jun 22 2019: (Start)
This is a dynamically defined sequence. Since the nonprimes from each row are mixed with the nonprimes of previous rows and then sorted, the value of a(n) may change each time we add a new row.
For a modification of R. J. Mathar's program below so that nonprimes are sorted only within each row (so as to get a uniquely defined sequence) see the documentation of sequences A141064, A141065, A141066, A141067, A141068, and A141069.
(End)
LINKS
EXAMPLE
1 yields a(1) = 1.
1 1 yields no new member.
1 2 1 yields no new member.
1 4 2 1 yields a(2) = 4.
1 8 4 2 1 yields a(3) = 8.
1 16 8 4 2 1 yields a(4) = 16.
1 32 16 8 4 2 1 yields a(5) = 32.
1 63 33 16 8 4 2 1 yields a(6) = 33 and a(7) = 63.
1 124 67 33 16 8 4 2 1 yields a(8) = 124.
1 244 136 67 33 16 8 4 2 1 yields a(9) = 136 and a(10) = 244.
1 480 276 136 67 33 16 8 4 2 1 yields a(11) = 276 and a(12) = 480.
1 944 560 276 136 67 33 16 8 4 2 1 yields a(13) = 560 and a(14) = 944.
...
From Petros Hadjicostas, Jun 22 2019: (Start)
In the above example, we only sort the nonprimes up to row 11; we get the same output from R. J. Mathar's program below if we say A141031(11). If, however, we include more rows in the program, the indexing of the nonprimes changes.
For example, the nonprimes in the data above come from the nonprimes of 22 rows. If we include more rows, then the indexing again changes and the value of each a(n) may not stay the same.
(End)
MAPLE
A141020 := proc(n, k) option remember ; if k<0 or k>n then 0 ; elif k=0 or k=n then 1 ; elif k=n-1 then 2 ; elif k=n-2 then 4 ; elif k=n-3 then 8 ; elif k=n-4 then 16 ; else procname(n-1, k)+procname(n-2, k)+procname(n-3, k)+procname(n-4, k) +procname(n-5, k)+procname(n-5, k-1) ; fi; end:
A141031 := proc(nmax) local a, n, k ; a := [] ; for n from 0 to nmax do for k from 0 to n do a141020 := A141020(n, k) ; if not isprime(a141020) and not a141020 in a then a := [op(a), a141020] ; fi; od: od: RETURN(sort(a)) ; end: A141031(30) ; # R. J. Mathar, Sep 19 2008
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jul 12 2008
EXTENSIONS
Partially edited by N. J. A. Sloane, Jul 18 2008
Simplified definition, corrected values by R. J. Mathar, Sep 19 2008
STATUS
approved