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-10 of 12 results. Next

A256655 R(k), the minimal alternating Fibonacci representation of k, concatenated for k = 0, 1, 2,....

Original entry on oeis.org

0, 1, 2, 3, 5, -1, 5, 8, -2, 8, -1, 8, 13, -5, 1, 13, -3, 13, -2, 13, -1, 13, 21, -8, 1, 21, -8, 2, 21, -5, 21, -5, 1, 21, -3, 21, -2, 21, -1, 21, 34, -13, 1, 34, -13, 2, 34, -13, 3, 34, -13, 5, -1, 34, -8, 34, -8, 1, 34, -8, 2, 34, -5, 34, -5, 1, 34, -3, 34
Offset: 0

Views

Author

Clark Kimberling, Apr 08 2015

Keywords

Comments

Suppose that b = (b(0), b(1), ... ) is an increasing sequence of positive integers satisfying b(0) = 1 and b(n+1) <= 2*b(n) for n >= 0. Let B(n) be the least b(m) >= n. Let R(0) = 1, and for n > 0, let R(n) = B(n) - R(B(n) - n). The resulting sum of the form R(n) = B(n) - B(m(1)) + B(m(2)) - ... + ((-1)^k)*B(k) is introduced here as the minimal alternating b-representation of n. The sum B(n) + B(m(2)) + ... we call the positive part of R(n), and the sum B(m(1)) + B(m(3)) + ... , the nonpositive part of R(n). The number ((-1)^k)*B(k) is the trace of n.
If b(n) = F(n+2), where F = A000045, then the sum is the minimal alternating Fibonacci-representation of n.

Examples

			R(0) = 0
R(1) = 1
R(2) = 2
R(3) = 3
R(4) = 5 - 1
R(9) = 13 - 5 + 1
R(25) = 34 - 13 + 5 - 1
R(64) = 89 - 34 + 13 - 5 + 1
		

Crossrefs

Cf. A000045, A255973 (trace), A256656 (numbers with positive trace), A256657 (numbers with nonpositive trace), A256663 (positive part of R(n)), A256664 (nonpositive part of R(n)), A256654, A256696 (minimal alternating binary representations), A255974 (minimal alternating triangular-number representations), A256789 (minimal alternating squares representations).

