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.

Showing 1-4 of 4 results.

A022441 a(n) = c(n) + c(n-1) where c (A055562) is the sequence of numbers not in a.

Original entry on oeis.org

1, 5, 7, 10, 14, 17, 20, 23, 25, 28, 31, 34, 37, 40, 43, 46, 50, 53, 56, 59, 62, 65, 68, 71, 74, 77, 80, 83, 86, 89, 92, 95, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, 145, 148, 151, 154, 157, 160, 163, 166, 169, 172, 175, 178
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A055562 (complement), A022424.

Programs

  • Magma
    [1] cat [3*n + 2 - (Floor((Log(n)/Log(2))) mod 2): n in [0..10]]; // G. C. Greubel, Mar 08 2018
  • Maple
    A022441 := n-> `if`(n=0, 1, 3*n + 2 - (ilog2(n) mod 2)):
    seq(A022441(n), n= 0..59);
  • Mathematica
    Fold[Append[#1, Plus @@ Complement[Range[Max@#1 + 3], #1][[{#2 + 1, #2 + 2}]]] &, {1, 5}, Range[58]] (* Ivan Neretin, Mar 30 2017 *)
    Table[If[n==0,1, 3*n+2 - Mod[Floor[Log[n]/Log[2]], 2]], {n,0,30}] (* G. C. Greubel, Mar 08 2018 *)
  • PARI
    for(n=0,30, print1(if(n==0,1, 3*n+2 - (floor(log(n)/log(2))%2)), ", ")) \\ G. C. Greubel, Mar 08 2018
    

Formula

a(n) + a(n-1) = 3n + 2 - (floor(log_2 n) mod 2) for n >= 1. - Jeffrey Shallit, Jun 08 2000
For n>0, a(n) = b(n) with b(0)=0, b(2n) = -b(n)+9n+3, b(2n+1) = -b(n)+9n+6-[n==0]. - Ralf Stephan, Oct 24 2003
a(n) = A210770(2*n+1). - Reinhard Zumkeller, Mar 25 2012

Extensions

More terms from Winston C. Yang (winston(AT)cs.wisc.edu), Aug 23 2000
Term a(16)=50 fixed by Ivan Neretin, Mar 30 2017
Updated by Clark Kimberling, Feb 19 2018

A022424 Solution a( ) of the complementary equation a(n) = b(n-1) + b(n-2), where a(0) = 1, a(1) = 2; see Comments.

Original entry on oeis.org

1, 2, 7, 9, 11, 14, 18, 22, 25, 28, 31, 33, 36, 39, 41, 44, 47, 50, 53, 56, 59, 62, 66, 69, 72, 75, 78, 82, 85, 88, 91, 94, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124, 127, 129, 132, 135, 138, 141, 144, 147, 150, 153, 156, 159, 161, 164, 167, 170
Offset: 0

Views

Author

Keywords

Comments

From the Bode-Harborth-Kimberling link:
a(n) = b(n-1) + b(n-2) for n > 2;
b(0) = least positive integer not in {a(0),a(1)};
b(n) = least positive integer not in {a(0),...,a(n),b(0),...,b(n-1)} for n > 1.
Note that (b(n)) is strictly increasing and is the complement of (a(n)).
***
In the following guide to solutions a( ) and b( ) of a(n) = b(n-1) + b(n-2), an asterisk (*) indicates that a( ) differs from the indicated A-sequence in one or two initial terms:
(a(n)) (b(n)) a(0) a(1)
***
Guide to solutions a( ) and b( ) of a(n) = b(n-1) + b(n-2) + b(n-3) for various initial values:
(a(n)) (b(n)) a(0) a(1) a(2)
***
Guide to other complementary equations:
A022427-A022440: a(n) = b(n-1) + b(n-3)
A299531-A299532: a(n) = 2*b(n-1) + b(n-2), a(0) = 1, a(1) = 2
A296220, A299534: a(n) = b(n-1) + 2*b(n-2), a(0) = 1, a(1) = 2
A022437, A299536: a(n) = b(n-1) + b(n-3), a(0) = 1, a(1) = 2, a(2) = 3
A022437, A299538: a(n) = b(n-1) + b(n-3), a(0) = 2, a(1) = 3, a(2) = 4
A022438-A299540: a(n) = b(n-1) + b(n-3), a(0) = 2, a(1) = 3, a(2) = 5
A299541-A299542: a(n) = b(n-1) + b(n-3), a(0) = 2, a(1) = 4, a(2) = 6
A299543-A299544: a(n) = 2*b(n-1) + b(n-2) - b(n-3), a(0) = 1, a(1) = 2, a(2) = 3
A299545-A299546: a(n) = b(n-1) + 2*b(n-2) - b(n-3), a(0) = 1, a(1) = 2, a(2) = 3
A299547: a(n) = b(n-1) + b(n-2) + ... + b(0), a(0) = 1, a(1) = 2, a(2) = 3

Crossrefs

Cf. A055563 (complement), A022425, A299407, A299486-A299494.
Another pair is given in A324142, A324143.

Programs

  • Mathematica
    Fold[Append[#1, Plus @@ Complement[Range[Max@#1 + 3], #1][[{#2, #2 + 1}]]] &, {1, 2}, Range[56]] (* Ivan Neretin, Mar 28 2017 *)

Extensions

Edited by Clark Kimberling, Feb 16 2018

A210770 a(1) = 1, a(2) = 2; for n > 1, a(2*n+2) = smallest number not yet seen, a(2*n+1) = a(2*n) + a(2*n+2).

Original entry on oeis.org

1, 2, 5, 3, 7, 4, 10, 6, 14, 8, 17, 9, 20, 11, 23, 12, 25, 13, 28, 15, 31, 16, 34, 18, 37, 19, 40, 21, 43, 22, 46, 24, 50, 26, 53, 27, 56, 29, 59, 30, 62, 32, 65, 33, 68, 35, 71, 36, 74, 38, 77, 39, 80, 41, 83, 42, 86, 44, 89, 45, 92, 47, 95, 48, 97, 49, 100
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 25 2012

Keywords

Comments

Permutation of natural numbers with inverse A210771.
From Jeffrey Shallit, Jun 18 2021: (Start)
This sequence is "2-sychronized"; there is a 23-state finite automaton that recognizes the base-2 representations of n and a(n), in parallel.
It obeys the identities
a(4n+3) = a(2n+1) - a(4n) + 2 a(4n+2)
a(8n) = 2a(4n)
a(8n+1) = a(2n+1) + 3a(4n)
a(8n+2) = a(2n+1) + 2 a(4n) - a(4n+1) + a(4n+2)
a(8n+4) = a(2n+1) + a(4n+2)
a(8n+5) = 3a(2n+1) - a(4n) +2a(4n+2)
a(8n+6) = 2a(2n+1) - a(4n) + a(4n+2). (End)

Crossrefs

Cf. A064736.

Programs

  • Haskell
    import Data.List (delete)
    a210770 n = a210770_list !! (n-1)
    a210770_list = 1 : 2 : f 1 2 [3..] where
       f u v (w:ws) = u' : w : f u' w (delete u' ws) where u' = v + w
    
  • Python
    def aupton(terms):
        alst, seen = [1, 2], {1, 2}
        for n in range(2, terms, 2):
            anp1 = alst[-1] + 1
            while anp1 in seen: anp1 += 1
            an = alst[n-1] + anp1
            alst, seen = alst + [an, anp1], seen | {an, anp1}
        return alst[:terms]
    print(aupton(67)) # Michael S. Branicky, Jun 18 2021

Formula

a(2*n-1) = A022441(n-1); a(2*n) = A055562(n-1).

Extensions

Definition corrected by Jeffrey Shallit, Jun 18 2021

A055563 a(n) = least number greater than a(n-1) not the sum of an earlier pair of consecutive terms, a(0) = 3.

Original entry on oeis.org

3, 4, 5, 6, 8, 10, 12, 13, 15, 16, 17, 19, 20, 21, 23, 24, 26, 27, 29, 30, 32, 34, 35, 37, 38, 40, 42, 43, 45, 46, 48, 49, 51, 52, 54, 55, 57, 58, 60, 61, 63, 64, 65, 67, 68, 70, 71, 73, 74, 76, 77, 79, 80, 81, 83, 84, 86, 87, 89, 90, 92, 93, 95, 96, 98, 99, 101, 102, 104, 105
Offset: 0

Views

Author

Henry Bottomley, May 26 2000

Keywords

Examples

			a(3) = 6 because a(2) = 5, 6 <> a(0) + a(1) and 6 <> a(1) + a(2);
a(4) = 8 because a(3) = 6, 7 = a(0) + a(1), 8 <> a(0) + a(1), 8 <> a(1) + a(2) and 8 <> a(2) + a(3).
		

Crossrefs

Complement of A022424. See A001651 for a(0) = 1 and A055562 for a(0) = 2.

Formula

a(n) = A022424(n) - a(n-1) for n > 0.
Showing 1-4 of 4 results.