OEIS/Cumulative counting: Difference between revisions

From tehowiki
Jump to navigation Jump to search
imported>Gfis
description
imported>Gfis
 
(6 intermediate revisions by the same user not shown)
Line 10: Line 10:
  0.|.1.|.2 1.|.3 3 1.|.4 5 2 2.|.5 6 5 3 1 1.|.6 9 6 5 2 4 1.|.7 11 8 6 4 6 4 1
  0.|.1.|.2 1.|.3 3 1.|.4 5 2 2.|.5 6 5 3 1 1.|.6 9 6 5 2 4 1.|.7 11 8 6 4 6 4 1
  ..|.0.|.0 1.|.0 1 2.|.0 1 2 3.|.0 1 2 3 4 5.|.0 1 2 3 4 5 6.|.0 1  2 3 4 5 6 9
  ..|.0.|.0 1.|.0 1 2.|.0 1 2 3.|.0 1 2 3 4 5.|.0 1 2 3 4 5 6.|.0 1  2 3 4 5 6 9
 
Depending on the starting value s(1), with variations of the rules and derivations, there are more than 120 related sequences in the OEIS.
Depending on the starting value s(1), with variations of the rules and derivations, there are more than 100 related sequences in the OEIS.  
== Results and Problems ==
A Perl program and a Unix <code>makefile</code> were written in order to evaluate these sequences. Only a few problems were found:
# The treatment of zero attributes and noun zero is not always clearly described, and the methods differ considerably with this respect.
# Most b-files are rather short, though some sequences have quite a number of terms in common (e.g. 61, 82) before they start to differ.
# [https://oeis.org/A030717 A030717] (row 1)  does not correspond with the derived sequences [https://oeis.org/A030718 A030718] (row 2) and A030719-A030726. A030717 initially had no zero terms, but in 2014 the description was changed, and the b-file now has zero terms. This should be changed back.
# [https://oeis.org/A030740 A030740] (inverse) has a strange <code>OFFSET 2,1</code> which should be 1,1 IMHO as for the similiar [https://oeis.org/A030730 A030730], [https://oeis.org/A030750 A030750]. In the description there is a typo <code>j'2</code>.
# [https://oeis.org/A055186 A055186] should not carry KEYWORD <code>base</code>.
# In the example for [https://oeis.org/A055168 A055168], the last <code>3</code> should be a <code>4</code>.
==List of ''cumulative counting'' sequences==
==List of ''cumulative counting'' sequences==
The list of 116 sequences below describes the variations. The list has the following entries (which are explained in more detail in the Perl program, below):
The list of more than 120 sequences below describes the variations. The list has the following entries (which are explained in more detail in the Perl program, below):
* the OEIS A-number,
* the OEIS A-number,
* a major rule name (A, B were defined by C. Kimberling)
* a major rule name (A, B were defined by C. Kimberling)
* a minor rule number, the row number (1, 2, ...)
* a code for the ordering in the segements
* the starting value s(1)
* the starting value s(1)
* an optional small integer parameter
* a code for the ordering in the segments (increasing/decreasing order, first appearance)
* the number of lines in the b-file
* a code for the row number (1, 2, ...)
  [https://oeis.org/A030707 A030707] Rule A.1 io 1   84
* optional parameters
  [https://oeis.org/A030708 A030708] Rule A.2 io 1    82
  [http://oeis.org/A030707 A030707] A 1 io 1
  [https://oeis.org/A030709 A030709] Rule T   io 1   30
  [http://oeis.org/A030708 A030708] A 1 io 2
  [https://oeis.org/A030710 A030710] Rule I.1 io 1   54
  [http://oeis.org/A030709 A030709] T 1 io 1
  [https://oeis.org/A030711 A030711] Rule J.1 io 1   32
  [http://oeis.org/A030710 A030710] I 1 io 1
  [https://oeis.org/A030712 A030712] Rule K.1 io 1   32
  [http://oeis.org/A030711 A030711] J 1 io 1
  [https://oeis.org/A030713 A030713] Rule P.1 io 1 1 52
  [http://oeis.org/A030712 A030712] K 1 io 1
  [https://oeis.org/A030714 A030714] Rule P.1 io 1 2 50
  [http://oeis.org/A030713 A030713] P 1 io 1 parm=1
  [https://oeis.org/A030715 A030715] Rule P.1 io 1 3 50
  [http://oeis.org/A030714 A030714] P 1 io 1 parm=2
  [https://oeis.org/A030716 A030716] Rule P.1 io 1 4 49
  [http://oeis.org/A030715 A030715] P 1 io 1 parm=3
  [https://oeis.org/A030717 A030717] Rule A.3 io 1    1732
  [http://oeis.org/A030716 A030716] P 1 io 1 parm=4
  [https://oeis.org/A030718 A030718] Rule A.4 io 1
  [http://oeis.org/A030717 A030717] A 1 io 5 with0=3
  [https://oeis.org/A030719 A030719] Rule T   io 1
  [http://oeis.org/A030718 A030718] A 1 io 6
  [https://oeis.org/A030720 A030720] Rule I.3 io 1
  [http://oeis.org/A030719 A030719] T 1 io 5
  [https://oeis.org/A030721 A030721] Rule J.3 io 1
  [http://oeis.org/A030720 A030720] I 1 io 5
  [https://oeis.org/A030722 A030722] Rule K.3 io 1
  [http://oeis.org/A030721 A030721] J 1 io 5
  [https://oeis.org/A030723 A030723] Rule P.3 io 1 1
  [http://oeis.org/A030722 A030722] K 1 io 5
  [https://oeis.org/A030724 A030724] Rule P.3 io 1 2
  [http://oeis.org/A030723 A030723] P 1 io 5 parm=1
  [https://oeis.org/A030725 A030725] Rule P.3 io 1 3
  [http://oeis.org/A030724 A030724] P 1 io 5 parm=2
  [https://oeis.org/A030726 A030726] Rule P.3 io 1 4
  [http://oeis.org/A030725 A030725] P 1 io 5 parm=3
  [https://oeis.org/A030727 A030727] Rule A.1 io 3    83
  [http://oeis.org/A030726 A030726] P 1 io 5 parm=4
  [https://oeis.org/A030728 A030728] Rule A.2 io 3    83
  [http://oeis.org/A030727 A030727] A 3 io 1
  [https://oeis.org/A030729 A030729] Rule T   io 3   29
  [http://oeis.org/A030728 A030728] A 3 io 2
  [https://oeis.org/A030730 A030730] Rule I.1 io 3    53
  [http://oeis.org/A030729 A030729] T 3 io 3
  [https://oeis.org/A030731 A030731] Rule J.1 io 3    29
  [http://oeis.org/A030730 A030730] I 3 io 1
  [https://oeis.org/A030732 A030732] Rule K.1 io 3    29
  [http://oeis.org/A030731 A030731] J 3 io 1
  [https://oeis.org/A030733 A030733] Rule P.1 io 3 1 51
  [http://oeis.org/A030732 A030732] K 3 io 1
  [https://oeis.org/A030734 A030734] Rule P.1 io 3 2 50
  [http://oeis.org/A030733 A030733] P 3 io 1 parm=1
  [https://oeis.org/A030735 A030735] Rule P.1 io 3 3  46
  [http://oeis.org/A030734 A030734] P 3 io 1 parm=2
  [https://oeis.org/A030736 A030736] Rule P.1 io 3 4 49
  [http://oeis.org/A030735 A030735] P 3 io 1 parm=3
  [https://oeis.org/A030737 A030737] Rule A.1 io 2    83
  [http://oeis.org/A030736 A030736] P 3 io 1 parm=4
  [https://oeis.org/A030738 A030738] Rule A.2 io 2   83
  [http://oeis.org/A030737 A030737] A 2 io 1
  [https://oeis.org/A030739 A030739] Rule T   io 2    29
  [http://oeis.org/A030738 A030738] A 2 io 2
  [https://oeis.org/A030740 A030740] Rule I.1 io 2    53
  [http://oeis.org/A030739 A030739] T 2 io 3
  [https://oeis.org/A030741 A030741] Rule J.1 io 2    30
  [http://oeis.org/A030740 A030740] I 2 io 1
  [https://oeis.org/A030742 A030742] Rule K.1 io 2    30
  [http://oeis.org/A030741 A030741] J 2 io 1
  [https://oeis.org/A030743 A030743] Rule P.1 io 2 1 52
  [http://oeis.org/A030742 A030742] K 2 io 1
  [https://oeis.org/A030744 A030744] Rule P.1 io 2 2 50
  [http://oeis.org/A030743 A030743] P 2 io 1 parm=1
  [https://oeis.org/A030745 A030745] Rule P.1 io 2 3 49
  [http://oeis.org/A030744 A030744] P 2 io 1 parm=2
  [https://oeis.org/A030746 A030746] Rule P.1 io 2 4 49
  [http://oeis.org/A030745 A030745] P 2 io 1 parm=3
  [https://oeis.org/A030747 A030747] Rule A.1 io 4    82
  [http://oeis.org/A030746 A030746] P 2 io 1 parm=4
  [https://oeis.org/A030748 A030748] Rule A.2 io 4    86
  [http://oeis.org/A030747 A030747] A 4 io 1
  [https://oeis.org/A030749 A030749] Rule T   io 4    30
  [http://oeis.org/A030748 A030748] A 4 io 2
  [https://oeis.org/A030750 A030750] Rule I.1 io 4    53
  [http://oeis.org/A030749 A030749] T 4 io 3
  [https://oeis.org/A030751 A030751] Rule J.1 io 4    29
  [http://oeis.org/A030750 A030750] I 4 io 1
  [https://oeis.org/A030752 A030752] Rule K.1 io 4    29
  [http://oeis.org/A030751 A030751] J 4 io 1
  [https://oeis.org/A030753 A030753] Rule P.1 io 4 1 51
  [http://oeis.org/A030752 A030752] K 4 io 1
  [https://oeis.org/A030754 A030754] Rule P.1 io 4 2 49
  [http://oeis.org/A030753 A030753] P 4 io 1 parm=1
  [https://oeis.org/A030755 A030755] Rule P.1 io 4 3 46
  [http://oeis.org/A030754 A030754] P 4 io 1 parm=2
  [https://oeis.org/A030756 A030756] Rule P.1 io 4 4  33
  [http://oeis.org/A030755 A030755] P 4 io 1 parm=3
  [https://oeis.org/A030757 A030757] Rule A.1 do 1   84
  [http://oeis.org/A030756 A030756] P 4 io 1 parm=4
  [https://oeis.org/A030758 A030758] Rule A.2 do 1    81
  [http://oeis.org/A030757 A030757] A 1 do 1
  [https://oeis.org/A030759 A030759] Rule T   do 1    29
  [http://oeis.org/A030758 A030758] A 1 do 2
  [https://oeis.org/A030760 A030760] Rule I.1 do 1   53
  [http://oeis.org/A030759 A030759] T 1 do 3
  [https://oeis.org/A030761 A030761] Rule J.1 do 1   29
  [http://oeis.org/A030760 A030760] I 1 do 1
  [https://oeis.org/A030762 A030762] Rule K.1 do 1   29
  [http://oeis.org/A030761 A030761] J 1 do 1
  [https://oeis.org/A030763 A030763] Rule P.1 do 1 1 52
  [http://oeis.org/A030762 A030762] K 1 do 1
  [https://oeis.org/A030764 A030764] Rule P.1 do 1 2 50
  [http://oeis.org/A030763 A030763] P 1 do 1 parm=1
  [https://oeis.org/A030765 A030765] Rule P.1 do 1 3 50
  [http://oeis.org/A030764 A030764] P 1 do 1 parm=2
  [https://oeis.org/A030766 A030766] Rule P.1 do 1 4 49
  [http://oeis.org/A030765 A030765] P 1 do 1 parm=3
  [https://oeis.org/A030767 A030767] Rule A.1 do 2    86
  [http://oeis.org/A030766 A030766] P 1 do 1 parm=4
  [https://oeis.org/A030768 A030768] Rule A.2 do 2   81
  [http://oeis.org/A030767 A030767] A 2 do 1
  [https://oeis.org/A030769 A030769] Rule T   do 2    29
  [http://oeis.org/A030768 A030768] A 2 do 2
  [https://oeis.org/A030770 A030770] Rule I.1 do 2    53
  [http://oeis.org/A030769 A030769] T 2 do 3
  [https://oeis.org/A030771 A030771] Rule J.1 do 2    36
  [http://oeis.org/A030770 A030770] I 2 do 1
  [https://oeis.org/A030772 A030772] Rule K.1 do 2    36
  [http://oeis.org/A030771 A030771] J 2 do 1
  [https://oeis.org/A030773 A030773] Rule P.1 do 2 1 52
  [http://oeis.org/A030772 A030772] K 2 do 1
  [https://oeis.org/A030774 A030774] Rule P.1 do 2 2  51
  [http://oeis.org/A030773 A030773] P 2 do 1 parm=1
  [https://oeis.org/A030775 A030775] Rule P.1 do 2 3 49
  [http://oeis.org/A030774 A030774] P 2 do 1 parm=2
  [https://oeis.org/A030776 A030776] Rule P.1 do 2 4 49
  [http://oeis.org/A030775 A030775] P 2 do 1 parm=3
  [https://oeis.org/A030777 A030777] Rule A.1 do 3    85
  [http://oeis.org/A030776 A030776] P 2 do 1 parm=4
  [https://oeis.org/A030778 A030778] Rule A.2 do 3    81
  [http://oeis.org/A030777 A030777] A 3 do 1
  [https://oeis.org/A030779 A030779] Rule T   do 3   29
  [http://oeis.org/A030778 A030778] A 3 do 2
  [https://oeis.org/A030780 A030780] Rule I.1 do 3    53
  [http://oeis.org/A030779 A030779] T 3 do 3
  [https://oeis.org/A030781 A030781] Rule J.1 do 3    29
  [http://oeis.org/A030780 A030780] I 3 do 1
  [https://oeis.org/A030782 A030782] Rule K.1 do 3    29
  [http://oeis.org/A030781 A030781] J 3 do 1
  [https://oeis.org/A030783 A030783] Rule P.1 do 3 1 52
  [http://oeis.org/A030782 A030782] K 3 do 1
  [https://oeis.org/A030784 A030784] Rule P.1 do 3 2 50
  [http://oeis.org/A030783 A030783] P 3 do 1 parm=1
  [https://oeis.org/A030785 A030785] Rule P.1 do 3 3  49
  [http://oeis.org/A030784 A030784] P 3 do 1 parm=2
  [https://oeis.org/A030786 A030786] Rule P.1 do 3 4 49
  [http://oeis.org/A030785 A030785] P 3 do 1 parm=3
  [https://oeis.org/A030787 A030787] Rule A.1 do 4    83
  [http://oeis.org/A030786 A030786] P 3 do 1 parm=4
  [https://oeis.org/A030788 A030788] Rule A.2 do 4    83
  [http://oeis.org/A030787 A030787] A 4 do 1
  [https://oeis.org/A030789 A030789] Rule T   do 4    30
  [http://oeis.org/A030788 A030788] A 4 do 2
  [https://oeis.org/A030790 A030790] Rule I.1 do 4    53
  [http://oeis.org/A030789 A030789] T 4 do 3
  [https://oeis.org/A030791 A030791] Rule J.1 do 4    30
  [http://oeis.org/A030790 A030790] I 4 do 1
  [https://oeis.org/A030792 A030792] Rule K.1 do 4    30
  [http://oeis.org/A030791 A030791] J 4 do 1
  [https://oeis.org/A030793 A030793] Rule P.1 do 4 1 51
  [http://oeis.org/A030792 A030792] K 4 do 1
  [https://oeis.org/A030794 A030794] Rule P.1 do 4 2 49
  [http://oeis.org/A030793 A030793] P 4 do 1 parm=1
  [https://oeis.org/A030795 A030795] Rule P.1 do 4 3 46
  [http://oeis.org/A030794 A030794] P 4 do 1 parm=2
  [https://oeis.org/A030796 A030796] Rule P.1 do 4 4  33
  [http://oeis.org/A030795 A030795] P 4 do 1 parm=3
  [https://oeis.org/A055168 A055168] Rule B  fa 0   90
  [http://oeis.org/A030796 A030796] P 4 do 1 parm=4
  [https://oeis.org/A055169 A055169] Rule N  fa 0    10000
  [http://oeis.org/A051120 A051120] A 1 do 3 offset=0 first=2
  [https://oeis.org/A055170 A055170] Rule D   fa 0    6000
  [http://oeis.org/A055168 A055168] B 0 fa 3 with0=2
  [https://oeis.org/A055171 A055171] Rule B   fa 1    87
  [http://oeis.org/A055169 A055169] N 0 fa 3 with0=2
  [https://oeis.org/A055172 A055172] Rule N   fa 1    39
[http://oeis.org/A055170 A055170] D 0 fa 2 with0=2
  [https://oeis.org/A055173 A055173] Rule D   fa 1    64
  [http://oeis.org/A055171 A055171] B 1 fa 3
  [https://oeis.org/A055174 A055174] Rule B   fa 2    88
  [http://oeis.org/A055172 A055172] N 1 fa 3
  [https://oeis.org/A055175 A055175] Rule N   fa 2    39
  [http://oeis.org/A055173 A055173] D 1 fa 2
  [https://oeis.org/A055176 A055176] Rule D   fa 2   64
  [http://oeis.org/A055174 A055174] B 2 fa 3
  [https://oeis.org/A055177 A055177] Rule B   fa 3   87
  [http://oeis.org/A055175 A055175] N 2 fa 3
  [https://oeis.org/A055178 A055178] Rule N   fa 3   39
  [http://oeis.org/A055176 A055176] D 2 fa 2
  [https://oeis.org/A055179 A055179] Rule D   fa 3    64
  [http://oeis.org/A055177 A055177] B 3 fa 3
  [https://oeis.org/A055180 A055180] Rule B   fa 4    88
  [http://oeis.org/A055178 A055178] N 3 fa 3
  [https://oeis.org/A055181 A055181] Rule N   fa 4    39
  [http://oeis.org/A055179 A055179] D 3 fa 2
  [https://oeis.org/A055182 A055182] Rule D   fa 4    64
  [http://oeis.org/A055180 A055180] B 4 fa 3
  [https://oeis.org/A055183 A055183] Rule B   fa 5    87
  [http://oeis.org/A055181 A055181] N 4 fa 3
  [https://oeis.org/A055184 A055184] Rule N   fa 5    39
  [http://oeis.org/A055182 A055182] D 4 fa 2
  [https://oeis.org/A055185 A055185] Rule D   fa 5    64
  [http://oeis.org/A055183 A055183] B 5 fa 3
  [https://oeis.org/A055186 A055186] Rule A   iz 0   1022
  [http://oeis.org/A055184 A055184] N 5 fa 3
  [https://oeis.org/A055187 A055187] Rule A   io 1    98
  [http://oeis.org/A055185 A055185] D 5 fa 2
  [https://oeis.org/A055188 A055188] Rule A   fa 2    87
  [http://oeis.org/A055186 A055186] A 0 io 3 with0=3
  [https://oeis.org/A055189 A055189] Rule A   fa 3   87
  [http://oeis.org/A055187 A055187] A 1 io 3 with0=2
  [https://oeis.org/A055190 A055190] Rule A   fa 4    89
  [http://oeis.org/A055188 A055188] A 2 fa 3
  [https://oeis.org/A055191 A055191] Rule A   fa 5    87
  [http://oeis.org/A055189 A055189] A 3 fa 3
  [https://oeis.org/A217760 A217760] Rule A   fa 0   9666
  [http://oeis.org/A055190 A055190] A 4 fa 3
  [https://oeis.org/A217780 A217780] Rule A  fa 1   71
  [http://oeis.org/A055191 A055191] A 5 fa 3
=Generating Perl program==
[http://oeis.org/A079668 A079668] A 1 io 3 first=2 with0=3
  [http://oeis.org/A079686 A079686] A 0 do 3 offset=0 with0=3
  [http://oeis.org/A126027 A126027] T 1 io 5 with0=3
[http://oeis.org/A174382 A174382] A 0 io 5 with0=3
[http://oeis.org/A217760 A217760] A 0 fa 3 with0=2
[http://oeis.org/A217780 A217780] A 1 fa 3
[http://oeis.org/A240508 A240508] T 0 io 5 with0=3
122 sequences
 
==Symmetry and relations==
s    A 1      A 2      T        I        J        K        P 1      P 2      P 3      P 4
1  [http://oeis.org/A030707 A030707] [http://oeis.org/A030708 A030708] [http://oeis.org/A030709 A030709] [http://oeis.org/A030710 A030710] [http://oeis.org/A030711 A030711] [http://oeis.org/A030712 A030712] [http://oeis.org/A030713 A030713] [http://oeis.org/A030714 A030714] [http://oeis.org/A030715 A030715] [http://oeis.org/A030716 A030716] io
    [http://oeis.org/A030717 A030717] [http://oeis.org/A030718 A030718] [http://oeis.org/A030719 A030719] [http://oeis.org/A030720 A030720] [http://oeis.org/A030721 A030721] [http://oeis.org/A030722 A030722] [http://oeis.org/A030723 A030723] [http://oeis.org/A030724 A030724] [http://oeis.org/A030725 A030725] [http://oeis.org/A030726 A030726] io
3  [http://oeis.org/A030727 A030727] [http://oeis.org/A030728 A030728] [http://oeis.org/A030729 A030729] [http://oeis.org/A030730 A030730] [http://oeis.org/A030731 A030731] [http://oeis.org/A030732 A030732] [http://oeis.org/A030733 A030733] [http://oeis.org/A030734 A030734] [http://oeis.org/A030735 A030735] [http://oeis.org/A030736 A030736] io
2  [http://oeis.org/A030737 A030737] [http://oeis.org/A030738 A030738] [http://oeis.org/A030739 A030739] [http://oeis.org/A030740 A030740] [http://oeis.org/A030741 A030741] [http://oeis.org/A030742 A030742] [http://oeis.org/A030743 A030743] [http://oeis.org/A030744 A030744] [http://oeis.org/A030745 A030745] [http://oeis.org/A030746 A030746] io
4  [http://oeis.org/A030747 A030747] [http://oeis.org/A030748 A030748] [http://oeis.org/A030749 A030749] [http://oeis.org/A030750 A030750] [http://oeis.org/A030751 A030751] [http://oeis.org/A030752 A030752] [http://oeis.org/A030753 A030753] [http://oeis.org/A030754 A030754] [http://oeis.org/A030755 A030755] [http://oeis.org/A030756 A030756] io
   
1  [http://oeis.org/A030757 A030757] [http://oeis.org/A030758 A030758] [http://oeis.org/A030759 A030759] [http://oeis.org/A030760 A030760] [http://oeis.org/A030761 A030761] [http://oeis.org/A030762 A030762] [http://oeis.org/A030763 A030763] [http://oeis.org/A030764 A030764] [http://oeis.org/A030765 A030765] [http://oeis.org/A030766 A030766] do
2  [http://oeis.org/A030767 A030767] [http://oeis.org/A030768 A030768] [http://oeis.org/A030769 A030769] [http://oeis.org/A030770 A030770] [http://oeis.org/A030771 A030771] [http://oeis.org/A030772 A030772] [http://oeis.org/A030773 A030773] [http://oeis.org/A030774 A030774] [http://oeis.org/A030775 A030775] [http://oeis.org/A030776 A030776] do
3  [http://oeis.org/A030777 A030777] [http://oeis.org/A030778 A030778] [http://oeis.org/A030779 A030779] [http://oeis.org/A030780 A030780] [http://oeis.org/A030781 A030781] [http://oeis.org/A030782 A030782] [http://oeis.org/A030783 A030783] [http://oeis.org/A030784 A030784] [http://oeis.org/A030785 A030785] [http://oeis.org/A030786 A030786] do
4  [http://oeis.org/A030787 A030787] [http://oeis.org/A030788 A030788] [http://oeis.org/A030789 A030789] [http://oeis.org/A030790 A030790] [http://oeis.org/A030791 A030791] [http://oeis.org/A030792 A030792] [http://oeis.org/A030793 A030793] [http://oeis.org/A030794 A030794] [http://oeis.org/A030795 A030795] [http://oeis.org/A030796 A030796] do
s    B        N        D
0 [http://oeis.org/A055168 A055168] [http://oeis.org/A055169 A055169] [http://oeis.org/A055170 A055170] fa
1 [http://oeis.org/A055171 A055171] [http://oeis.org/A055172 A055172] [http://oeis.org/A055173 A055173] fa
2 [http://oeis.org/A055174 A055174] [http://oeis.org/A055175 A055175] [http://oeis.org/A055176 A055176] fa
3 [http://oeis.org/A055177 A055177] [http://oeis.org/A055178 A055178] [http://oeis.org/A055179 A055179] fa
4 [http://oeis.org/A055180 A055180] [http://oeis.org/A055181 A055181] [http://oeis.org/A055182 A055182] fa
5 [http://oeis.org/A055183 A055183] [http://oeis.org/A055184 A055184] [http://oeis.org/A055185 A055185] fa
The following relations can be observed:
1 A030709 = A030759 (segment lengths)
2 A030739 = A030769
3 A030729 = A030779
4 A030749 = A030789
1 A030711 = A030761 (next term which is greater than all previous)
 
==Generating Perl program==
The Perl program below can be used to generate all sequences of the list. It produces b-files, but the rules T, J, K are currently rather slow, and take time above 100 entries. The latest version of the program and its auxilliary files can be found on a [https://github.com/gfis/fasces/tree/master/oeis/A055187 Github repository].
The Perl program below can be used to generate all sequences of the list. It produces b-files, but the rules T, J, K are currently rather slow, and take time above 100 entries. The latest version of the program and its auxilliary files can be found on a [https://github.com/gfis/fasces/tree/master/oeis/A055187 Github repository].
<pre>
<pre>
Line 143: Line 184:
#!perl
#!perl


# Generate OEIS A030707, A055187, A217760 and related  
# Generate OEIS A030707, A055187, A217760 and related
# "cumulative counting" sequences as defined by Clark Kimberling.
# "cumulative counting" sequences as defined by Clark Kimberling.
# http://faculty.evansville.edu/ck6/integer/unsolved.html, Problem 4
# http://faculty.evansville.edu/ck6/integer/unsolved.html, Problem 4
# @(#) $Id$
# @(#) $Id$
# 2018-04-20, Georg Fischer
# 2018-04-20, Georg Fischer (previosu version in cumulcount2.pl)
#------------------------------------------------------
#------------------------------------------------------
# Comment from A217760:
# Comment from A217760:
Line 153: Line 194:
#  tells how many times each previously written integer occurs, in the order
#  tells how many times each previously written integer occurs, in the order
#  of first occurrence.  This is Method A (adjective-before-noun pairs); for
#  of first occurrence.  This is Method A (adjective-before-noun pairs); for
#  Method B (noun-before-adjective), see A055168.  
#  Method B (noun-before-adjective), see A055168.
# Example:
# Example:
#  Start with 0, followed by the adjective-noun pair 1,0; followed by
#  Start with 0, followed by the adjective-noun pair 1,0; followed by
Line 162: Line 203:
#
#
# Usage:
# Usage:
#  perl cumulcount.pl rule row noeis len order p1 [p2 [debug]]
#  perl cumulcount.pl -m method -r row -n noeis -l len -a appear -o offset -s start -p parm -w with0 -d debug
#      rule  = "A" (attribute before noun)
#      All parameters are optional and have a default value:
#               "B" (noun before attribute)
#      method = "A" (attribute over noun; default)
#               "D" (new, distinct elements)
#               "B" (noun over attribute)
#               "I" (inverse, first occurrence of a number)
#               "D" (new, distinct elements)
#               "J" (next term which is greater than all previous)
#               "I" (inverse, first occurrence of a number)
#               "K" (next position where term is greater than all previous)
#               "J" (next term which is greater than all previous)
#               "N" (number of new elements in segment)
#               "K" (next position where term is greater than all previous)
#               "P" (positions of small numbers (p2))
#               "N" (number of new elements in segment)
#               "T" (number of terms in segment n)
#               "P" (positions of small numbers (parm))
#      row   = 0 (both)
#               "S" (sum of terms in segment n)
#               1 (first)
#                "T" (number of terms in segment n)
#               2 (second)
#      row   = 3 (count in both rows,    output both; default)
#               3 (first,  count in first only)
#                 1 (count in both rows,    output 1st)
#               4 (second, count in first only)
#                 2 (count in both rows,    output 2nd)
#      noeis = "030707|055187|217760 ..." (OEIS number without "A")
#                 5 (count in 1st row only, output 1st)
#      len   = length of sequence to be generated
#                 6 (count in 1st row only, output 2nd)
#      order = "io" (increasing order)  
#      noeis = "030707|055187|217760 ..." (OEIS number without "A", default "030707")
#               "do" (decreasing order)  
#      len   = length of sequence to be generated (default: 256)
#               "iz" (increasing order, complete with zero counts)
#      appear = "io" (increasing order; default)
#               "dz" (decreasing order, complete with zero counts)
#               "do" (decreasing order)
#               "fa" (order of first appearance)
#               "fa" (order of first appearance)
#      p1    = starting value for a(1): 0, 1, 3, 4, 5
#       first  = 0, 2 (first index in @segment)
#      p2    = 2nd parameter (for rule "P"): 1, 2, 3, 4  
#       offset = 0, 1 (index f 1st b-file entry, default: 1)
#      debug = 0 (none)
#      start  = starting value for a(1): 0, 1 (default), 3, 4, 5
#               1 (with segments)
#      parm  = 2nd parameter (for rule "P"): 1, 2, 3, 4
#      with0  =  0 (0 is not counted for neither attr nor noun)
#                1 (0 is counted for attr only)
#                2 (0 is counted for noun only)
#                3 (0 is counted for both attr and noun)
#      debug = 0 (none; default)
#               1 (with segments)
#--------------------------------------------------------
#--------------------------------------------------------
use strict;
use strict;


my $rule  = "A"; if (scalar(@ARGV) > 0) { $rule = shift(@ARGV); }
my $appear = "io";
my $row  = 0;    if (scalar(@ARGV) > 0) { $row  = shift(@ARGV); }
my $debug = 0;
my $noeis = "";   if (scalar(@ARGV) > 0) { $noeis = shift(@ARGV); }
my $first  = 0;
my $len  = 256; if (scalar(@ARGV) > 0) { $len  = shift(@ARGV); }
my $len   = 256;
my $order = "io"; if (scalar(@ARGV) > 0) { $order = shift(@ARGV); }
my $method = "A";
my $p1   = 1;    if (scalar(@ARGV) > 0) { $p1    = shift(@ARGV); }
my $noeis = "030707";
my $p2    = 0;   if (scalar(@ARGV) > 0) { $p2    = shift(@ARGV); }
my $offset = 1;
my $debug = 0;   if (scalar(@ARGV) > 0) { $debug = shift(@ARGV); }
my $parm  = 0;
my $row   = 3; # count in both rows,   output both; default
my $start  = 1;
my $with0  = 0;


# segments have 2 rows:
while (scalar(@ARGV) > 0) {
# row 1 = attrs
    my $opt = shift(@ARGV);
# row 2 = nouns
    if (0) {
my $attr;
    } elsif ($opt eq "-a") { $appear  = shift(@ARGV);
my $noun;
    } elsif ($opt eq "-d") { $debug  = shift(@ARGV);
my %nouns;
    } elsif ($opt eq "-f") { $first  = shift(@ARGV);
my %occrs = (); # first occurrences of attributes
    } elsif ($opt eq "-l") { $len    = shift(@ARGV);
my @seql = (); # sequence list
    } elsif ($opt eq "-m") { $method  = shift(@ARGV);
push(@seql, $p1, 1, $p1);
    } elsif ($opt eq "-n") { $noeis  = shift(@ARGV);
#            0  1  2  3
    } elsif ($opt eq "-o") { $offset = shift(@ARGV);
my $segno = 1;
    } elsif ($opt eq "-p") { $parm    = shift(@ARGV);
my $sseg  = 1;             # index of 1st element in segment
    } elsif ($opt eq "-r") { $row    = shift(@ARGV);
my $eseg  = scalar(@seql); # index of 1st element behind segment
    } elsif ($opt eq "-s") { $start  = shift(@ARGV);
my $inoun;
    } elsif ($opt eq "-w") { $with0  = shift(@ARGV);
my $sum;
    } else { die "invalid option \"$opt\"\n";
my $search = $p2; # for $rule =~ m{P}
    }
my $curmax = 0;
} # while ARGV
 
if ($debug == 99) {
print " [http://oeis.org/A$noeis A$noeis] $method $start $appear $row";
if ($offset != 1) { print " offset=$offset"; }
if ($first  != 0) { print " first=$first"; }
if ($parm  != 0) { print " parm=$parm"; }
if ($with0  != 0) { print " with0=$with0"; }
print "\n";
exit(0);
}
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)
     = localtime (time);
     = localtime (time);
Line 222: Line 282:
     , $year + 1900, $mon + 1, $mday, $hour, $min);
     , $year + 1900, $mon + 1, $mday, $hour, $min);
print <<"GFis";
print <<"GFis";
# http://oeis.org/A$noeis/b$noeis.txt: table n,a(n)
# http://oeis.org/A$noeis/b$noeis.txt: table n,a(n) for n=1..$len
# Generated by cumulcount.pl on $timestamp
# Generated on $timestamp by  
# perl cumulcount.pl -m $method -r $row -n $noeis -l $len -a $appear -f $first -o $offset -s $start -p $parm -w $with0
GFis
GFis
my $k = 1;
 
my $k2 = $k; # copy of k, running as if it were rule A   
my %inverse  = (); # inverse sequence
    if (0) {
my $curmax = $start - 1;
    } elsif ($rule =~ m{[ABIJKP]}i) {
my $segno = 0;
        if ($row <= 1) {
my @segment = ();
            &bfile($p1);
# $segment[i+0] = attribute, how often (i = 1, 3, 5 ..)
        }
# $segment[i+1] = noun, which number is counted,
        &bfile(1, $p1);
# always this order, increasing nouns, always complete with zero attributes
    } elsif ($rule =~ m{D}i) {
my @count;  # temporary copy of the attributes
        print "$k $p1\n"; $k ++;
my @app1st; # 1st appearance of a noun
    } elsif ($rule =~ m{N}i) {
my @seqlen = (1); # cumulative length of sequence so far, indexed with $segno
        print "$k 1\n"  ; $k ++;
my $attr;  # attribute, count of nouns
    } elsif ($rule =~ m{T}i) {
my $noun;  # the numbers to be counted
        print "$k $p1\n"; $k ++;
my $iseg;   # index in @segment
    } else {
 
         die "invalid rule \"$rule\"\n";
# first segment
$noun = 0;
while ($noun < $start) { # fill before $start
    push(@segment, 0, $noun);
    $noun ++;
} # while filling
push(@segment, 1, $start);
 
# first b-file entry
my $k = $offset;
my $k2 = $k; # copy of k, running as if it were rule A
if (0) {
} elsif ($method =~ m{[ABIJKP]}i) {
    if (($row & 1) != 0) {
         &bfile($start);
     }
     }
} elsif ($method =~ m{[D]}i) {
    print "$k $start\n"; $k ++;
} elsif ($method =~ m{[N]}i) {
    # print "$k 1\n"  ; $k ++;
    $seqlen[0] = 0;
} elsif ($method =~ m{[S]}i) {
} elsif ($method =~ m{[T]}i) {
if ($noeis eq "240508") {
    print "$k 1\n"; $k ++;
}
} else {
    die "invalid method \"$method\" at bf(1)\n";
}
push(@app1st, $start);
$segno ++;
$segno ++;
while ($k <= $len) { # fill b-file
 
     my %nouns = ();
# main loop
     $inoun = $sseg;
while ($k <= $len and $segno <= $len) { # compute new segment from current
     while ($inoun < $eseg) { # count the present nouns (row 2)
    &advance();
         my $attr = $seql[$inoun + 0];
    $segno ++;
        my $noun = $seql[$inoun + 1];
} # while b-file
        if (1) {
 
             $sum = $attr + &count(2, $noun, $sseg, $eseg);
if ($method =~ m{I}i) { # special treatment of the inverse
            $nouns{$noun} = $sum;
     $k = 1;
            push(@seql, $sum, $noun);
    foreach my $attr (sort {$a <=> $b} (keys(%inverse))) {
        last if $attr > $k; # must be monotone
        print "$k $inverse{$attr}\n"; $k ++;
    } # foreach
} # method I
#----------------
sub advance { # count between 0 and $nmax, and store in @counts
    my $amax = -1; # $nmax is the current segment length / 2
    if (1) { # compute length of current segment
        $seqlen[$segno] = 0; # number of elements in segment
        for ($iseg = $first; $iseg < scalar(@segment); $iseg += 2) { # increment for valid entries
            $attr = $segment[$iseg + 0];
            $noun = $segment[$iseg + 1];
            if ($attr != 0 or ($with0 & 1) != 0) {
                $seqlen[$segno] ++;
            }
        } # while incrementing
     } # segment length
   
if ($debug >= 1) {
    print "seg#$segno:";
     for ($iseg = $first; $iseg < scalar(@segment); $iseg += 2) { # print the elements of this segment
        $attr = $segment[$iseg + 0];
        $noun = $segment[$iseg + 1];
        print " $attr.$noun";
    } # while copying
    print "  seqlen=$seqlen[$segno]\n";
    print "app1st: " . join(" ", @app1st) . "\n";
} # debug
 
    # now the b-file entries
    if (0) {
    } elsif ($method =~ m{[ABIJKP]}i) { # first or second row or both
        if (0) {
         } elsif ($appear eq "fa") { # order of first appearance
            for (my $iapp = 0; $iapp < scalar(@app1st)    ; $iapp ++) {
                $iseg = $app1st[$iapp] << 1;
                $attr = $segment[$iseg + 0];
                $noun = $segment[$iseg + 1];
                if ($attr != 0 or ($with0 & 1) != 0) {
                    &bfile($attr, $noun); # for method I: store %inverse only
                }
            } # for
        } elsif ($appear eq "do") { # decreasing order
             for ($iseg = scalar(@segment) - 2; $iseg >= $first; $iseg -= 2) {
                $attr = $segment[$iseg + 0];
                $noun = $segment[$iseg + 1];
                if ($attr != 0 or ($with0 & 1) != 0) {
                    &bfile($attr, $noun); # for method I: store %inverse only
                }
            } # for
        } elsif ($appear eq "io") { # increasing order
            for ($iseg = $first; $iseg < scalar(@segment)     ; $iseg += 2) {
                $attr = $segment[$iseg + 0];
                $noun = $segment[$iseg + 1];
                if ($attr != 0 or ($with0 & 1) != 0) {
                    &bfile($attr, $noun); # for method I: store %inverse only
                }
            } # for
        } else {
            die "invalid parameter op=\"$appear\"\n";
         }
         }
        $inoun += 2;
    } # while $inoun
    $inoun = $sseg;
    my $start_new = scalar(@seql);
    while ($inoun < $eseg) { # count the new attributes (row 1)
        my $attr = $seql[$inoun + 0];
        if (! defined($nouns{$attr})) {
            $sum =        &count(1, $attr, $sseg, $eseg);
            $nouns{$attr} = $sum;
            push(@seql, $sum, $attr);
        }
        $inoun += 2;
    } # while $inoun


    if (0) {
     } elsif ($method =~ m{[D]}i) { # new terms (for $appear eq "fa")
     } elsif ($order eq "fa") { # order of first appearance
            if ($debug >= 1) {
        # already stored in @seql
                print "range " . ($seqlen[$segno - 1]) . ".." . ($seqlen[$segno] - 1) . "\n";
    } elsif ($order eq "do") { # decreasing order
             }
        $inoun = $eseg;
            for (my $iapp = $seqlen[$segno - 1]; $iapp < $seqlen[$segno]; $iapp ++) {
        foreach $noun (sort {$b <=> $a} (keys(%nouns))) { # reverse sort
                $iseg = $app1st[$iapp] << 1;
            $seql[$inoun + 0] = $nouns{$noun};
                $attr = $segment[$iseg + 0];
            $seql[$inoun + 1] = $noun;
                 $noun = $segment[$iseg + 1];
             $inoun += 2;
                 if ($attr != 0 or ($with0 & 1) != 0) {
        } # foreach
                    &bfile($attr, $noun);  
    } elsif ($order eq "io") { # increasing order
                }
        $inoun = $eseg;
             } # for
        foreach $noun (sort {$a <=> $b} (keys(%nouns))) {
 
            $seql[$inoun + 0] = $nouns{$noun};
     } elsif ($method =~ m{[N]}i) { # no. of new terms in segment
            $seql[$inoun + 1] = $noun;
        &bfile($seqlen[$segno] - $seqlen[$segno - 1]);
            $inoun += 2;
 
        } # foreach
    } elsif ($method =~ m{[T]}i) { # no. of terms in segment
    } elsif ($order eq "dz") { # decreasing order (complete) - insert 0 counts
         &bfile($seqlen[$segno]);
        my $cnoun = 0; # avoids "while" in first "foreach"
        $inoun = $eseg;
        foreach $noun (sort {$b <=> $a} (keys(%nouns))) { # reverse sort
            while ($cnoun > $noun) {
                $seql[$inoun + 0] = 0;
                 $seql[$inoun + 1] = $cnoun;
                 $cnoun --;
                $inoun += 2;
            } # while $cnoun
            $seql[$inoun + 0] = $nouns{$noun};
            $seql[$inoun + 1] = $noun;
            $inoun += 2;
             $cnoun = $noun - 1;
        } # foreach
     } elsif ($order eq "iz") { # increasing order (complete) - insert 0 counts
        my $cnoun = $seql[$sseg + 1];
        $inoun = $eseg;
        foreach $noun (sort {$a <=> $b} (keys(%nouns))) {
            while ($cnoun < $noun) {
                $seql[$inoun + 0] = 0;
                $seql[$inoun + 1] = $cnoun;
                $cnoun ++;
                $inoun += 2;
            } # while $cnoun
            $seql[$inoun + 0] = $nouns{$noun};
            $seql[$inoun + 1] = $noun;
            $inoun += 2;
            $cnoun = $noun + 1;
        } # foreach
    } else {
         die "invalid paramter op=\"$order\"\n";
     }
     }
    #--------
    # compute following segment
    for ($iseg = $first; $iseg < scalar(@segment) ; $iseg += 2) { # copy attr and determine maximum attr
        $attr = $segment[$iseg + 0];
        $noun = $segment[$iseg + 1];
        $count[$noun] = $attr; # copy old attr
        if ($attr > $amax) {
            $amax = $attr;
        }
    } # while copying
    my $last_noun = $noun;


     if ($debug >= 1) {
     $noun = $last_noun + 1;
        print "# segment $segno:";
    while ($noun <= $amax) { # insert nouns with 0 attributes
        $inoun = $eseg;
        $count[$noun ++] = 0;
        while ($inoun < scalar(@seql)) { #
    } # while inserting
            my $attr = $seql[$inoun + 0];
    my $ff_count = $noun;
            my $noun = $seql[$inoun + 1];
            print " $attr.$noun";
            $inoun += 2;
        } # while $inoun
        print "\n";
    } # debug


    # now add all (or row1, row2) to @count
     if (0) {
     if (0) {
     } elsif ($rule =~ m{[ABIJKP]}i) { # first or second row or both
     } elsif ($appear eq "fa") {
         $inoun = $eseg;
         for (my $iapp = 0; $iapp < $seqlen[$segno]; $iapp ++) {
        while ($inoun < scalar(@seql)) {
             &assemble($app1st[$iapp] << 1);
            my $attr = $seql[$inoun + 0];
         } # for $iapp
            my $noun = $seql[$inoun + 1];
     } else { # "io", "do"
             &bfile($attr, $noun);
         for ($iseg = $first; $iseg < scalar(@segment); $iseg += 2) { # add
            $inoun += 2;
            &assemble($iseg);
         } # while $inoun
         } # for $iseg
     } elsif ($rule =~ m{D}i) { # new terms
         if (0 and $noeis eq "055186") {
         $inoun = $start_new;
         } # 055186
        while ($inoun < scalar(@seql)) {
     } # "io", "do"
            my $attr = $seql[$inoun + 0];
            my $noun = $seql[$inoun + 1];
            &bfile($noun);
            $inoun += 2;
        } # while $inoun
    } elsif ($rule =~ m{N}i) { # no. of new terms in segment
        my $no_new = (scalar(@seql) - $start_new) >> 1;
         &bfile($no_new);
    } elsif ($rule =~ m{T}i) { # no. of terms in segemnt
         my $no_new = (scalar(@seql) - $eseg) >> 1;
         &bfile($no_new);
    }
     $sseg = $eseg;
    $eseg = scalar(@seql);
    $segno ++;
} # while b-file


if ($rule =~ m{I}i) { # special treatment of the inverse
    # copy it back to the segment
    $k = 1;
    $iseg = 0;
     foreach $attr (sort {$a <=> $b} (keys(%occrs))) {
    $noun = 0;
        # last if $attr > $k; # must be monotone
    while ($noun < $ff_count) { # add
        print "$k $occrs{$attr}\n"; $k ++;
        $segment[$iseg + 0] = $count[$noun];
    } # foreach
        $segment[$iseg + 1] = $noun;
} # rule I
        $iseg += 2;
        $noun ++;
     } # while copying back
} # sub advance
#----------------
sub assemble {
            my ($iseg) = @_;
            $attr = $segment[$iseg + 0];
            $noun = $segment[$iseg + 1];
            if (($attr != 0 or ($with0 & 1) != 0) and ($row != 6)) {
                if ($count[$attr] == 0) { # appears for the first time
                    push(@app1st, $attr);
                }
                $count[$attr] ++;
            }
            if (($attr != 0 or ($with0 & 1) != 0) and ($noun != 0 or ($with0 & 2) != 0) and ($row != 5)) {
                $count[$noun] ++;
            }
            if ($attr == 0 and $noeis eq "079668") {
            $first = 0;
            }
} # assemble
#----------------
#----------------
sub bfile {
sub bfile {
    if ($k > $len) {
        return;
    }
     my ($attr, $noun) = @_;
     my ($attr, $noun) = @_;
     if (0) {
     if (0) {
     } elsif ($rule =~ m{P}i) {
     } elsif ($method =~ m{P}i) {
         if ($attr == $search) {
         if ($attr == $parm) {
             print "$k $k2\n"; $k ++;
             print "$k $k2\n"; $k ++;
         }
         }
         $k2 ++;
         $k2 ++;
     } elsif ($rule =~ m{I}i) {
     } elsif ($method =~ m{I}i) {
         if (! defined($occrs{$attr})) {
         if (! defined($inverse{$attr})) {
             # assume that rule "I" is called with row=1 only !
             # assume that method "I" is called with row=1 only !
             $occrs{$attr} = $k;
             $inverse{$attr} = $k;
             if ($debug >= 1) {
             if ($debug >= 1) {
                 print "# stored $k in occrs{$attr}\n";
                 print "# stored $k in inverse{$attr}\n";
             }
             }
         }
         }
         $k ++;
         $k ++;
     } elsif ($rule =~ m{J}i) {
     } elsif ($method =~ m{J}i) {
         if ($attr > $curmax) {
         if ($attr > $curmax) {
             print "$k $attr\n"; $k ++;
             print "$k $attr\n"; $k ++;
Line 391: Line 510:
         }
         }
         $k2 ++;
         $k2 ++;
     } elsif ($rule =~ m{k}i) {
     } elsif ($method =~ m{K}i) {
         if ($attr > $curmax) {
         if ($attr > $curmax) {
             print "$k $k2\n"; $k ++;
             print "$k $k2\n"; $k ++;
Line 398: Line 517:
         $k2 ++;
         $k2 ++;
     } elsif (scalar(@_) == 1) {
     } elsif (scalar(@_) == 1) {
        print "$k $attr\n"; $k ++;
    } elsif ($rule =~ m{[DNT]}i) {
        # c.f. above
    } elsif ($rule =~ m{[A]}i) { # attribute before noun
        if (0) {
        } elsif ($row == 0) {
             print "$k $attr\n"; $k ++;
             print "$k $attr\n"; $k ++;
             print "$k $noun\n"; $k ++;
    } elsif ($method =~ m{N}i) {
        } elsif ($row == 1) {
             print "$k $attr\n"; $k ++;
    } elsif ($method =~ m{T}i) {
             print "$k $attr\n"; $k ++;
             print "$k $attr\n"; $k ++;
         } elsif ($row == 2) {
    } elsif ($method =~ m{[AD]}i) { # attribute before noun
             print "$k $noun\n"; $k ++;
        if (($row & 1) != 0) {
            print "$k $attr\n"; $k ++;
         }
        if (($row & 2) != 0 and $k <= $len) {
            print "$k $noun\n"; $k ++;
        }
    } elsif ($method =~ m{[BD]}i) { # noun before attribute
        if (($row & 1) != 0) {  
             print "$k $noun\n"; $k ++;  
         }
         }
    } elsif ($rule =~ m{B}i) { # noun before attribute
         if (($row & 2) != 0 and $k <= $len) {  
         if (0) {
            print "$k $attr\n"; $k ++;  
        } elsif ($row == 0) {
        print "$k $noun\n"; $k ++;
        print "$k $attr\n"; $k ++;
        } elsif ($row == 1) {
        print "$k $noun\n"; $k ++;
        } elsif ($row == 2) {
        print "$k $attr\n"; $k ++;
         }
         }
     } else {
     } else {
         die "invalid rule \"$rule\"\n";
         die "invalid method \"$method\" in sub bfile\n";
     }
     }
} # bfile
} # bfile
#----------------
sub count {
    my ($row, $value, $sseg, $eseg) = @_;
    my $sum = 0;
    if (($rule !~ m{C}i) or ($row == 1)) { #
        my $iseg = $sseg;
        while ($iseg < $eseg) {
            if ($seql[$iseg] == $value) { # attr or noun
                $sum ++;
            }
            $iseg ++;
            if ($rule eq "C") {
                $iseg ++;
            }
        } # while $iseg
    } # if cond
    return $sum;
} # sub count
__DATA__
__DATA__
Rule A, A055187:
Rule A, A055187:
Line 464: Line 561:


--------------------
--------------------
Rule C; A030717 (row 1), A030718 (row2) - zeroes are inconsistent
A030717 (row 1), A030718 (row2) - zeroes are inconsistent
1 | 1 | 2 | 2, 1 | 3, 2 | 3, 3, 1 | 4, 3, 3 | 4, 3, 5, 1 | 5, 3, 6, 2, 1
1 | 1 | 2 | 2, 1 | 3, 2 | 3, 3, 1 | 4, 3, 3 | 4, 3, 5, 1 | 5, 3, 6, 2, 1
   | 1 | 1 | 1, 2 | 1, 2 | 1, 2, 3 | 1, 2, 3 | 1, 2, 3, 4 | 1, 2, 3, 4, 5
   | 1 | 1 | 1, 2 | 1, 2 | 1, 2, 3 | 1, 2, 3 | 1, 2, 3, 4 | 1, 2, 3, 4, 5
Line 482: Line 579:
   | 17, 14, 23, 5, 5
   | 17, 14, 23, 5, 5
   |  1,  2,  3  ...
   |  1,  2,  3  ...
# https://oeis.org/wiki/User:Georg_Fischer Feb. 24, 2018
#----------------------------------------------
A051120 ,1|1,1|3,1|1,3,4,1|1,4,2,3,6,1|1,6,2,4,3,3,1,2,8,1|1,8,2,6,3,4,5,3,3,2,11,1|1,11,2,8,3,6,1,5,4,4,8,3,5,2,13,1|1,13,2,11,4,8,4,6,3,5,6,4,10,3,7,2,16,1,1,16,2,13,3,11,1,10,5,8,1,7,6,6,4,5,9,4,12,3,9,2,18,1,
A055187 ,1|1,1|3,1|4,1,1,3|6,1,2,3,1,4|8,1,1,2,3,3,2,4,1,6|11,1,3,2,5,3,3,4,2,6,1,8|13,1,5,2,8,3,4,4,1,5,3,6,2,8,1,11|16,1,7,2,10,3,6,4,3,5,4,6,4,8,2,11,1,13,18,1,9,2,12,3,9,4,4,5,6,6,1,7,5,8,1,10,3,11,2,13,1,16,22,1,
 
</nowiki>
</nowiki>
</pre>
</pre>
Line 499: Line 599:
# http://faculty.evansville.edu/ck6/integer/unsolved.html, Problem 4
# http://faculty.evansville.edu/ck6/integer/unsolved.html, Problem 4
# @(#) $Id$
# @(#) $Id$
# 2018-04-20, Georg Fischer
# 2018-04-27, Georg Fischer (previosu version in makefile2)
#
#
# C.f. listing.tmp (produced by target "listing", below)
# C.f. listing.tmp (produced by target "listing", below)
Line 506: Line 606:
#---------------------------------
#---------------------------------
TARGET=cumulcount
TARGET=cumulcount
SIL=
LIMIT=100
LIMIT=100
P2=0
APPEAR=io
DEBUG=0
FIRST=0
LEN=$(LIMIT)
OFFSET=1
PARM=0
ROW=3
START=1
WITH0=0
 
all:    0307nn 0551nn misc
quick:  030707 030708 030717 030718 055168 055186 055187 misc
0307nn: 0307io 0307do
0551nn: 05516n 05518n
#----------
misc:  051120 \
079668 079686 \
126027 253170 \
174382 240508\
2177nn
051120: # A055187, but decreasing
make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1 OFFSET=0 FIRST=2
 
079668:
make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 WITH0=3 FIRST=2
079686:
make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=1000    APPEAR=do START=0 WITH0=3 OFFSET=0
 
126027: # row lengths of A030717; trick with OFFSET 2: 1st entry is missing
make $(SIL) $(TARGET) METHOD=T  ROW=5 NOEIS=$@ LEN=24      APPEAR=io START=1 WITH0=3
253170: # row sums    of A030717
# nyi
174382: # like 030717
make $(SIL) $(TARGET) METHOD=A  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=0 WITH0=3
240508: # row lengths in A174382; 1st two lines wrong
make $(SIL) $(TARGET) METHOD=T  ROW=5 NOEIS=$@ LEN=24      APPEAR=io START=0 WITH0=3


all: 0307io 0307do 05516n 05518n 2177nn
2177_list:
grep -aE "^A2177" ../names
2177nn: 217760 217780 # ok
217760: # c.f. 055186
make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=10000    APPEAR=fa START=0 WITH0=2
217780: # c.f. 055187
make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=10000    APPEAR=fa START=1
#----------
#----------
0307_list:
0307_list:
grep -aE "^A0307" ../names
grep -aE "^A0307" ../names
 
0307_compare:
diff -w -y --width=32 --suppress-common-lines b030709.txt b030759.txt || : 
diff -w -y --width=32 --suppress-common-lines b030729.txt b030779.txt || : 
diff -w -y --width=32 --suppress-common-lines b030739.txt b030769.txt || : 
diff -w -y --width=32 --suppress-common-lines b030749.txt b030799.txt || : 
diff -w -y --width=32 --suppress-common-lines b030711.txt b030761.txt || : 
0307io: 03070n 03071n 03072n 03073n 03074n
0307io: 03070n 03071n 03072n 03073n 03074n
03070n: 030707 030708 030709 030710 030711 030712 030713 030714 030715 030716
03070n: 030707 030708 030709 030710 030711 030712 030713 030714 030715 030716
Line 528: Line 677:


030707:
030707:
make $(TARGET) RULE=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1
make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030708:
030708:
make $(TARGET) RULE=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1
make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030709:
030709:
make $(TARGET) RULE=T  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1
make $(SIL) $(TARGET) METHOD=T  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030710:
030710:
make $(TARGET) RULE=I  ROW=1 NOEIS=$@ LEN=2000    ORD=io P1=1
make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000    APPEAR=io START=1
030711:
030711:
make $(TARGET) RULE=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1
make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030712:
030712:
make $(TARGET) RULE=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1
make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030713:
030713:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1 P2=1
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=1
030714:
030714:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1 P2=2
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=2
030715:
030715:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1 P2=3
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=3
030716:
030716:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1 P2=4
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=4


030717:
030717:
make $(TARGET) RULE=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1
make $(SIL) $(TARGET) METHOD=A  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 WITH0=3
030718:
030718:
make $(TARGET) RULE=A  ROW=4 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1
make $(SIL) $(TARGET) METHOD=A  ROW=6 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030719:
030719:
make $(TARGET) RULE=T  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1
make $(SIL) $(TARGET) METHOD=T  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030720:
030720:
make $(TARGET) RULE=I  ROW=3 NOEIS=$@ LEN=2000    ORD=io P1=1
make $(SIL) $(TARGET) METHOD=I  ROW=5 NOEIS=$@ LEN=2000    APPEAR=io START=1
030721:
030721:
make $(TARGET) RULE=J  ROW=3 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1
make $(SIL) $(TARGET) METHOD=J  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030722:
030722:
make $(TARGET) RULE=K  ROW=3 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1
make $(SIL) $(TARGET) METHOD=K  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030723:
030723:
make $(TARGET) RULE=P  ROW=3 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1 P2=1
make $(SIL) $(TARGET) METHOD=P  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=1
030724:
030724:
make $(TARGET) RULE=P  ROW=3 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1 P2=2
make $(SIL) $(TARGET) METHOD=P  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=2
030725:
030725:
make $(TARGET) RULE=P  ROW=3 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1 P2=3
make $(SIL) $(TARGET) METHOD=P  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=3
030726:
030726:
make $(TARGET) RULE=P  ROW=3 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1 P2=4
make $(SIL) $(TARGET) METHOD=P  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=4


030727:
030727:
make $(TARGET) RULE=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=3
make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3
030728:
030728:
make $(TARGET) RULE=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=3
make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3
030729:
030729:
make $(TARGET) RULE=T  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=3
make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3
030730:
030730:
make $(TARGET) RULE=I  ROW=1 NOEIS=$@ LEN=2000    ORD=io P1=3
make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000    APPEAR=io START=3
030731:
030731:
make $(TARGET) RULE=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=3
make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3
030732:
030732:
make $(TARGET) RULE=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=3
make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3
030733:
030733:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=3 P2=1
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3 PARM=1
030734:
030734:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=3 P2=2
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3 PARM=2
030735:
030735:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=3 P2=3
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3 PARM=3
030736:
030736:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=3 P2=4
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3 PARM=4


030737:
030737:
make $(TARGET) RULE=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=2
make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2
030738:
030738:
make $(TARGET) RULE=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=2
make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2
030739:
030739:
make $(TARGET) RULE=T  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=2
make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2
030740:
030740:
make $(TARGET) RULE=I  ROW=1 NOEIS=$@ LEN=2000    ORD=io P1=2
make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000    APPEAR=io START=2
030741:
030741:
make $(TARGET) RULE=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=2
make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2
030742:
030742:
make $(TARGET) RULE=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=2
make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2
030743:
030743:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=2 P2=1
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2 PARM=1
030744:
030744:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=2 P2=2
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2 PARM=2
030745:
030745:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=2 P2=3
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2 PARM=3
030746:
030746:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=2 P2=4
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2 PARM=4


030747:
030747:
make $(TARGET) RULE=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=4
make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4
030748:
030748:
make $(TARGET) RULE=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=4
make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4
030749:
030749:
make $(TARGET) RULE=T  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=4
make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4
030750:
030750:
make $(TARGET) RULE=I  ROW=1 NOEIS=$@ LEN=2000    ORD=io P1=4
make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000    APPEAR=io START=4
030751:
030751:
make $(TARGET) RULE=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=4
make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4
030752:
030752:
make $(TARGET) RULE=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=4
make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4
030753:
030753:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=4 P2=1
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4 PARM=1
030754:
030754:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=4 P2=2
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4 PARM=2
030755:
030755:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=4 P2=3
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4 PARM=3
030756:
030756:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=4 P2=4
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4 PARM=4


030757:
030757:
make $(TARGET) RULE=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=1
make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1
030758:
030758:
make $(TARGET) RULE=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=1
make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1
030759:
030759:
make $(TARGET) RULE=T  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=1
make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1
030760:
030760:
make $(TARGET) RULE=I  ROW=1 NOEIS=$@ LEN=2000    ORD=do P1=1
make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000    APPEAR=do START=1
030761:
030761:
make $(TARGET) RULE=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=1
make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1
030762:
030762:
make $(TARGET) RULE=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=1
make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1
030763:
030763:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=1 P2=1
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1 PARM=1
030764:
030764:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=1 P2=2
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1 PARM=2
030765:
030765:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=1 P2=3
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1 PARM=3
030766:
030766:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=1 P2=4
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1 PARM=4


030767:
030767:
make $(TARGET) RULE=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=2
make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2
030768:
030768:
make $(TARGET) RULE=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=2
make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2
030769:
030769:
make $(TARGET) RULE=T  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=2
make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2
030770:
030770:
make $(TARGET) RULE=I  ROW=1 NOEIS=$@ LEN=2000    ORD=do P1=2
make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000    APPEAR=do START=2
030771:
030771:
make $(TARGET) RULE=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=2
make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2
030772:
030772:
make $(TARGET) RULE=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=2
make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2
030773:
030773:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=2 P2=1
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2 PARM=1
030774:
030774:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=2 P2=2
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2 PARM=2
030775:
030775:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=2 P2=3
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2 PARM=3
030776:
030776:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=2 P2=4
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2 PARM=4


030777:
030777:
make $(TARGET) RULE=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=3
make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3
030778:
030778:
make $(TARGET) RULE=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=3
make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3
030779:
030779:
make $(TARGET) RULE=T  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=3
make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3
030780:
030780:
make $(TARGET) RULE=I  ROW=1 NOEIS=$@ LEN=2000    ORD=do P1=3
make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000    APPEAR=do START=3
030781:
030781:
make $(TARGET) RULE=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=3
make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3
030782:
030782:
make $(TARGET) RULE=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=3
make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3
030783:
030783:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=3 P2=1
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3 PARM=1
030784:
030784:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=3 P2=2
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3 PARM=2
030785:
030785:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=3 P2=3
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3 PARM=3
030786:
030786:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=3 P2=4
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3 PARM=4


030787:
030787:
make $(TARGET) RULE=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=4
make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4
030788:
030788:
make $(TARGET) RULE=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=4
make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4
030789:
030789:
make $(TARGET) RULE=T  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=4
make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4
030790:
030790:
make $(TARGET) RULE=I  ROW=1 NOEIS=$@ LEN=2000    ORD=do P1=4
make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000    APPEAR=do START=4
030791:
030791:
make $(TARGET) RULE=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=4
make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4
030792:
030792:
make $(TARGET) RULE=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=4
make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4
030793:
030793:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=4 P2=1
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4 PARM=1
030794:
030794:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=4 P2=2
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4 PARM=2
030795:
030795:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=4 P2=3
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4 PARM=3
030796:
030796:
make $(TARGET) RULE=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) ORD=do P1=4 P2=4
make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4 PARM=4
 
#----------
#----------
0551_list:
0551_list:
Line 726: Line 874:
055183 055184 055185
055183 055184 055185
055168:
055168:
make $(TARGET) RULE=B  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=0
make $(SIL) $(TARGET) METHOD=B  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=0 WITH0=2
055169:
055169:
make $(TARGET) RULE=N  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=0
make $(SIL) $(TARGET) METHOD=N  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=0 WITH0=2
055170:
055170:
make $(TARGET) RULE=D  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=0
make $(SIL) $(TARGET) METHOD=D  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=0 WITH0=2
055171:
055171:
make $(TARGET) RULE=B  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=1
make $(SIL) $(TARGET) METHOD=B  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=1
055172:
055172:
make $(TARGET) RULE=N  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=1
make $(SIL) $(TARGET) METHOD=N  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=1
055173:
055173:
make $(TARGET) RULE=D  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=1
make $(SIL) $(TARGET) METHOD=D  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=1
055174:
055174:
make $(TARGET) RULE=B  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=2
make $(SIL) $(TARGET) METHOD=B  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=2
055175:
055175:
make $(TARGET) RULE=N  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=2
make $(SIL) $(TARGET) METHOD=N  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=2
055176:
055176:
make $(TARGET) RULE=D  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=2
make $(SIL) $(TARGET) METHOD=D  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=2
055177:
055177:
make $(TARGET) RULE=B  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=3
make $(SIL) $(TARGET) METHOD=B  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=3
055178:
055178:
make $(TARGET) RULE=N  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=3
make $(SIL) $(TARGET) METHOD=N  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=3
055179:
055179:
make $(TARGET) RULE=D  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=3
make $(SIL) $(TARGET) METHOD=D  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=3
055180:
055180:
make $(TARGET) RULE=B  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=4
make $(SIL) $(TARGET) METHOD=B  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=4
055181:
055181:
make $(TARGET) RULE=N  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=4
make $(SIL) $(TARGET) METHOD=N  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=4
055182:
055182:
make $(TARGET) RULE=D  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=4
make $(SIL) $(TARGET) METHOD=D  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=4
055183:
055183:
make $(TARGET) RULE=B  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=5
make $(SIL) $(TARGET) METHOD=B  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=5
055184:
055184:
make $(TARGET) RULE=N  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=5
make $(SIL) $(TARGET) METHOD=N  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=5
055185:
055185:
make $(TARGET) RULE=D  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=5
make $(SIL) $(TARGET) METHOD=D  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=5
#-----
#-----
05518n: 055186 055187 \
05518n: 055186 055187 \
055188 055189 055190 055191
055188 055189 055190 055191
055186:
055186:
make $(TARGET) RULE=A  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=iz P1=0
make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=0 WITH0=3
055187:
055187:
make $(TARGET) RULE=A  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=io P1=1
make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 WITH0=2
055188:
055188:
make $(TARGET) RULE=A  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=2
make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=2
055189:
055189:
make $(TARGET) RULE=A  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=3
make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=3
055190:
055190:
make $(TARGET) RULE=A  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=4
make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=4
055191:
055191:
make $(TARGET) RULE=A  ROW=0 NOEIS=$@ LEN=$(LIMIT) ORD=fa P1=5
make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=5
#----------
2177_list:
grep -aE "^A2177" ../names
2177nn: 217760 217780 # ok
217760: # c.f. 055186
make $(TARGET) RULE=A  ROW=0 NOEIS=$@ LEN=10000    ORD=fa P1=0
217780: # c.f. 055187
make $(TARGET) RULE=A  ROW=0 NOEIS=$@ LEN=10000    ORD=fa P1=1
#---------------------------------------------------------------
#---------------------------------------------------------------
cumulcount:
cumulcount:
# -------------------------------------------------------
# -------------------------------------------------------
test -s b$(NOEIS).txt || wget http://oeis.org/A$(NOEIS)/b$(NOEIS).txt
test -s b$(NOEIS).txt || wget http://oeis.org/A$(NOEIS)/b$(NOEIS).txt
perl $(TARGET).pl $(RULE) $(ROW) $(NOEIS) $(LEN) $(ORD) $(P1) $(P2) > A$(NOEIS).pn.tmp
grep -E "^[0-9]" b$(NOEIS).txt    | head -n $(LEN)                          > bf.tmp
grep -E "^[0-9]" b$(NOEIS).txt    | head -n $(LEN)                          > bf.tmp
# wc -l bf.tmp
perl cumulcount.pl -m $(METHOD) -r $(ROW) -n $(NOEIS) -l $(LEN) -a $(APPEAR) -f $(FIRST) -o $(OFFSET) -s $(START) -p $(PARM) -w $(WITH0) -d $(DEBUG) > A$(NOEIS).pn.tmp
grep -E "^[0-9]" A$(NOEIS).pn.tmp | head -n `wc -l bf.tmp | cut -d " " -f 1` > pn.tmp
grep -E "^[0-9]" A$(NOEIS).pn.tmp | head -n `wc -l bf.tmp | cut -d " " -f 1` > pn.tmp
# diff -w -y                        --width=32  bf.tmp pn.tmp || :
# diff -w -y                        --width=32  bf.tmp pn.tmp || :
diff -w -y --suppress-common-lines --width=32  bf.tmp pn.tmp || :
diff -w -y --suppress-common-lines --width=32  bf.tmp pn.tmp | head -n 8
#
debug:
# -------------------------------------------------------
perl cumulcount.pl -m $(METHOD) -r $(ROW) -n $(NOEIS) -l $(LEN) -a $(APPEAR) -f $(FIRST) -o $(OFFSET) -s $(START) -p $(PARM) -w $(WITH0) -d 1 | less
#--------
#--------
list1:
list1:
echo [https://oeis.org/A$(NOEIS) A$(NOEIS)] Rule $(RULE).$(ROW) $(ORD) $(P1) $(P2) " "\
perl cumulcount.pl -m $(METHOD) -r $(ROW) -n $(NOEIS) -l $(LEN) -a $(APPEAR) -f $(FIRST) -o $(OFFSET) -s $(START) -p $(PARM) -w $(WITH0) -d 99
`wc -l b$(NOEIS).txt | cut -d " " -f 1`
# echo " " [https://oeis.org/A$(NOEIS) A$(NOEIS)] Rule $(RULE).$(ROW) $(ORD) $(P1) $(P2) " "\
# `wc -l b$(NOEIS).txt | cut -d " " -f 1`
listing:
listing:
make -s all TARGET=list1 | sort \
make -s all TARGET=list1 | sort \
| sed -e "s/\.0/  /" -e "s/ 0 0/.0  /" -e "s/ 0/  /" -e "s/\.0/ 0/" \
| tee listing.tmp
| tee listing.tmp
wc -l listing.tmp
wc -l listing.tmp
#----
#--------
# e.g. https://oeis.org/search?q=id:A257908&fmt=text
intern1:
test -s A$(NOEIS).int || wget -O A$(NOEIS).int "http://oeis.org/search?q=id:A$(NOEIS)\&fmt=text"
internal:
make $(SIL) all TARGET=intern1
</nowiki>
</nowiki>
</pre>
</pre>
== Results and Problems ==
The makefile currently generates and compares all 116 sequences in the list. Only a few problems were found:
# [https://oeis.org/A030717 A030717] (row 1)  does not correspond with the derived sequences and [https://oeis.org/A030718 A030718] (row 2) and A030719-A030726. A030717 initially had no zero terms, but in 2014 the description was changed, and the b-file now has zero terms. This should be changed back.
# [https://oeis.org/A030740 A030740] (inverse) has a strange <code>Offset 2,1</code> which should be 1,1 IMHO as for the similiar [https://oeis.org/A030730 A030730], [https://oeis.org/A030750 A030750]. In the description there is a typo <code>j'2</code>.

Latest revision as of 17:25, 29 December 2021

Clark Kimberling defined - for example - in A217760:

Write 0 followed by segments defined inductively as follows: each segment
tells how many times each previously written integer occurs, in the order
of first occurrence.  This is Method A (adjective-before-noun pairs); for
Method B (noun-before-adjective), see A055168. 
Example:
Start with 0, followed by the adjective-noun pair 1,0; followed by
adjective-noun pairs 2,0 then 1,1; etc. Writing the pairs vertically,
the initial segments are
0.|.1.|.2 1.|.3 3 1.|.4 5 2 2.|.5 6 5 3 1 1.|.6 9 6 5 2 4 1.|.7 11 8 6 4 6 4 1
..|.0.|.0 1.|.0 1 2.|.0 1 2 3.|.0 1 2 3 4 5.|.0 1 2 3 4 5 6.|.0 1  2 3 4 5 6 9

Depending on the starting value s(1), with variations of the rules and derivations, there are more than 120 related sequences in the OEIS.

Results and Problems

A Perl program and a Unix makefile were written in order to evaluate these sequences. Only a few problems were found:

  1. The treatment of zero attributes and noun zero is not always clearly described, and the methods differ considerably with this respect.
  2. Most b-files are rather short, though some sequences have quite a number of terms in common (e.g. 61, 82) before they start to differ.
  3. A030717 (row 1) does not correspond with the derived sequences A030718 (row 2) and A030719-A030726. A030717 initially had no zero terms, but in 2014 the description was changed, and the b-file now has zero terms. This should be changed back.
  4. A030740 (inverse) has a strange OFFSET 2,1 which should be 1,1 IMHO as for the similiar A030730, A030750. In the description there is a typo j'2.
  5. A055186 should not carry KEYWORD base.
  6. In the example for A055168, the last 3 should be a 4.

List of cumulative counting sequences

The list of more than 120 sequences below describes the variations. The list has the following entries (which are explained in more detail in the Perl program, below):

  • the OEIS A-number,
  • a major rule name (A, B were defined by C. Kimberling)
  • the starting value s(1)
  • a code for the ordering in the segments (increasing/decreasing order, first appearance)
  • a code for the row number (1, 2, ...)
  • optional parameters
A030707 A 1 io 1
A030708 A 1 io 2
A030709 T 1 io 1
A030710 I 1 io 1
A030711 J 1 io 1
A030712 K 1 io 1
A030713 P 1 io 1 parm=1
A030714 P 1 io 1 parm=2
A030715 P 1 io 1 parm=3
A030716 P 1 io 1 parm=4
A030717 A 1 io 5 with0=3
A030718 A 1 io 6
A030719 T 1 io 5
A030720 I 1 io 5
A030721 J 1 io 5
A030722 K 1 io 5
A030723 P 1 io 5 parm=1
A030724 P 1 io 5 parm=2
A030725 P 1 io 5 parm=3
A030726 P 1 io 5 parm=4
A030727 A 3 io 1
A030728 A 3 io 2
A030729 T 3 io 3
A030730 I 3 io 1
A030731 J 3 io 1
A030732 K 3 io 1
A030733 P 3 io 1 parm=1
A030734 P 3 io 1 parm=2
A030735 P 3 io 1 parm=3
A030736 P 3 io 1 parm=4
A030737 A 2 io 1
A030738 A 2 io 2
A030739 T 2 io 3
A030740 I 2 io 1
A030741 J 2 io 1
A030742 K 2 io 1
A030743 P 2 io 1 parm=1
A030744 P 2 io 1 parm=2
A030745 P 2 io 1 parm=3
A030746 P 2 io 1 parm=4
A030747 A 4 io 1
A030748 A 4 io 2
A030749 T 4 io 3
A030750 I 4 io 1
A030751 J 4 io 1
A030752 K 4 io 1
A030753 P 4 io 1 parm=1
A030754 P 4 io 1 parm=2
A030755 P 4 io 1 parm=3
A030756 P 4 io 1 parm=4
A030757 A 1 do 1
A030758 A 1 do 2
A030759 T 1 do 3
A030760 I 1 do 1
A030761 J 1 do 1
A030762 K 1 do 1
A030763 P 1 do 1 parm=1
A030764 P 1 do 1 parm=2
A030765 P 1 do 1 parm=3
A030766 P 1 do 1 parm=4
A030767 A 2 do 1
A030768 A 2 do 2
A030769 T 2 do 3
A030770 I 2 do 1
A030771 J 2 do 1
A030772 K 2 do 1
A030773 P 2 do 1 parm=1
A030774 P 2 do 1 parm=2
A030775 P 2 do 1 parm=3
A030776 P 2 do 1 parm=4
A030777 A 3 do 1
A030778 A 3 do 2
A030779 T 3 do 3
A030780 I 3 do 1
A030781 J 3 do 1
A030782 K 3 do 1
A030783 P 3 do 1 parm=1
A030784 P 3 do 1 parm=2
A030785 P 3 do 1 parm=3
A030786 P 3 do 1 parm=4
A030787 A 4 do 1
A030788 A 4 do 2
A030789 T 4 do 3
A030790 I 4 do 1
A030791 J 4 do 1
A030792 K 4 do 1
A030793 P 4 do 1 parm=1
A030794 P 4 do 1 parm=2
A030795 P 4 do 1 parm=3
A030796 P 4 do 1 parm=4
A051120 A 1 do 3 offset=0 first=2
A055168 B 0 fa 3 with0=2
A055169 N 0 fa 3 with0=2
A055170 D 0 fa 2 with0=2
A055171 B 1 fa 3
A055172 N 1 fa 3
A055173 D 1 fa 2
A055174 B 2 fa 3
A055175 N 2 fa 3
A055176 D 2 fa 2
A055177 B 3 fa 3
A055178 N 3 fa 3
A055179 D 3 fa 2
A055180 B 4 fa 3
A055181 N 4 fa 3
A055182 D 4 fa 2
A055183 B 5 fa 3
A055184 N 5 fa 3
A055185 D 5 fa 2
A055186 A 0 io 3 with0=3
A055187 A 1 io 3 with0=2
A055188 A 2 fa 3
A055189 A 3 fa 3
A055190 A 4 fa 3
A055191 A 5 fa 3
A079668 A 1 io 3 first=2 with0=3
A079686 A 0 do 3 offset=0 with0=3
A126027 T 1 io 5 with0=3
A174382 A 0 io 5 with0=3
A217760 A 0 fa 3 with0=2
A217780 A 1 fa 3
A240508 T 0 io 5 with0=3
122 sequences

Symmetry and relations

s     A 1       A 2       T        I        J        K        P 1      P 2      P 3      P 4
1  A030707 A030708 A030709 A030710 A030711 A030712 A030713 A030714 A030715 A030716 io
   A030717 A030718 A030719 A030720 A030721 A030722 A030723 A030724 A030725 A030726 io
3  A030727 A030728 A030729 A030730 A030731 A030732 A030733 A030734 A030735 A030736 io
2  A030737 A030738 A030739 A030740 A030741 A030742 A030743 A030744 A030745 A030746 io
4  A030747 A030748 A030749 A030750 A030751 A030752 A030753 A030754 A030755 A030756 io
   
1  A030757 A030758 A030759 A030760 A030761 A030762 A030763 A030764 A030765 A030766 do
2  A030767 A030768 A030769 A030770 A030771 A030772 A030773 A030774 A030775 A030776 do
3  A030777 A030778 A030779 A030780 A030781 A030782 A030783 A030784 A030785 A030786 do
4  A030787 A030788 A030789 A030790 A030791 A030792 A030793 A030794 A030795 A030796 do

s     B        N        D
0 A055168 A055169 A055170 fa
1 A055171 A055172 A055173 fa
2 A055174 A055175 A055176 fa
3 A055177 A055178 A055179 fa
4 A055180 A055181 A055182 fa
5 A055183 A055184 A055185 fa

The following relations can be observed:

1 A030709 = A030759 (segment lengths)
2 A030739 = A030769
3 A030729 = A030779
4 A030749 = A030789 
1 A030711 = A030761 (next term which is greater than all previous)

Generating Perl program

The Perl program below can be used to generate all sequences of the list. It produces b-files, but the rules T, J, K are currently rather slow, and take time above 100 entries. The latest version of the program and its auxilliary files can be found on a Github repository.


#!perl

# Generate OEIS A030707, A055187, A217760 and related
# "cumulative counting" sequences as defined by Clark Kimberling.
# http://faculty.evansville.edu/ck6/integer/unsolved.html, Problem 4
# @(#) $Id$
# 2018-04-20, Georg Fischer (previosu version in cumulcount2.pl)
#------------------------------------------------------
# Comment from A217760:
#   Write 0 followed by segments defined inductively as follows: each segment
#   tells how many times each previously written integer occurs, in the order
#   of first occurrence.  This is Method A (adjective-before-noun pairs); for
#   Method B (noun-before-adjective), see A055168.
# Example:
#   Start with 0, followed by the adjective-noun pair 1,0; followed by
#   adjective-noun pairs 2,0 then 1,1; etc. Writing the pairs vertically,
#   the initial segments are
#   0.|.1.|.2 1.|.3 3 1.|.4 5 2 2.|.5 6 5 3 1 1.|.6 9 6 5 2 4 1.|.7 11 8 6 4 6 4 1
#   ..|.0.|.0 1.|.0 1 2.|.0 1 2 3.|.0 1 2 3 4 5.|.0 1 2 3 4 5 6.|.0 1  2 3 4 5 6 9
#
# Usage:
#   perl cumulcount.pl -m method -r row -n noeis -l len -a appear -o offset -s start -p parm -w with0 -d debug
#       All parameters are optional and have a default value:
#       method = "A" (attribute over noun; default)
#                "B" (noun over attribute)
#                "D" (new, distinct elements)
#                "I" (inverse, first occurrence of a number)
#                "J" (next term which is greater than all previous)
#                "K" (next position where term is greater than all previous)
#                "N" (number of new elements in segment)
#                "P" (positions of small numbers (parm))
#                "S" (sum of terms in segment n)
#                "T" (number of terms in segment n)
#       row    =  3 (count in both rows,    output both; default)
#                 1 (count in both rows,    output 1st)
#                 2 (count in both rows,    output 2nd)
#                 5 (count in 1st row only, output 1st)
#                 6 (count in 1st row only, output 2nd)
#       noeis  = "030707|055187|217760 ..." (OEIS number without "A", default "030707")
#       len    = length of sequence to be generated (default: 256)
#       appear = "io" (increasing order; default)
#                "do" (decreasing order)
#                "fa" (order of first appearance)
#       first  = 0, 2 (first index in @segment)
#       offset = 0, 1 (index f 1st b-file entry, default: 1)
#       start  = starting value for a(1): 0, 1 (default), 3, 4, 5
#       parm   = 2nd parameter (for rule "P"): 1, 2, 3, 4
#       with0  =  0 (0 is not counted for neither attr nor noun)
#                 1 (0 is counted for attr only)
#                 2 (0 is counted for noun only)
#                 3 (0 is counted for both attr and noun)
#       debug  = 0 (none; default)
#                1 (with segments)
#--------------------------------------------------------
use strict;

my $appear = "io";
my $debug  = 0;
my $first  = 0;
my $len    = 256;
my $method = "A";
my $noeis  = "030707";
my $offset = 1;
my $parm   = 0;
my $row    = 3; # count in both rows,    output both; default
my $start  = 1;
my $with0  = 0;

while (scalar(@ARGV) > 0) {
    my $opt = shift(@ARGV);
    if (0) {
    } elsif ($opt eq "-a") { $appear  = shift(@ARGV);
    } elsif ($opt eq "-d") { $debug   = shift(@ARGV);
    } elsif ($opt eq "-f") { $first   = shift(@ARGV);
    } elsif ($opt eq "-l") { $len     = shift(@ARGV);
    } elsif ($opt eq "-m") { $method  = shift(@ARGV);
    } elsif ($opt eq "-n") { $noeis   = shift(@ARGV);
    } elsif ($opt eq "-o") { $offset  = shift(@ARGV);
    } elsif ($opt eq "-p") { $parm    = shift(@ARGV);
    } elsif ($opt eq "-r") { $row     = shift(@ARGV);
    } elsif ($opt eq "-s") { $start   = shift(@ARGV);
    } elsif ($opt eq "-w") { $with0   = shift(@ARGV);
    } else { die "invalid option \"$opt\"\n";
    }
} # while ARGV

if ($debug == 99) {
	print " [http://oeis.org/A$noeis A$noeis] $method $start $appear $row";
	if ($offset != 1) { print " offset=$offset"; }
	if ($first  != 0) { print " first=$first"; }
	if ($parm   != 0) { print " parm=$parm"; }
	if ($with0  != 0) { print " with0=$with0"; }
	print "\n";
	exit(0);
}
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)
    = localtime (time);
my $timestamp = sprintf ("%04d-%02d-%02d %02d:%02d"
    , $year + 1900, $mon + 1, $mday, $hour, $min);
print <<"GFis";
# http://oeis.org/A$noeis/b$noeis.txt: table n,a(n) for n=1..$len
# Generated  on $timestamp by 
# perl cumulcount.pl -m $method -r $row -n $noeis -l $len -a $appear -f $first -o $offset -s $start -p $parm -w $with0 
GFis

my %inverse  = (); # inverse sequence
my $curmax = $start - 1;
my $segno = 0;
my @segment = ();
# $segment[i+0] = attribute, how often (i = 1, 3, 5 ..)
# $segment[i+1] = noun, which number is counted,
# always this order, increasing nouns, always complete with zero attributes
my @count;  # temporary copy of the attributes
my @app1st; # 1st appearance of a noun
my @seqlen = (1); # cumulative length of sequence so far, indexed with $segno
my $attr;   # attribute, count of nouns
my $noun;   # the numbers to be counted
my $iseg;   # index in @segment

# first segment
$noun = 0;
while ($noun < $start) { # fill before $start
    push(@segment, 0, $noun);
    $noun ++;
} # while filling
push(@segment, 1, $start);

# first b-file entry
my $k = $offset;
my $k2 = $k; # copy of k, running as if it were rule A
if (0) {
} elsif ($method =~ m{[ABIJKP]}i) {
    if (($row & 1) != 0) {
        &bfile($start);
    }
} elsif ($method =~ m{[D]}i) {
    print "$k $start\n"; $k ++;
} elsif ($method =~ m{[N]}i) {
    # print "$k 1\n"  ; $k ++;
    $seqlen[0] = 0;
} elsif ($method =~ m{[S]}i) {
} elsif ($method =~ m{[T]}i) {
	if ($noeis eq "240508") {
    	print "$k 1\n"; $k ++;
	}
} else {
    die "invalid method \"$method\" at bf(1)\n";
}
push(@app1st, $start);
$segno ++;

# main loop
while ($k <= $len and $segno <= $len) { # compute new segment from current
    &advance();
    $segno ++;
} # while b-file

if ($method =~ m{I}i) { # special treatment of the inverse
    $k = 1;
    foreach my $attr (sort {$a <=> $b} (keys(%inverse))) {
        last if $attr > $k; # must be monotone
        print "$k $inverse{$attr}\n"; $k ++;
    } # foreach
} # method I
#----------------
sub advance { # count between 0 and $nmax, and store in @counts
    my $amax = -1; # $nmax is the current segment length / 2
    if (1) { # compute length of current segment 
        $seqlen[$segno] = 0; # number of elements in segment
        for ($iseg = $first; $iseg < scalar(@segment); $iseg += 2) { # increment for valid entries
            $attr = $segment[$iseg + 0];
            $noun = $segment[$iseg + 1];
            if ($attr != 0 or ($with0 & 1) != 0) {
                $seqlen[$segno] ++;
            }
        } # while incrementing
    } # segment length
    
if ($debug >= 1) {
    print "seg#$segno:";
    for ($iseg = $first; $iseg < scalar(@segment); $iseg += 2) { # print the elements of this segment
        $attr = $segment[$iseg + 0];
        $noun = $segment[$iseg + 1];
        print " $attr.$noun";
    } # while copying
    print "   seqlen=$seqlen[$segno]\n";
    print "app1st: " . join(" ", @app1st) . "\n"; 
} # debug

    # now the b-file entries
    if (0) {
    } elsif ($method =~ m{[ABIJKP]}i) { # first or second row or both
        if (0) {
        } elsif ($appear eq "fa") { # order of first appearance
            for (my $iapp = 0; $iapp < scalar(@app1st)     ; $iapp ++) {
                $iseg = $app1st[$iapp] << 1;
                $attr = $segment[$iseg + 0];
                $noun = $segment[$iseg + 1];
                if ($attr != 0 or ($with0 & 1) != 0) {
                    &bfile($attr, $noun); # for method I: store %inverse only
                }
            } # for
        } elsif ($appear eq "do") { # decreasing order
            for ($iseg = scalar(@segment) - 2; $iseg >= $first; $iseg -= 2) {
                $attr = $segment[$iseg + 0];
                $noun = $segment[$iseg + 1];
                if ($attr != 0 or ($with0 & 1) != 0) {
                    &bfile($attr, $noun); # for method I: store %inverse only
                }
            } # for 
        } elsif ($appear eq "io") { # increasing order
            for ($iseg = $first; $iseg < scalar(@segment)     ; $iseg += 2) {
                $attr = $segment[$iseg + 0];
                $noun = $segment[$iseg + 1];
                if ($attr != 0 or ($with0 & 1) != 0) {
                    &bfile($attr, $noun); # for method I: store %inverse only
                }
            } # for
        } else {
            die "invalid parameter op=\"$appear\"\n";
        }

    } elsif ($method =~ m{[D]}i) { # new terms (for $appear eq "fa")
            if ($debug >= 1) {
                print "range " . ($seqlen[$segno - 1]) . ".." . ($seqlen[$segno] - 1) . "\n";
            }
            for (my $iapp = $seqlen[$segno - 1]; $iapp < $seqlen[$segno]; $iapp ++) {
                $iseg = $app1st[$iapp] << 1;
                $attr = $segment[$iseg + 0];
                $noun = $segment[$iseg + 1];
                if ($attr != 0 or ($with0 & 1) != 0) {
                    &bfile($attr, $noun); 
                }
            } # for

    } elsif ($method =~ m{[N]}i) { # no. of new terms in segment
        &bfile($seqlen[$segno] - $seqlen[$segno - 1]);

    } elsif ($method =~ m{[T]}i) { # no. of terms in segment
        &bfile($seqlen[$segno]);
    }
    #--------
    # compute following segment 
    for ($iseg = $first; $iseg < scalar(@segment) ; $iseg += 2) { # copy attr and determine maximum attr
        $attr = $segment[$iseg + 0];
        $noun = $segment[$iseg + 1];
        $count[$noun] = $attr; # copy old attr
        if ($attr > $amax) {
            $amax = $attr;
        }
    } # while copying
    my $last_noun = $noun;

    $noun = $last_noun + 1;
    while ($noun <= $amax) { # insert nouns with 0 attributes
        $count[$noun ++] = 0;
    } # while inserting
    my $ff_count = $noun;

    # now add all (or row1, row2) to @count
    if (0) {
    } elsif ($appear eq "fa") {
        for (my $iapp = 0; $iapp < $seqlen[$segno]; $iapp ++) {
            &assemble($app1st[$iapp] << 1);
        } # for $iapp
    } else { # "io", "do"
        for ($iseg = $first; $iseg < scalar(@segment); $iseg += 2) { # add
            &assemble($iseg);
        } # for $iseg
        if (0 and $noeis eq "055186") {
        } # 055186
    } # "io", "do"

    # copy it back to the segment
    $iseg = 0;
    $noun = 0;
    while ($noun < $ff_count) { # add
        $segment[$iseg + 0] = $count[$noun];
        $segment[$iseg + 1] = $noun;
        $iseg += 2;
        $noun ++;
    } # while copying back
} # sub advance
#----------------
sub assemble {
            my ($iseg) = @_;
            $attr = $segment[$iseg + 0];
            $noun = $segment[$iseg + 1];
            if (($attr != 0 or ($with0 & 1) != 0) and ($row != 6)) {
                if ($count[$attr] == 0) { # appears for the first time
                    push(@app1st, $attr);
                }
                $count[$attr] ++;
            }
            if (($attr != 0 or ($with0 & 1) != 0) and ($noun != 0 or ($with0 & 2) != 0) and ($row != 5)) {
                $count[$noun] ++;
            }
            if ($attr == 0 and $noeis eq "079668") {
            	$first = 0;
            }
} # assemble
#----------------
sub bfile {
    if ($k > $len) {
        return;
    }
    my ($attr, $noun) = @_;
    if (0) {
    } elsif ($method =~ m{P}i) {
        if ($attr == $parm) {
            print "$k $k2\n"; $k ++;
        }
        $k2 ++;
    } elsif ($method =~ m{I}i) {
        if (! defined($inverse{$attr})) {
            # assume that method "I" is called with row=1 only !
            $inverse{$attr} = $k;
            if ($debug >= 1) {
                print "# stored $k in inverse{$attr}\n";
            }
        }
        $k ++;
    } elsif ($method =~ m{J}i) {
        if ($attr > $curmax) {
            print "$k $attr\n"; $k ++;
            $curmax = $attr;
        }
        $k2 ++;
    } elsif ($method =~ m{K}i) {
        if ($attr > $curmax) {
            print "$k $k2\n"; $k ++;
            $curmax = $attr;
        }
        $k2 ++;
    } elsif (scalar(@_) == 1) {
            print "$k $attr\n"; $k ++;
    } elsif ($method =~ m{N}i) {
            print "$k $attr\n"; $k ++;
    } elsif ($method =~ m{T}i) {
            print "$k $attr\n"; $k ++;
    } elsif ($method =~ m{[AD]}i) { # attribute before noun
        if (($row & 1) != 0) { 
            print "$k $attr\n"; $k ++; 
        }
        if (($row & 2) != 0 and $k <= $len) { 
            print "$k $noun\n"; $k ++; 
        }
    } elsif ($method =~ m{[BD]}i) { # noun before attribute
        if (($row & 1) != 0) { 
            print "$k $noun\n"; $k ++; 
        }
        if (($row & 2) != 0 and $k <= $len) { 
            print "$k $attr\n"; $k ++; 
        }
    } else {
        die "invalid method \"$method\" in sub bfile\n";
    }
} # bfile
__DATA__
Rule A, A055187:
1 | 1 | 3 | 4  1 |  6  2  1 |  8  1  3  2  1 |
  | 1 | 1 | 1  3 |  1  3  4 |  1  2  3  4  6 |

  | 11  3  5  3  2  1  | 13  5  8  4  1  3  2  1 |
  |  1  2  3  4  6  8  |  1  2  3  4  5  6  8 11 |

  | 16  7 10  6  3  4  4  2  1 |
  |  1  2  3  4  5  6  8 11 13 |

  | 18  9 12  9  4  6  1  5  1  3  2  1 |
  |  1  2  3  4  5  6  7  8 10 11 13 16 |

  | 22 11 14 11  6  8  2  6  2  2  4  1  3  2  1 |
  |  1  2  3  4  5  6  7  8  9 10 11 12 13 16 18 |

  | 25 16 16 14 ...
  |  1  2  3  4 ...

--------------------
A030717 (row 1), A030718 (row2) - zeroes are inconsistent
1 | 1 | 2 | 2, 1 | 3, 2 | 3, 3, 1 | 4, 3, 3 | 4, 3, 5, 1 | 5, 3, 6, 2, 1
  | 1 | 1 | 1, 2 | 1, 2 | 1, 2, 3 | 1, 2, 3 | 1, 2, 3, 4 | 1, 2, 3, 4, 5

  | 6, 4, 7, 2, 2, 1 | 7, 6, 7, 3, 2, 2, 1| 8, 8, 8, 3, 2, 3, 3
  | 1, 2, 3, 4, 5, 6 | 1, 2, 3, 4, 5, 6, 7| 1, 2, 3, 4, 5, 6, 7

  | 8, 9, 11, 3, 2, 3, 3, 3 | 8, 10, 15, 3, 2, 3, 3, 4, 1,  0,  1
  | 1, 2,  3, 4, 5, 6, 7, 8 | 1,  2,  3, 4, 5, 6, 7, 8, 9,     11

  | 10, 11, 18, 4, 2, 3, 3, 5, 1,  1,  1, 0, 0, 0,  1
  |  1,  2,  3, 4, 5, 6, 7, 8, 9, 10, 11,          15

  | 14, 12, 20, 5, 3, 3, 3, 5, 1,  2,  2, 0, 0, 0,  1, 0, 0,  1
  |  1,  2,  3, 4, 5, 6, 7, 8, 9, 10, 11,          15,       18

  | 17, 14, 23, 5, 5
  |  1,  2,  3  ...
#----------------------------------------------
A051120 ,1|1,1|3,1|1,3,4,1|1,4,2,3,6,1|1,6,2,4,3,3,1,2,8,1|1,8,2,6,3,4,5,3,3,2,11,1|1,11,2,8,3,6,1,5,4,4,8,3,5,2,13,1|1,13,2,11,4,8,4,6,3,5,6,4,10,3,7,2,16,1,1,16,2,13,3,11,1,10,5,8,1,7,6,6,4,5,9,4,12,3,9,2,18,1,
A055187 ,1|1,1|3,1|4,1,1,3|6,1,2,3,1,4|8,1,1,2,3,3,2,4,1,6|11,1,3,2,5,3,3,4,2,6,1,8|13,1,5,2,8,3,4,4,1,5,3,6,2,8,1,11|16,1,7,2,10,3,6,4,3,5,4,6,4,8,2,11,1,13,18,1,9,2,12,3,9,4,4,5,6,6,1,7,5,8,1,10,3,11,2,13,1,16,22,1,


makefile

A Unix makefile was used

  • to produce the list of sequences,
  • to download (once) the corresponding b-files,
  • to regenerate the particular sequences and
  • to compare them against the stored b-files.

#!make

# Generate OEIS A030707, A055187, A217760 and related 
# "cumulative counting" sequences as defined by Clark Kimberling.
# http://faculty.evansville.edu/ck6/integer/unsolved.html, Problem 4
# @(#) $Id$
# 2018-04-27, Georg Fischer (previosu version in makefile2)
#
# C.f. listing.tmp (produced by target "listing", below)
# Needs cumulcount.pl in current directory, and
# Unix tools diff, echo, grep, head, make, perl, sed, tee, test, wget
#---------------------------------
TARGET=cumulcount
SIL=
LIMIT=100
APPEAR=io
DEBUG=0
FIRST=0
LEN=$(LIMIT)
OFFSET=1
PARM=0
ROW=3
START=1
WITH0=0

all:    0307nn 0551nn misc
quick:  030707 030708 030717 030718 055168 055186 055187 misc
0307nn: 0307io 0307do 
0551nn: 05516n 05518n 
#----------
misc:   051120 \
		079668 079686 \
		126027 253170 \
		174382 240508\
		2177nn 
051120: # A055187, but decreasing
	make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1 OFFSET=0 FIRST=2

079668:
	make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 WITH0=3 FIRST=2
079686:
	make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=1000     APPEAR=do START=0 WITH0=3 OFFSET=0

126027: # row lengths of A030717; trick with OFFSET 2: 1st entry is missing
	make $(SIL) $(TARGET) METHOD=T  ROW=5 NOEIS=$@ LEN=24       APPEAR=io START=1 WITH0=3
253170: # row sums     of A030717
	# nyi
	
174382: # like 030717
	make $(SIL) $(TARGET) METHOD=A  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=0 WITH0=3
240508: # row lengths in A174382; 1st two lines wrong
	make $(SIL) $(TARGET) METHOD=T  ROW=5 NOEIS=$@ LEN=24       APPEAR=io START=0 WITH0=3

2177_list:
	grep -aE "^A2177" ../names
2177nn: 217760 217780 #	ok
217760: # c.f. 055186
	make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=10000    APPEAR=fa START=0 WITH0=2
217780: # c.f. 055187
	make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=10000    APPEAR=fa START=1
#----------
0307_list:
	grep -aE "^A0307" ../names
0307_compare:
	diff -w -y --width=32 --suppress-common-lines b030709.txt b030759.txt || :  
	diff -w -y --width=32 --suppress-common-lines b030729.txt b030779.txt || :  
	diff -w -y --width=32 --suppress-common-lines b030739.txt b030769.txt || :  
	diff -w -y --width=32 --suppress-common-lines b030749.txt b030799.txt || :  
	diff -w -y --width=32 --suppress-common-lines b030711.txt b030761.txt || :  
	
0307io: 03070n 03071n 03072n 03073n 03074n
03070n: 030707 030708 030709 030710 030711 030712 030713 030714 030715 030716
03071n: 030717 030718 030719 030720 030721 030722 030723 030724 030725 030726
03072n: 030727 030728 030729 030730 030731 030732 030733 030734 030735 030736
03073n:	030737 030738 030739 030740 030741 030742 030743 030744 030745 030746
03074n:	030747 030748 030749 030750 030751 030752 030753 030754 030755 030756

0307do:                                    03075n 03076n 03077n 03078n
03075n:	030757 030758 030759 030760 030761 030762 030763 030764 030765 030766
03076n:	030767 030768 030769 030770 030771 030772 030773 030774 030775 030776
03077n:	030777 030778 030779 030780 030781 030782 030783 030784 030785 030786
03078n:	030787 030788 030789 030790 030791 030792 030793 030794 030795 030796

030707:
	make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030708:
	make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030709:
	make $(SIL) $(TARGET) METHOD=T  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030710:
	make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000     APPEAR=io START=1
030711:
	make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030712:
	make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030713:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=1
030714:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=2
030715:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=3
030716:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=4

030717:
	make $(SIL) $(TARGET) METHOD=A  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 WITH0=3
030718:
	make $(SIL) $(TARGET) METHOD=A  ROW=6 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030719:
	make $(SIL) $(TARGET) METHOD=T  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030720:
	make $(SIL) $(TARGET) METHOD=I  ROW=5 NOEIS=$@ LEN=2000     APPEAR=io START=1
030721:
	make $(SIL) $(TARGET) METHOD=J  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030722:
	make $(SIL) $(TARGET) METHOD=K  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1
030723:
	make $(SIL) $(TARGET) METHOD=P  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=1
030724:
	make $(SIL) $(TARGET) METHOD=P  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=2
030725:
	make $(SIL) $(TARGET) METHOD=P  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=3
030726:
	make $(SIL) $(TARGET) METHOD=P  ROW=5 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 PARM=4

030727:
	make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3
030728:
	make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3
030729:
	make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3
030730:
	make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000     APPEAR=io START=3
030731:
	make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3
030732:
	make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3
030733:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3 PARM=1
030734:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3 PARM=2
030735:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3 PARM=3
030736:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=3 PARM=4

030737:
	make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2
030738:
	make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2
030739:
	make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2
030740:
	make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000     APPEAR=io START=2
030741:
	make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2
030742:
	make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2
030743:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2 PARM=1
030744:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2 PARM=2
030745:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2 PARM=3
030746:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=2 PARM=4

030747:
	make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4
030748:
	make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4
030749:
	make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4
030750:
	make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000     APPEAR=io START=4
030751:
	make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4
030752:
	make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4
030753:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4 PARM=1
030754:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4 PARM=2
030755:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4 PARM=3
030756:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=4 PARM=4

030757:
	make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1
030758:
	make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1
030759:
	make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1
030760:
	make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000     APPEAR=do START=1
030761:
	make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1
030762:
	make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1
030763:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1 PARM=1
030764:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1 PARM=2
030765:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1 PARM=3
030766:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=1 PARM=4

030767:
	make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2
030768:
	make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2
030769:
	make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2
030770:
	make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000     APPEAR=do START=2
030771:
	make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2
030772:
	make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2
030773:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2 PARM=1
030774:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2 PARM=2
030775:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2 PARM=3
030776:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=2 PARM=4

030777:
	make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3
030778:
	make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3
030779:
	make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3
030780:
	make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000     APPEAR=do START=3
030781:
	make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3
030782:
	make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3
030783:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3 PARM=1
030784:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3 PARM=2
030785:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3 PARM=3
030786:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=3 PARM=4

030787:
	make $(SIL) $(TARGET) METHOD=A  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4
030788:
	make $(SIL) $(TARGET) METHOD=A  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4
030789:
	make $(SIL) $(TARGET) METHOD=T  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4
030790:
	make $(SIL) $(TARGET) METHOD=I  ROW=1 NOEIS=$@ LEN=2000     APPEAR=do START=4
030791:
	make $(SIL) $(TARGET) METHOD=J  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4
030792:
	make $(SIL) $(TARGET) METHOD=K  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4
030793:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4 PARM=1
030794:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4 PARM=2
030795:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4 PARM=3
030796:
	make $(SIL) $(TARGET) METHOD=P  ROW=1 NOEIS=$@ LEN=$(LIMIT) APPEAR=do START=4 PARM=4
#----------
0551_list:
	grep -aE "^A0551" ../names
05516n: 055168 055169 055170\
		055171 055172 055173\
		055174 055175 055176\
		055177 055178 055179\
		055180 055181 055182\
		055183 055184 055185
055168:
	make $(SIL) $(TARGET) METHOD=B  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=0 WITH0=2
055169:
	make $(SIL) $(TARGET) METHOD=N  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=0 WITH0=2
055170:
	make $(SIL) $(TARGET) METHOD=D  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=0 WITH0=2
055171:
	make $(SIL) $(TARGET) METHOD=B  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=1
055172:
	make $(SIL) $(TARGET) METHOD=N  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=1
055173:
	make $(SIL) $(TARGET) METHOD=D  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=1
055174:
	make $(SIL) $(TARGET) METHOD=B  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=2
055175:
	make $(SIL) $(TARGET) METHOD=N  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=2
055176:
	make $(SIL) $(TARGET) METHOD=D  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=2
055177:
	make $(SIL) $(TARGET) METHOD=B  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=3
055178:
	make $(SIL) $(TARGET) METHOD=N  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=3
055179:
	make $(SIL) $(TARGET) METHOD=D  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=3
055180:
	make $(SIL) $(TARGET) METHOD=B  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=4
055181:
	make $(SIL) $(TARGET) METHOD=N  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=4
055182:
	make $(SIL) $(TARGET) METHOD=D  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=4
055183:
	make $(SIL) $(TARGET) METHOD=B  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=5
055184:
	make $(SIL) $(TARGET) METHOD=N  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=5
055185:
	make $(SIL) $(TARGET) METHOD=D  ROW=2 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=5
#-----
05518n: 055186 055187 \
		055188 055189 055190 055191
055186:
	make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=0 WITH0=3
055187:
	make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=io START=1 WITH0=2
055188:
	make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=2
055189:
	make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=3
055190:
	make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=4
055191:
	make $(SIL) $(TARGET) METHOD=A  ROW=3 NOEIS=$@ LEN=$(LIMIT) APPEAR=fa START=5
#---------------------------------------------------------------
cumulcount:
	# -------------------------------------------------------
	test -s b$(NOEIS).txt || wget http://oeis.org/A$(NOEIS)/b$(NOEIS).txt
	grep -E "^[0-9]" b$(NOEIS).txt    | head -n $(LEN)                           > bf.tmp
#	wc -l bf.tmp
	perl cumulcount.pl -m $(METHOD) -r $(ROW) -n $(NOEIS) -l $(LEN) -a $(APPEAR) -f $(FIRST) -o $(OFFSET) -s $(START) -p $(PARM) -w $(WITH0) -d $(DEBUG) > A$(NOEIS).pn.tmp
	grep -E "^[0-9]" A$(NOEIS).pn.tmp | head -n `wc -l bf.tmp | cut -d " " -f 1` > pn.tmp
#	diff -w -y                         --width=32  bf.tmp pn.tmp || :
	diff -w -y --suppress-common-lines --width=32  bf.tmp pn.tmp | head -n 8
#
debug:
	# -------------------------------------------------------
	perl cumulcount.pl -m $(METHOD) -r $(ROW) -n $(NOEIS) -l $(LEN) -a $(APPEAR) -f $(FIRST) -o $(OFFSET) -s $(START) -p $(PARM) -w $(WITH0) -d 1 | less
#--------
list1:
	perl cumulcount.pl -m $(METHOD) -r $(ROW) -n $(NOEIS) -l $(LEN) -a $(APPEAR) -f $(FIRST) -o $(OFFSET) -s $(START) -p $(PARM) -w $(WITH0) -d 99 
#	echo " " [https://oeis.org/A$(NOEIS) A$(NOEIS)] Rule $(RULE).$(ROW) $(ORD) $(P1) $(P2) " "\
#	`wc -l b$(NOEIS).txt | cut -d " " -f 1`
listing:
	make -s all TARGET=list1 | sort \
	| tee listing.tmp
	wc -l listing.tmp
#--------
# e.g. https://oeis.org/search?q=id:A257908&fmt=text
intern1:
	test -s A$(NOEIS).int || wget -O A$(NOEIS).int "http://oeis.org/search?q=id:A$(NOEIS)\&fmt=text" 
internal: 
	make $(SIL) all TARGET=intern1