Programs

  • Mathematica
    f[n_] = Fibonacci[n]; ff = Table[f[n], {n, 1, 70}];
    s[n_] := Table[f[n + 2], {k, 1, f[n]}];
    h[0] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[12]; r[0] = {0};
    r[n_] := If[MemberQ[ff, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Flatten[Table[r[n], {n, 0, 60}]]

Formula

R(F(k)^2) = F(2k-1) - F(2k-3) + F(2k-5) - ... + d*F(5) + (-1)^k, where d = (-1)^(k+1).

A255974 R(k), the minimal alternating triangular-number representation of k, concatenated for k = 0, 1, 2,....

Original entry on oeis.org

0, 1, 3, -1, 3, 6, -3, 1, 6, -1, 6, 10, -3, 10, -3, 1, 10, -1, 10, 15, -6, 3, -1, 15, -3, 15, -3, 1, 15, -1, 15, 21, -6, 1, 21, -6, 3, -1, 21, -3, 21, -3, 1, 21, -1, 21, 28, -6, 28, -6, 1, 28, -6, 3, -1, 28, -3, 28, -3, 1, 28, -1, 28, 36, -10, 3, 36, -6, 36
Offset: 0

Views

Author

Clark Kimberling, Apr 11 2015

Keywords

Comments

Suppose that b = (b(0), b(1), ... ) is an increasing sequence of positive integers satisfying b(0) = 1 and b(n+1) <= 2*b(n) for n >= 0. Let B(n) be the least b(m) >= n. Let R(0) = 1, and for n > 0, let R(n) = B(n) - R(B(n) - n). The resulting sum of the form R(n) = B(n) - B(m(1)) + B(m(2)) - ... + ((-1)^k)*B(k) is the minimal alternating b-representation of n. The sum B(n) + B(m(2)) + ... is the positive part of R(n), and the sum B(m(1)) + B(m(3)) + ... , the nonpositive part of R(n). The number ((-1)^k)*B(k) is the trace of n. If b(n) = n(n+1)/2, the n-th triangular number, then the sum R(n) is the minimal alternating triangular-number representation of n.

Examples

			R(0) = 0
R(1) = 1
R(2) = 3 - 1
R(3) = 3
R(4) = 6 - 3 + 1
R(5) = 6 - 1
R(8) = 10 - 3 + 1
R(11) = 15 - 6 + 3 - 1
		

Crossrefs

Cf. A000217, A256655 (Fibonacci based), A256696 (binary), A256789 (squares).

Programs

  • Mathematica
    b[n_] := n (n + 1)/2; bb = Table[b[n], {n, 0, 1000}];
    s[n_] := Table[b[n], {k, 1, n}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]]
    t = Table[r[n], {n, 0, 120}]  (* A255974 actual representations *)
    Flatten[t]  (* A255974 sequence *)

A256913 Enhanced squares representations for k = 0, 1, 2, ..., concatenated.

Original entry on oeis.org

0, 1, 2, 3, 4, 4, 1, 4, 2, 4, 3, 4, 3, 1, 9, 9, 1, 9, 2, 9, 3, 9, 4, 9, 4, 1, 9, 4, 2, 16, 16, 1, 16, 2, 16, 3, 16, 4, 16, 4, 1, 16, 4, 2, 16, 4, 3, 16, 4, 3, 1, 25, 25, 1, 25, 2, 25, 3, 25, 4, 25, 4, 1, 25, 4, 2, 25, 4, 3, 25, 4, 3, 1, 25, 9, 25, 9, 1, 36
Offset: 0

Views

Author

Clark Kimberling, Apr 14 2015

Keywords

Comments

Let B = {0,1,2,3,4,9,16,25,...}, so that B consists of the squares together with 2 and 3. We call B the enhanced basis of squares. Define R(0) = 0 and R(n) = g(n) + R(n - g(n)) for n > 0, where g(n) is the greatest number in B that is <= n. Thus, each n has an enhanced squares representation of the form R(n) = b(m(n)) + b(m(n-1)) + ... + b(m(k)), where b(n) > m(n-1) > ... > m(k) > 0, in which the last term, b(m(k)), is the trace.
The least n for which R(n) has 5 terms is given by R(168) = 144 + 16 + 4 + 3 + 1.
The least n for which R(n) has 6 terms is given by R(7224) = 7056 + 144 + 16 + 4 + 3 + 1.

Examples

			R(0) = 0
R(1) = 1
R(2) = 2
R(3) = 3
R(4) = 4
R(8) = 4 + 3 + 1
R(24) = 16 + 4 + 3 + 1
		

Crossrefs

Cf. A000290, A256914 (trace), A256915 (number of terms), A256789 (minimal alternating squares representations).
Cf. A257053 (primes).

Programs

  • Haskell
    a256913 n k = a256913_tabf !! n !! k
    a256913_row n = a256913_tabf !! n
    a256913_tabf = [0] : tail esr where
       esr = (map r [0..8]) ++
               f 9 (map fromInteger $ drop 3 a000290_list) where
         f x gs@(g:hs@(h:_))
           | x < h   = (g : genericIndex esr (x - g)) : f (x + 1) gs
           | otherwise = f x hs
         r 0 = []; r 8 = [4, 3, 1]
         r x = q : r (x - q) where q = [0,1,2,3,4,4,4,4,4] !! x
    -- Reinhard Zumkeller, Apr 15 2015
  • Mathematica
    b[n_] := n^2; bb = Insert[Table[b[n], {n, 0, 100}]  , 2, 3];
    s[n_] := Table[b[n], {k, 1, 2 n + 1}];
    h[1] = {0, 1, 2, 3}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; Take[g, 100]
    r[0] = {0}; r[1] = {1}; r[2] = {2}; r[3] = {3}; r[8] = {4, 3, 1};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];
    t = Table[r[n], {n, 0, 120}] (* A256913, before concatenation *)
    Flatten[t]  (* A256913 *)
    Table[Last[r[n]], {n, 0, 120}]    (* A256914 *)
    Table[Length[r[n]], {n, 0, 200}]  (* A256915 *)

