cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Reed Kelly

Reed Kelly's wiki page.

Reed Kelly has authored 11 sequences. Here are the ten most recent ones:

A214646 a(n) = (a(n-2) + a(n-3))/gcd(a(n-2), a(n-3)) with a(1) = a(2) = a(3) = 1.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 2, 5, 5, 7, 2, 12, 9, 7, 7, 16, 2, 23, 9, 25, 32, 34, 57, 33, 91, 30, 124, 121, 77, 245, 18, 46, 263, 32, 309, 295, 341, 604, 636, 945, 310, 527, 251, 27, 778, 278, 805, 528, 1083, 1333, 537, 2416, 1870, 2953, 2143, 4823, 5096, 6966, 109
Offset: 1

Author

Reed Kelly, Jul 24 2012

Keywords

Comments

A variation on A214551 with the second and third terms being added and divided by the greatest common divisor of the pair of numbers.

Examples

			a(6) = (a(4)+a(3))/gcd(a(4),a(3)) = (2+1)/1 = 3.
a(19) = (a(17)+a(16))/gcd(a(17),a(16)) = (2+16)/2 = 9.
		

Crossrefs

Programs

  • Mathematica
    DivGCDxy[n_, x_, y_, init_] := Module[{t, a, i}, t = init;
      Do[AppendTo[t, (t[[-x]] + t[[-y]])/GCD[t[[-x]], t[[-y]]]], {n}];
      t]; DivGCDxy[100, 2, 3, {1, 1, 1}]

Extensions

NAME adapted to offset and b-file. - R. J. Mathar, Jun 19 2021

A214652 a(n) = (a(n-1) + a(n-4))/gcd(a(n-1), a(n-4)) with a(1) = a(2) = a(3) = a(4) = 1.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 4, 5, 7, 10, 7, 12, 19, 29, 36, 4, 23, 52, 22, 13, 36, 22, 2, 15, 17, 39, 41, 56, 73, 112, 153, 209, 282, 197, 350, 559, 841, 1038, 694, 1253, 2094, 522, 608, 1861, 3955, 4477, 5085, 6946, 10901, 1398, 2161, 9107, 20008, 10703, 12864, 21971
Offset: 1

Author

Reed Kelly, Jul 24 2012

Keywords

Comments

A variation on A214551 with the first and fourth terms being added and divided by the greatest common divisor of the pair of numbers.

Examples

			a(11) = (a(10)+a(7))/gcd(a(10),a(7)) = (10+4)/gcd(10,4) = 7
a(13) = (a(12)+a(9))/gcd(a(13),a(9)) = (12+7)/gcd(12,7) = 19
		

Crossrefs

Programs

  • Mathematica
    GCDxy[n_, x_, y_, init_] := Module[{t, a, i}, t = init;
      Do[AppendTo[t, (t[[-x]] + t[[-y]])/GCD[t[[-x]], t[[-y]]]], {n}];
      t]; GCDxy[100, 1, 4, {1, 1, 1, 1}]
    RecurrenceTable[{a[0]==a[1]==a[2]==a[3]==1,a[n]==(a[n-1]+a[n-4])/GCD[ a[n-1],a[n-4]]},a,{n,60}] (* Harvey P. Dale, Apr 08 2019 *)

Extensions

Definition corrected by Harvey P. Dale, Apr 08 2019
NAME adapted to offset and b-file. - R. J. Mathar, Jun 19 2021

A214551 Reed Kelly's sequence: a(n) = (a(n-1) + a(n-3))/gcd(a(n-1), a(n-3)) with a(0) = a(1) = a(2) = 1.

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 3, 2, 3, 2, 2, 5, 7, 9, 14, 3, 4, 9, 4, 2, 11, 15, 17, 28, 43, 60, 22, 65, 25, 47, 112, 137, 184, 37, 174, 179, 216, 65, 244, 115, 36, 70, 37, 73, 143, 180, 253, 36, 6, 259, 295, 301, 80, 75, 376, 57, 44, 105, 54, 49, 22, 38, 87, 109, 147
Offset: 0

