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-2 of 2 results.

A308306 Boomerang numbers: their last digit "comes back" to occupy the place of their first digit (see the Comments section for the explanation).

Original entry on oeis.org

100, 203, 225, 230, 247, 252, 269, 274, 296, 302, 320, 405, 427, 449, 450, 472, 494, 504, 522, 540, 607, 629, 670, 692, 706, 724, 742, 760, 809, 890, 908, 926, 944, 962, 980, 1012, 1021, 1034, 1043, 1056, 1065, 1078, 1087, 1102, 1120, 1201, 1210, 1223, 1232, 1245, 1254, 1267, 1276, 1289, 1298, 1304, 1322, 1340, 1403, 1425, 1430
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, May 19 2019

Keywords

Comments

Take 2019; start with 2; jump over 2 cells to the right (as the even digits always move to the right); write 0 on the landing cell; jump over 0 cell to the right (which is the same as moving to the next cell to the right) and write 1 on the landing cell; as 1 is odd, jump over 1 cell to the left; write 9 on the landing cell; jump now over 9 cells to the left and mark A (for "Arrival") on the landing cell. The result will look like this (a dot is a cell): A.......2.901
As this A cell is not the same as the starting one (with "2"), 2019 is not a boomerang number. If we had taken 2011, we would have come back on the starting 2, like this:
2011
2..0
2..01
2.101
A.101
This is why 2011 is in the sequence and 2019 not.
Note that a cell, empty or not, is only a stopover: it can be used several times by different digits.
There are 263499 boomerang numbers < 10^7.
A boomerang number is easy to find, knowing the hereunder definition:
Integers B such that (the number of even digits + the sum of those) = (the number of odd digits + the sum of those).
Note: this sequence is not related to A256174 ("Boomerang fractions").

Examples

			7308403 is a boomerang number as we have 4 even digits with sum 12 (4+12=16) and 3 odd digits with sum 13 (3+13=16).
		

Crossrefs

CF. A325775 and A325776 which play with the same concept.

A261527 Irregular triangular array giving minimum number of reciprocal steps in the boomerang fractions process needed to return to 1 if a returning path exists, otherwise 0.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4, 1, 1, 1, 2, 1, 1, 1, 1, 2, 20, 1, 1, 1, 4, 1, 1, 1, 2, 2, 1, 2, 24, 2
Offset: 1

Views

Author

William P. Orrick, Aug 21 2015

Keywords

Comments

The boomerang fractions process is defined as follows. Fix a rational number q, 0
Let q(n) be the n-th rational number in the interval (0,1) in the canonical ordering, that is, q(n)=A038566(n+1)/A038567(n+1). Then a(n) is obtained by applying the sequence definition with q=q(n).
The value of a(n) is 1 if and only if q(n) is the difference of two unit fractions.
If q(m) = k q(n) for some positive integer k, then a(n) <= a(m).
The first rational number in the canonical ordering for which it is not known whether a(n) is nonzero is q(40)=9/11. If a(40) is nonzero, then a(40) >= 55.

Examples

			a(1) = 1 since q(1) = 1/2 and there is the returning path 1 --> 1+2*(1/2) = 2 --> 1/2 --> 1/2+1/2 = 1, which uses the reciprocal operation once.
a(8) = 2 since q(8) = 3/5, which cannot be written as the difference of two unit fractions (ruling out a(8) = 1) and because there is the returning path 1 --> 1+15*(3/5) = 10 --> 1/10 --> 1/10+4*(3/5) = 5/2 --> 2/5 --> 2/5+3/5 = 1, which uses the reciprocal operation twice.
Triangle starts:
1;
1, 1;
1, 1;
1, 1, 2, 1;
1, 1;
1, 1, 1, 2, 4, 1;
1, 1, 2, 1;
1, 1, 1, 2, 20, 1;
1, 1, 4, 1;
1, 1, 2, 2, 1, 2, 24, 2,
...
		

Crossrefs

Cf. A256174.

Programs

  • Mathematica
    (* In the following code, Alpha is the operation "add q" and Beta is the operation "take the reciprocal and add q". The set L(j) is defined to be the set of positive rational numbers r such that there is a path from r to 1 that uses Beta exactly j times. The program computes L(1), L(2), and so on, until an L(j) is found that contains 1, in which case it returns j, or until maxIterations is exceeded, in which case it returns 0. The function iterateUntilOne can generate the result for all q up to 6/11 rather quickly, but for q = 7/11, which corresponds to a(38) = 24, it requires considerable time; it is not capable of ruling out the existence of a returning path that uses Beta more than maxIterations times. *)
    applyBetaInverse[q_, x_] := 1/(x - q)
    applyAlphaPowerInverse[q_, x_] :=
    Table[x - q j, {j, 0, Ceiling[x/q] - 1}]
    iterateUntilOne[q_, maxIterations_] :=
    Module[{list, listOld, oneFound, it, betaInverseResult},
      listOld = Flatten[applyAlphaPowerInverse[q, #] & /@ {1}];
      oneFound = False;
      For[it = 1, ! oneFound && it <= maxIterations, it++,
       betaInverseResult =
        applyBetaInverse[q, #] & /@ Select[listOld, # > q &];
       list = Flatten[applyAlphaPowerInverse[q, #] & /@ betaInverseResult];
       oneFound = MemberQ[list, 1];
       Print["L(", it, ") : length ", Length[list],
        If[oneFound, ", contains 1", ", does not contain 1"]];
       listOld = list
       ];
      If[oneFound,
       it - 1,
       0
       ]
      ]
    iterateUntilOne[#, 20] & /@Flatten[Join[
      Table[Select[Range[1, d], CoprimeQ[d, #] &]/d, {d, 2, 10}],
      Range[1, 6]/11]]
Showing 1-2 of 2 results.