A256791 Trace of n in the minimal alternating squares representation of n.

Original entry on oeis.org

0, 1, -2, -1, 4, -4, 1, 2, -1, 9, -1, 4, -4, 1, 2, -1, 16, 1, -2, -1, 4, -4, 1, 2, -1, 25, 1, -9, 1, -2, -1, 4, -4, 1, 2, -1, 36, 4, -4, 1, -9, 1, -2, -1, 4, -4, 1, 2, -1, 49, -2, -1, 4, -4, 1, -9, 1, -2, -1, 4, -4, 1, 2, -1, 64, -16, 1, -2, -1, 4, -4, 1, -9
Offset: 0

Views

Author

Clark Kimberling, Apr 13 2015

Keywords

Comments

See A256789 for definitions.
For each positive integer m, the list of 2m numbers between m^2 and (m+1)^2 is repeated between (m+1)^2 and (m+2)^2. Consequently, a limiting sequence is formed by reversing the repeated lists. The limiting sequence is -1, 2, 1, -4, 4, -1, -2, 1, -9, 1, -4, 4, -1, -2, 1, -16, ...

Examples

			R(0) = 0, so a(0) = 0;
R(1) = 1, so a(1) = 1;
R(2) = 4 - 2, so a(2) = -2;
R(7) = 9 - 4 + 2, so a(7) = 2;
R(89) = 100 - 16 + 9 - 4, so a(89) = -4.
		

Crossrefs

Cf. A256789.

Programs

  • Mathematica
    b[n_] := n^2; bb = Table[b[n], {n, 0, 1000}];
    s[n_] := Table[b[n], {k, 1, 2 n - 1}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, -2};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[r[n], {n, 0, 120}] (* A256789 *)
    Flatten[Table[Last[r[n]], {n, 0, 100}]]  (* A256791 *)

A256792 Numbers whose minimal alternating squares representation has positive trace.

Original entry on oeis.org

1, 4, 6, 7, 9, 11, 13, 14, 16, 17, 20, 22, 23, 25, 26, 28, 31, 33, 34, 36, 37, 39, 41, 44, 46, 47, 49, 52, 54, 56, 59, 61, 62, 64, 66, 69, 71, 73, 76, 78, 79, 81, 82, 85, 88, 90, 92, 95, 97, 98, 100, 102, 103, 106, 109, 111, 113, 116, 118, 119, 121, 123, 125
Offset: 1

Views

Author

Clark Kimberling, Apr 13 2015

Keywords

Comments

See A256789 for definitions.

Examples

			R(1) = 1; trace = 1, positive.
R(2) = 4 - 2; trace = -2, negative.
R(3) = 4 - 1; trace = -1, negative.
		

Crossrefs

Cf. A256789, A256793 (complement).