Author

Reed Kelly, Jul 20 2012

Keywords

Comments

Like Narayana's Cows sequence A000930, except that the sums are divided by the greatest common divisor (gcd) of the prior terms.
It is a strong conjecture that 8 and 10 are missing from this sequence, but it would be nice to have a proof! See A214321 for the conjectured values. [I have often referred to this as "Reed Kelly's sequence" in talks.] - N. J. A. Sloane, Feb 18 2017

Examples

			a(14)=9, a(16)=3, therefore a(17)=(9+3)/gcd(9,3) = 12/3 = 4.
a(24)=28, a(26)=60, therefore a(27)=(28+60)/gcd(28,60) = 88/4 = 22.
		

Crossrefs

Similar to A000930. Cf. A341312, A341313, which are also similar.
Starting with a(2) = 3 gives A214626. - Reinhard Zumkeller, Jul 23 2012

Programs

  • Haskell
    a214551 n = a214551_list !! n
    a214551_list = 1 : 1 : 1 : zipWith f a214551_list (drop 2 a214551_list)
       where f u v = (u + v) `div` gcd u v
    -- Reinhard Zumkeller, Jul 23 2012
    
  • Maple
    a:= proc(n) a(n):= `if`(n<3, 1, (a(n-1)+a(n-3))/igcd(a(n-1), a(n-3))) end:
    seq(a(n), n=0..100); # Alois P. Heinz, Oct 18 2012
  • Mathematica
    t = {1, 1, 1}; Do[AppendTo[t, (t[[-1]] + t[[-3]])/GCD[t[[-1]], t[[-3]]]], {100}]
    f[l_List] := Append[l, (l[[-1]] + l[[-3]])/GCD[l[[-1]], l[[-3]]]]; Nest[f, {1, 1, 1}, 62] (* Robert G. Wilson v, Jul 23 2012 *)
    RecurrenceTable[{a[0]==a[1]==a[2]==1,a[n]==(a[n-1]+a[n-3])/GCD[ a[n-1], a[n-3]]},a,{n,70}] (* Harvey P. Dale, May 06 2014 *)
  • PARI
    first(n)=my(v=vector(n+1)); for(i=1,min(n,3),v[i]=1); for(i=4,#v, v[i]=(v[i-1]+v[i-3])/gcd(v[n-1],v[i-3])); v \\ Charles R Greathouse IV, Jun 21 2017
    
  • Perl
    use bignum;
    my @seq = (1, 1, 1);
    print "1 1\n2 1\n3 1\n";
    for ( my $i = 3; $i < 400; $i++ )
    {
        my $next = ( $seq[$i-1] + $seq[$i-3] ) /
            gcd( $seq[$i-1], $seq[$i-3] );
        my $ind = $i+1;
        print "$ind $next\n";
        push( @seq, $next );
    }
    sub gcd {
        my ($x, $y) = @_;
        ($x, $y) = ($y, $x % $y) while $y;
        return $x;
    }
    
  • Python
    from math import gcd
    def aupton(nn):
        alst = [1, 1, 1]
        for n in range(3, nn+1):
            alst.append((alst[n-1] + alst[n-3])//gcd(alst[n-1], alst[n-3]))
        return alst
    print(aupton(64)) # Michael S. Branicky, Mar 28 2022
  • Sage
    def A214551Rec():
        x, y, z = 1, 1, 1
        yield x
        while True:
            x, y, z =  y, z, (z + x)//gcd(z, x)
            yield x
    A214551 = A214551Rec();
    print([next(A214551) for  in range(65)])  # _Peter Luschny, Oct 18 2012
    

Formula

It appears that, very roughly, a(n) ~ constant*exp(0.123...*n). - N. J. A. Sloane, Sep 07 2012. See next comment for more precise estimate.
If a(n)^(1/n) converges the limit should be near 1.126 (see link). - Benoit Cloitre, Nov 08 2015
Robert G. Wilson v reports that at around 10^7 terms a(n)^(1/n) is about exp(1/8.4). - N. J. A. Sloane, May 05 2021

A157199 The terms of this sequence are the first several terms of tcW(r,r-1,r+1), where r=2,3,4,.... Informally, the function tcW is like the multi-color Van der Waerden function W, except that the second parameter determines the number of colors found in the target subsequence. See links for definition.

Original entry on oeis.org

9, 13, 22, 26, 44, 50, 25, 28
Offset: 2

Author

Reed Kelly, Feb 25 2009

Keywords

Comments

If W(r,k) is the standard multi-color Van der Waerden function with r colors and a required monochrome arithmetic subsequence of length k, then tcW(r,1,k) = W(r,k). In tcW(r,1,k), the 1 would indicate a monochrome subsequence. For tcW(r,2,k) an arithmetic subsequence of length k in 1 OR 2 colors would match the criteria. For tcW(r,3,k) an arithmetic subsequence of length k in 1, 2, or 3 colors suffices.

Examples

			a(2) = tcW(2,1,3) = W(2,3) = 9. If {1,...,9} is colored in 2 colors, then a 3-term arithmetic subsequence exists in 1 color (monochrome).
a(3) = tcW(3,2,4) = 13. If {1,...,13} is colored in 3 colors, then a 4-term arithmetic subsequence exists in at most 2 colors.
		

Crossrefs

Another part of the tcW function: A157102. The 2-color Van der Waerden numbers: A005346, W(2, k). Multi-color Van der Waerden numbers with 3-term monochrome arithmetic subsequences A135415, W(r, 3).

Formula

a(r) = tcW(r,r-1,r+1).

A157102 Tuple-chromatic Van der Waerden numbers.

Original entry on oeis.org

3, 7, 7, 21, 11, 43, 15, 25, 19, 111, 23, 157, 27, 43, 31, 273, 35, 343, 39, 61, 43, 507, 47, 121, 51, 79, 55, 813, 59, 931, 63, 97, 67, 171, 71, 1333, 75, 115, 79, 1641, 83, 1807, 87, 133, 91, 2163, 95, 337, 99, 151, 103, 2757, 107, 271, 111, 169, 115, 3423, 119, 3661
Offset: 2

Author

Reed Kelly, Feb 22 2009, Feb 25 2009

Keywords

Comments

See links for definition. Specifically, the terms of this sequence are the first several terms of tcW(r,r-1,r), where r=2,3,4,.... Informally, the function tcW is like the multi-color Van der Waerden function W, except that the second parameter determines the number of colors found in the target subsequence. If W(r,k) is the standard multi-color Van der Waerden function with r colors and a required monochrome arithmetic subsequence of length k, then tcW(r,1,k) = W(r,k). In tcW(r,1,k), the 1 would indicate a monochrome subsequence. For tcW(r,2,k) an arithmetic subsequence of length k in 1 OR 2 colors would match the criteria. For tcW(r,3,k) an arithmetic subsequence of length k in 1, 2, or 3 colors suffices.
a(r) = tcW(r,r-1,r).

Examples

			a(2) = tcW(2,1,2) = W(2,2) = 3. If {1,2,3} is colored in 2 colors, then a 2 term arithmetic subsequence exists in 1 color (monochrome).
a(3) = tcW(3,2,3) = 7. If {1,...,7} is colored in 3 colors, then a 3 term arithmetic subsequence exists that is colored in at most 2 colors.
a(2) = (2-1)(2) + 1 = 3 a(15) = (15-1)(3) + 1 = 43.
		

Crossrefs

The 2-color Van der Waerden numbers: A005346, W(2, k). Multi-color Van der Waerden numbers with 3 term monochrome arithmetic subsequences A135415, W(r, 3).

Programs

  • Mathematica
    Table[(x - 1) * (FactorInteger[x])[[1]][[1]] + 1, {x, 2, 100}]

Formula

a(n) = (n-1)*(smallest prime factor of n) + 1.

A140516 For definition see comments lines.

Original entry on oeis.org

1, 3, 6, 8, 9, 13, 16, 17, 19, 20, 21, 26, 31, 32, 36, 42, 43, 45, 49, 50, 52, 53, 54, 58, 62, 65, 66, 67, 71, 78, 80, 82, 85, 87, 89, 90, 97, 98, 103, 106, 108, 112, 113, 114, 116, 120, 122, 123, 124, 128, 129, 134, 135, 139, 141, 143, 145, 147, 148, 153, 155, 157, 161
Offset: 1

Author

Reed Kelly, Jul 01 2008

Keywords

Comments

Inspired by Van der Waerden's Theorem, the positive integers are partitioned into two disjoint sequences, A and B, so that they obey the following rules:
Rule 1: For a given n, let A(n) and B(n) be the subsets of A and B with terms less than or equal to n. Any maximal arithmetic subsequence of A(n) must have at least as many terms as any maximal arithmetic subsequence of B(n).
Rule 2: Construct the sequences by starting at 1 and always favoring to add terms to B, unless it violates Rule 1. Add terms to A if they cannot be added to B.
The sequence listed here is the A sequence.

Examples

			A gets 1, because B cannot yet have an AS of length 1.
B gets 2, because we favor adding to B and A already has an AS of length 1.
A gets 3, because B cannot yet form an AS of length 2.
B gets 4, because A now has an AS of length 2.
B gets 5, because 2,4,5 does not contain an AS of length 3.
A gets 6, because 2,4,5,6 would contain an AS of length 3.
		

Programs

  • Mathematica
    CheckMaxASFromEnd[A_,x_,m_] := Module[{i,n=Length[A],d,k}, If[ m>n+1, Return[False];,]; If[ And[ m<=n+1, n < 2], Return[True];,]; For[ i=n, i>0, i--, d = x-A[[i]]; bot = x-(m-1)*d; If[ bot <= 0, Break[];,]; For[ k=x-2*d, k>=x-(m-1)*d, k -= d, If[ MemberQ[A,k], If[ k == x-(m-1)*d, Return[True];,];, Break[]; ]; ]; ]; False ];
    ASRace[n_] := Module[{i,m=0,A={},B={}}, For[i=1,i <= n, i++, If[ CheckMaxASFromEnd[B,i,m+1], If[ CheckMaxASFromEnd[A,i,m+1], m++, ]; A = Append[A,i];, B = Append[B,i]; ]; ]; {A,B} ];

A128118 At the n-th iteration the sequence of integers from n down to 1 are appended to the sequence a(n) times.

Original entry on oeis.org

1, 2, 1, 2, 1, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 10, 9, 8, 7, 6, 5, 4, 3
Offset: 1

Author

Reed Kelly, Feb 15 2007

Keywords

Examples

			a(4) = 2 so 4,3,2,1,4,3,2,1 is added to the end of the sequence at the fourth iteration.
		

Crossrefs

Programs

  • Mathematica
    crr[n_] := Module[ { A = {1,2,1,2,1}, i, j }, For [ i = 3, i <= n, i++, A = Join[ A, Flatten[ Table[ Range[i,1,-1], {A[[i]]} ]]]; ]; A ]

A128117 At the n-th iteration the sequence of integers from 1 to n are appended to the sequence a(n) times.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4
Offset: 1

Author

Reed Kelly, Feb 15 2007

Keywords

Examples

			a(5) = 2 so 1,2,3,4,5,1,2,3,4,5 is added to the end of the sequence at the fifth iteration.
		

Crossrefs

Cf. A001462.

Programs

  • Mathematica
    cr[n_] := Module[ { A = {1,1,2}, i, j }, For [ i = 3, i <= n, i++, A = Join[ A, Flatten[ Table[ Range[i], {A[[i]]} ]]]; ]; A ]
  • PARI
    a = vector(101, n, 1); m=0; for (n=1, 10, for (t=1, a[n], for (k=1, n, print1 (a[m++]=k", ")))) \\ Rémy Sigrist, Feb 09 2022

A123403 Combining the conditional divide-by-two concept from Collatz sequences with Pascal's triangle, we can arrive at a new kind of triangle. Start with an initial row of just 4. To compute subsequent rows, start by appending a zero to the beginning and end of the previous row. Like Pascal's triangle, add adjacent terms of the previous row to create each of the subsequent terms. The only change is that each term is divided by two if it is even. Then take the center of this triangle. In other words, take the n-th term from the (2n)th row.

Original entry on oeis.org

4, 2, 3, 5, 9, 15, 27, 25, 47, 89, 107, 119, 241, 545, 699, 1471, 3313, 4288, 15661, 31739, 30813, 35143, 92101, 123614, 384815, 788429, 1532363, 2995379, 6281191, 13569969, 16900339, 26062940, 28141406, 57780803, 122540851, 263162577
Offset: 1

Author

Reed Kelly, Oct 14 2006

Keywords

Crossrefs

Cf. A123402.

Programs

  • Mathematica
    (*Returns the center row of the CPT*) CollatzPascalCenter[init_, n_] := Module[{CPT, CENTER, ROWA, ROWB, a, i, j}, If[ListQ[init], CPT = {init}, CPT = {{0, 4, 0}}]; CENTER = {4}; For[i = 1, i < n, i++, ROWA = CPT[[i]]; ROWB = {0}; For[j = 1, j < Length[ROWA], j++, a = ROWA[[j]] + ROWA[[j + 1]]; a = a/(2 - Mod[a, 2]); If[And[EvenQ[Length[ROWA]], (j == Length[ROWA]/2)], CENTER = Append[CENTER, a],]; ROWB = Append[ROWB, a];]; ROWB = Append[ROWB, 0]; CPT = Append[CPT, ROWB];]; CENTER] CollatzPascalCenter[,200]

Formula

Define a(n, m) for integers m, n: a(0, 0)=4, a(n, m) := 0 for m<0 and n

A123402 Combining the conditional divide-by-two concept from Collatz sequences with Pascal's triangle, one can construct a new kind of triangle. Start with an initial row of just 4. To compute subsequent rows, start by appending a zero to the beginning and end of the previous row. Like Pascal's triangle, add adjacent terms of the previous row to create each of the subsequent terms. The only change is that each new term is divided by two if it is even.

Original entry on oeis.org

4, 2, 2, 1, 2, 1, 1, 3, 3, 1, 1, 2, 3, 2, 1, 1, 3, 5, 5, 3, 1, 1, 2, 4, 5, 4, 2, 1, 1, 3, 3, 9, 9, 3, 3, 1, 1, 2, 3, 6, 9, 6, 3, 2, 1, 1, 3, 5, 9, 15, 15, 9, 5, 3, 1, 1, 2, 4, 7, 12, 15, 12, 7, 4, 2, 1, 1, 3, 3, 11, 19, 27, 27, 19, 11, 3, 3, 1, 1, 2, 3, 7, 15, 23, 27, 23, 15, 7, 3, 2, 1, 1, 3, 5, 5, 11, 19
Offset: 0

Author

Reed Kelly, Oct 14 2006

Keywords

Examples

			For the row starting with (1,2,4,5,8,...) the subsequent row is computed as follows: 0+1->1, 1+2->3, (2+4)/2->3, 4+5->9, 5+8->13...
		

Crossrefs

Programs

  • Mathematica
    CollatzPascalTriangle[init_, n_] := Module[{CPT, ROWA, ROWB, a, i, j}, If[ListQ[init], ROWA = init, ROWA = {4}]; CPT = {ROWA}; ROWA = Flatten[{0, ROWA, 0}]; For[i = 1, i < n, i++, ROWB = {0}; For[j = 1, j < Length[ROWA], j++, a = ROWA[[j]] + ROWA[[j + 1]]; a = a/(2 - Mod[a, 2]); ROWB = Append[ROWB, a];]; CPT = Append[CPT, Rest[ROWB]]; ROWA = Append[ROWB, 0]]; CPT] Flatten[ CollatzPascalTriangle[{4},20]]

Formula

Define a(n, m) for integers m, n: a(0, 0)=4, a(n, m) := 0 for m<0 and n