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 14 results. Next

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

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Apr 13 2015

Keywords

Comments

Let B(n) be the least square >= n. The minimal alternating squares representation of a nonnegative integer n is defined as the sum B(n) - B(m(1)) + B(m(2)) + ... + d*B(m(k)) that results from the recurrence R(n) = B(n) - R(B(n) - n), with initial representations R(0) = 0, R(1) = 1, and R(2) = 4 - 2. The sum B(n) + B(m(2)) + ... is the positive part of R(n), and the sum B(m(1)) + B(m(3)) + ... is the nonpositive part of R(n). The last term of R(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.
Unlike minimal alternating representations for other bases (e.g., Fibonacci numbers, A256655; binary, A256696, triangular numbers, A244974), the trace of a minimal alternating squares representation is not necessarily a member of the base; specifically, the trace can be -2 or 2, which are not squares.

Examples

			R(0) = 0
R(1) = 1
R(2) = 4 - 2
R(3) = 4 - 1
R(4) = 4
R(5) = 9 - 4
R(6) = 9 - 4 + 1
R(7) = 9 - 4 + 2
R(89) = 100 - 16 + 9 - 4
		

Crossrefs

Cf. A000290, A256655, A256696, A244974, A256790 (number of terms), A256791 (trace).

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, individual representations *)
    Flatten[Table[r[n], {n, 0, 120}]] (* A256789, concatenated representations *)

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 *)

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

Original entry on oeis.org

0, 1, 2, 4, -1, 4, 8, -4, 1, 8, -2, 8, -1, 8, 16, -8, 1, 16, -8, 2, 16, -8, 4, -1, 16, -4, 16, -4, 1, 16, -2, 16, -1, 16, 32, -16, 1, 32, -16, 2, 32, -16, 4, -1, 32, -16, 4, 32, -16, 8, -4, 1, 32, -16, 8, -2, 32, -16, 8, -1, 32, -8, 32, -8, 1, 32, -8, 2, 32
Offset: 0

Views

Author

Clark Kimberling, Apr 09 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) = 2^n, the sum R(n) is the minimal alternating binary representation of n.
A055975 = trace of n, for n >= 1.
A091072 gives the numbers having positive trace.
A091067 gives the numbers having negative trace.
A072339 = number of terms in R(n).
A073122 = sum of absolute values of the terms in R(n).

Examples

			R(0) = 0
R(1) = 1
R(2) = 2
R(3) = 4 - 1
R(4) = 4
R(9) = 8 - 4 + 1
R(11) = 16 - 8 + 4 - 1
		

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1981, Vol. 2 (2nd ed.), p. 196, Exercise 27.

Crossrefs

Programs

  • Mathematica
    z = 100; b[n_] := 2^n; bb = Table[b[n], {n, 0, 40}];
    s[n_] := Table[b[n + 1], {k, 1, b[n]}];
    h[0] = {1}; h[n_] := Join[h[n - 1], s[n - 1]];
    g = h[10]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]]
    u = Flatten[Table[r[n], {n, 0, z}]]

A256656 Numbers for which the minimal alternating Fibonacci representation has positive trace.

Original entry on oeis.org

1, 2, 3, 5, 8, 9, 13, 14, 15, 17, 21, 22, 23, 24, 27, 28, 30, 34, 35, 36, 37, 39, 43, 44, 45, 48, 49, 51, 55, 56, 57, 58, 60, 63, 64, 69, 70, 71, 73, 77, 78, 79, 82, 83, 85, 89, 90, 91, 92, 94, 97, 98, 102, 103, 104, 106, 111, 112, 113, 115, 118, 119, 124
Offset: 1

Views

Author

Clark Kimberling, Apr 08 2015

Keywords

Comments

See A256655 for definitions. This sequence and A256657 partition the positive integers.

Examples

			Let R(k) be the minimal alternating Fibonacci representation of k.  The trace of R(k) is the last term.
R(1) = 1, trace = 1
R(2) = 2, trace = 2
R(3) = 3, trace = 3
R(4) = 5 - 1, trace = -1
R(5) = 5, trace = 5
R(6) = 6 - 2, trace =  -2
		

Crossrefs