Programs

  • Mathematica
    b[n_] := n^2; bb = Table[b[n], {n, 0, 1000}];
    s[n_] := Table[b[n], {k, 1, 2 n - 1}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, -2};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[r[n], {n, 0, 120}] (* A256789 *)
    u = Flatten[Table[Last[r[n]], {n, 1, 1000}]];  (* A256791 *)
    Select[Range[800], u[[#]] > 0 &] (* A256792 *)
    Select[Range[800], u[[#]] < 0 &] (* A256793 *)

A256793 Numbers whose minimal alternating squares representation has positive trace.

Original entry on oeis.org

2, 3, 5, 8, 10, 12, 15, 18, 19, 21, 24, 27, 29, 30, 32, 35, 38, 40, 42, 43, 45, 48, 50, 51, 53, 55, 57, 58, 60, 63, 65, 67, 68, 70, 72, 74, 75, 77, 80, 83, 84, 86, 87, 89, 91, 93, 94, 96, 99, 101, 104, 105, 107, 108, 110, 112, 114, 115, 117, 120, 122, 124
Offset: 1

Views

Author

Clark Kimberling, Apr 13 2015

Keywords

Comments

See A256789 for definitions.

Examples

			R(1) = 1; trace = 1, positive.
R(2) = 4 - 2; trace = -2, negative.
R(3) = 4 - 1; trace = -1, negative.
		

Crossrefs

Cf. A256789, A256792 (complement).

Programs

  • Mathematica
    b[n_] := n^2; bb = Table[b[n], {n, 0, 1000}];
    s[n_] := Table[b[n], {k, 1, 2 n - 1}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, -2};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[r[n], {n, 0, 120}] (* A256789 *)
    u = Flatten[Table[Last[r[n]], {n, 1, 1000}]];  (* A256791 *)
    Select[Range[800], u[[#]] > 0 &] (* A256792 *)
    Select[Range[800], u[[#]] < 0 &] (* A256793 *)

A256790 Number of terms in the minimal alternating squares representation of n.

Original entry on oeis.org

1, 1, 2, 2, 1, 2, 3, 3, 2, 1, 4, 3, 2, 3, 3, 2, 1, 3, 4, 4, 3, 2, 3, 3, 2, 1, 5, 2, 3, 4, 4, 3, 2, 3, 3, 2, 1, 3, 4, 5, 2, 3, 4, 4, 3, 2, 3, 3, 2, 1, 4, 4, 3, 4, 5, 2, 3, 4, 4, 3, 2, 3, 3, 2, 1, 2, 3, 4, 4, 3, 4, 5, 2, 3, 4, 4, 3, 2, 3, 3, 2, 1, 5, 4, 2, 3
Offset: 0

Views

Author

Clark Kimberling, Apr 13 2015

Keywords

Comments

See A256789 for definitions.

Examples

			R(0) = 0, so a(0) = 1;
R(1) = 1, so a(1) = 1;
R(2) = 4 - 2, so a(2) = 2;
R(7) = 9 - 4 + 2, so a(7) = 3;
R(89) = 100 - 16 + 9 - 4, so a(89) = 4.
		

Crossrefs

Cf. A256789.

Programs

  • Mathematica
    b[n_] := n^2; bb = Table[b[n], {n, 0, 1000}];
    s[n_] := Table[b[n], {k, 1, 2 n - 1}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, -2};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[r[n], {n, 0, 120}] (* A256789 *)
    Flatten[Table[Length[r[n]], {n, 0, 1000}]]  (* A256790 *)

A256794 First differences of A256792.

Original entry on oeis.org

3, 2, 1, 2, 2, 2, 1, 2, 1, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 2, 3, 2, 1, 2, 3, 2, 2, 3, 2, 1, 2, 2, 3, 2, 2, 3, 2, 1, 2, 1, 3, 3, 2, 2, 3, 2, 1, 2, 2, 1, 3, 3, 2, 2, 3, 2, 1, 2, 2, 2, 1, 3, 3, 2, 2, 3, 2, 1, 2, 1, 3, 2, 1, 3, 3, 2, 2, 3, 2, 1, 2, 3, 3, 2
Offset: 1

Views

Author

Clark Kimberling, Apr 13 2015

Keywords

Examples

			R(0) = 0;
R(1) = 1;
R(2) = 4 - 2;
R(3) = 4 - 1;
R(4) = 4;
R(5) = 9 - 4.
		

Crossrefs

Programs

  • Mathematica
    b[n_] := n^2; bb = Table[b[n], {n, 0, 1000}];  (* Squares as base *)
    s[n_] := Table[b[n], {k, 1, 2 n - 1}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, -2};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[r[n], {n, 0, 120}]; (* A256789 *)
    u = Flatten[Table[Last[r[n]], {n, 1, 1000}]];  (* A256791 *)
    u1 = Select[Range[800], u[[#]] > 0 &]; (* A256792 *)
    u2 = Select[Range[800], u[[#]] < 0 &]; (* A256793 *)
    Differences[u1]  (* A256794 *)
    Differences[u2]  (* A256795 *)

A256795 Difference sequence of A256793.

Original entry on oeis.org

1, 2, 3, 2, 2, 3, 3, 1, 2, 3, 3, 2, 1, 2, 3, 3, 2, 2, 1, 2, 3, 2, 1, 2, 2, 2, 1, 2, 3, 2, 2, 1, 2, 2, 2, 1, 2, 3, 3, 1, 2, 1, 2, 2, 2, 1, 2, 3, 2, 3, 1, 2, 1, 2, 2, 2, 1, 2, 3, 2, 2, 3, 1, 2, 1, 2, 2, 2, 1, 2, 3, 3, 1, 2, 3, 1, 2, 1, 2, 2, 2, 1, 2, 3, 2, 1
Offset: 1

Views

Author

Clark Kimberling, Apr 13 2015

Keywords

Comments

These are the numbers of consecutive positive traces when the minimal alternating squares representations for positive integers are written in order. Is every term < 5? The first term greater than 3 is a(116) = 4, corresponding to these 3 consecutive representations:
R(225) = 225;
R(226) = 256 - 36 + 9 - 4 + 1;
R(227) = 256 - 36 + 9 - 4 + 2.
(See A256789 for definitions.)

Crossrefs

Programs

  • Mathematica
    b[n_] := n^2; bb = Table[b[n], {n, 0, 1000}];  (* Squares as base *)
    s[n_] := Table[b[n], {k, 1, 2 n - 1}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, -2};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[r[n], {n, 0, 120}]; (* A256789 *)
    u = Flatten[Table[Last[r[n]], {n, 1, 1000}]];  (* A256791 *)
    u1 = Select[Range[800], u[[#]] > 0 &]; (* A256792 *)
    u2 = Select[Range[800], u[[#]] < 0 &]; (* A256793 *)
    Differences[u1]  (* A256794 *)
    Differences[u2]  (* A256795 *)

A256796 Positive part of the minimal alternating squares representation of n.

Original entry on oeis.org

1, 4, 4, 4, 9, 10, 11, 9, 9, 20, 20, 16, 17, 18, 16, 16, 26, 29, 29, 29, 25, 26, 27, 25, 25, 46, 36, 37, 40, 40, 40, 36, 37, 38, 36, 36, 53, 58, 59, 49, 50, 53, 53, 53, 49, 50, 51, 49, 49, 68, 68, 68, 73, 74, 64, 65, 68, 68, 68, 64, 65, 66, 64, 64, 81, 82
Offset: 1

Views

Author

Clark Kimberling, Apr 13 2015

Keywords

Comments

See A256789 for definitions.

Examples

			R(1) = 1, positive part 1, nonpositive part 0;
R(2) = 4 - 2, positive part 4, nonpositive part 2;
R(3) = 4 - 1, positive part 4, nonpositive part 1;
R(89) = 100 - 16 + 9 - 4, positive part 100 + 9 = 109, nonpositive part 16 + 4 = 20.
		

Crossrefs

Programs

  • Mathematica
    b[n_] := n^2; bb = Table[b[n], {n, 0, 100}];
    s[n_] := Table[b[n], {k, 1, 2 n - 1}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, -2};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    t = Table[r[n], {n, 1, z}] (* A256789 *)
    Table[Total[(Abs[r[n]] + r[n])/2], {n, 1, 120}]  (* A256796 *)
    Table[Total[(Abs[r[n]] - r[n])/2], {n, 1, 120}]  (* A256797 *)
Showing 1-10 of 12 results. Next