Programs

  • Mathematica
    b[n_] = Fibonacci[n]; bb = Table[b[n], {n, 1, 70}];
    h[0] = {1}; h[n_] := Join[h[n - 1], Table[b[n + 2], {k, 1, b[n]}]];
    g = h[18];  r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]]
    t = Table[Last[r[n]], {n, 0, 1000}];  (* A256656 *)
    Select[Range[200], Last[r[#]] > 0 &]  (* A256656 *)
    Select[Range[200], Last[r[#]] < 0 &]  (* A256657 *)

A256654 Least Fibonacci number not less than n.

Original entry on oeis.org

1, 2, 3, 5, 5, 8, 8, 8, 13, 13, 13, 13, 13, 21, 21, 21, 21, 21, 21, 21, 21, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89
Offset: 1

Views

Author

Clark Kimberling, Apr 08 2015

Keywords

Comments

This sequence plays a role in the definition of minimal alternating Fibonacci representations, introduced at A256655.
Essentially the same as A246104. - R. J. Mathar, Apr 14 2015

Crossrefs

Programs

  • Mathematica
    h[0] = {1}; h[n_] := Join[h[n - 1], Table[Fibonacci[n + 2], {k, 1, Fibonacci[n]}]]; h[10]

Formula

Concatenate these numbers: F(2), F(3), F(4), then F(3) F(5)'s, then F(4) F(6)'s, then F(5) F(7)'s, ... F(n+2) F(n)'s, ..., where F = A000045, the Fibonacci numbers.
Sum_{n>=1} 1/a(n)^2 = 1 + Sum_{n>=1} F(n)/F(n+2)^2 = 1.5651369873... . - Amiram Eldar, Aug 16 2022

A256663 Nonnegative part of the minimal alternating Fibonacci representation of n.

Original entry on oeis.org

0, 1, 2, 3, 5, 5, 8, 8, 8, 14, 13, 13, 13, 13, 22, 23, 21, 22, 21, 21, 21, 21, 35, 36, 37, 39, 34, 35, 36, 34, 35, 34, 34, 34, 34, 56, 57, 58, 60, 60, 63, 63, 55, 56, 57, 58, 60, 55, 56, 57, 55, 56, 55, 55, 55, 55, 90, 91, 92, 94, 94, 97, 97, 97, 103, 102
Offset: 0

Views

Author

Clark Kimberling, Apr 08 2015

Keywords

Comments

See A256655 for definitions.

Examples

			R(9) = 13 - 5 + 1, so that a(9) = 13 + 1 = 14.
		

Crossrefs

Programs

  • Mathematica
    b[n_] = Fibonacci[n]; bb = Table[b[n], {n, 1, 70}];
    h[0] = {1}; h[n_] := Join[h[n - 1], Table[b[n + 2], {k, 1, b[n]}]];
    g = h[23];
    r[0] = {0}; r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[Total[Abs[r[n]]], {n, 0, 100}] (* A256662 *)
    Table[Total[(Abs[r[n]] + r[n])/2], {n, 0, 100}]  (* A256663 *)
    Table[Total[(Abs[r[n]] - r[n])/2], {n, 0, 100}]  (* A256664 *)

Formula

A256663(n) - A256664(n) = n.

A256664 Nonpositive part of the minimal alternating Fibonacci representation of n.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 2, 1, 0, 5, 3, 2, 1, 0, 8, 8, 5, 5, 3, 2, 1, 0, 13, 13, 13, 14, 8, 8, 8, 5, 5, 3, 2, 1, 0, 21, 21, 21, 22, 21, 23, 22, 13, 13, 13, 13, 14, 8, 8, 8, 5, 5, 3, 2, 1, 0, 34, 34, 34, 35, 34, 36, 35, 34, 39, 37, 36, 35, 21, 21, 21, 21, 22, 21, 23
Offset: 0

Views

Author

Clark Kimberling, Apr 08 2015

Keywords

Comments

See A256655 for definitions.

Examples

			R(9) = 13 - 5 + 1, so that a(9) = 5.
		

Crossrefs

Programs

  • Mathematica
    b[n_] = Fibonacci[n]; bb = Table[b[n], {n, 1, 70}];
    h[0] = {1}; h[n_] := Join[h[n - 1], Table[b[n + 2], {k, 1, b[n]}]];
    g = h[23];  r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[Total[Abs[r[n]]], {n, 0, 100}] (* A256662 *)
    Table[Total[(Abs[r[n]] + r[n])/2], {n, 0, 100}]  (* A256663 *)
    Table[Total[(Abs[r[n]] - r[n])/2], {n, 0, 100}]  (* A256664 *)

Formula

A256663(n) - A256664(n) = n.

A256657 Numbers for which the minimal alternating Fibonacci representation has negative trace.

Original entry on oeis.org

4, 6, 7, 10, 11, 12, 16, 18, 19, 20, 25, 26, 29, 31, 32, 33, 38, 40, 41, 42, 46, 47, 50, 52, 53, 54, 59, 61, 62, 65, 66, 67, 68, 72, 74, 75, 76, 80, 81, 84, 86, 87, 88, 93, 95, 96, 99, 100, 101, 105, 107, 108, 109, 110, 114, 116, 117, 120, 121, 122, 123, 127
Offset: 1

Views

Author

Clark Kimberling, Apr 08 2015

Keywords

Comments

See A256655 for definitions. This sequence and A256656 partition the positive integers.

Examples

			Let R(k) be the minimal alternating Fibonacci representation of k.  The trace of R(k) is the last term.
R(1) = 1, trace = 1
R(2) = 2, trace = 2
R(3) = 3, trace = 3
R(4) = 5 - 1, trace = -1
R(5) = 5, trace = 5
R(6) = 6 - 2, trace = -2
		

Crossrefs

Programs

  • Mathematica
    b[n_] = Fibonacci[n]; bb = Table[b[n], {n, 1, 70}];
    h[0] = {1}; h[n_] := Join[h[n - 1], Table[b[n + 2], {k, 1, b[n]}]];
    g = h[18];  r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]]
    t = Table[Last[r[n]], {n, 0, 1000}];  (* A256656 *)
    Select[Range[200], Last[r[#]] > 0 &]  (* A256656 *)
    Select[Range[200], Last[r[#]] < 0 &]  (* A256657 *)

A256662 Sum of absolute values of terms in the minimal alternating Fibonacci representation of n.

Original entry on oeis.org

0, 1, 2, 3, 6, 5, 10, 9, 8, 19, 16, 15, 14, 13, 30, 31, 26, 27, 24, 23, 22, 21, 48, 49, 50, 53, 42, 43, 44, 39, 40, 37, 36, 35, 34, 77, 78, 79, 82, 81, 86, 85, 68, 69, 70, 71, 74, 63, 64, 65, 60, 61, 58, 57, 56, 55, 124, 125, 126, 129, 128, 133, 132, 131
Offset: 0

Views

Author

Clark Kimberling, Apr 08 2015

Keywords

Comments

The terms are distinct. See A256655 for definitions.

Examples

			Minimal alternating Fibonacci representations:
R(0) = 0
R(1) = 1
R(2) = 2
R(3) = 3
R(4) = 5 - 1, so that a(4) = 6.
R(9) = 13 - 5 + 1, so that a(9) = 19.
		

Crossrefs

Programs

  • Mathematica
    b[n_] = Fibonacci[n]; bb = Table[b[n], {n, 1, 70}];
    h[0] = {1}; h[n_] := Join[h[n - 1], Table[b[n + 2], {k, 1, b[n]}]];
    g = h[23];  r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[Total[Abs[r[n]]], {n, 0, 100}] (* A256662 *)
    Table[Total[(Abs[r[n]] + r[n])/2], {n, 0, 100}]  (* A256663 *)
    Table[Total[(Abs[r[n]] - r[n])/2], {n, 0, 100}]  (* A256664 *)

A255973 Trace of the minimal alternating Fibonacci representation of n.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Apr 08 2015

Keywords

Comments

See A256655 for definitions.

Examples

			Let R(k) be the minimal alternating Fibonacci representation of k.  The trace of R(k) is the last term.
R(1) = 1, trace = 1
R(2) = 2, trace = 2
R(3) = 3, trace = 3
R(4) = 5 - 1, trace = -1
R(5) = 5, trace = 5
R(6) = 6 - 2, trace = -2
		

Crossrefs

Cf. A000045, A256655 (representations R(n)), A256656 (numbers with positive trace), A256657 (numbers with nonpositive trace), A256663 (positive part of R(n)), A256664 (nonpositive part of R(n)), A256654.

Programs

  • Mathematica
    b[n_] = Fibonacci[n]; bb = Table[b[n], {n, 1, 70}];
    h[0] = {1}; h[n_] := Join[h[n - 1], Table[b[n + 2], {k, 1, b[n]}]];
    g = h[12];  r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
    Table[Last[r[n]], {n, 0, 200}]  (* A255973 *)
Showing 1-10 of 14 results. Next