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: Marcus Hedbring

Marcus Hedbring's wiki page.

Marcus Hedbring has authored 3 sequences.

A225539 Numbers n where 2^n and n have the same digital root.

Original entry on oeis.org

5, 16, 23, 34, 41, 52, 59, 70, 77, 88, 95, 106, 113, 124, 131, 142, 149, 160, 167, 178, 185, 196, 203, 214, 221, 232, 239, 250, 257, 268, 275, 286, 293, 304, 311, 322, 329, 340, 347, 358, 365, 376, 383, 394, 401, 412, 419, 430, 437, 448
Offset: 1

Author

Marcus Hedbring, May 17 2013

Keywords

Comments

The digital roots of n have a cycle length of 9 (A010888) and the digital roots of 2^n have a cycle length of 6 (A153130). Therefore, if n is a term so is n+18.
The only values of the digital roots of a(n) are 5 and 7 (A010718).

Examples

			For n=23, the digital root of n is 5. 2^n equals 8388608 so the digital root of 2^n is 5 as well.
		

Crossrefs

Programs

  • Mathematica
    digitalRoot[n_] :=  Module[{r = n}, While[r > 9, r = Total[IntegerDigits[ r]]]; r]; Select[Range[448], digitalRoot[2^#] == digitalRoot[#] &] (* T. D. Noe, May 19 2013 *)
    LinearRecurrence[{1,1,-1},{5,16,23},60] (* Harvey P. Dale, Dec 29 2018 *)
  • PARI
    forstep(n=16,500,[7,11],print1(n", ")) \\ Charles R Greathouse IV, May 19 2013

Formula

a(n) = 9*n - 3 + (-1)^n.
a(n) = a(n-1) + 7 (odd n), a(n) = a(n-1) + 11 (even n) with a(1) = 5.
G.f. x*(5 + 11*x + 2*x^2) / ((1-x)^2 * (1+x)). - Joerg Arndt, May 17 2013

A225381 Elimination order of the first person in a Josephus problem.

Original entry on oeis.org

1, 2, 2, 4, 3, 5, 4, 8, 5, 8, 6, 11, 7, 11, 8, 16, 9, 14, 10, 18, 11, 17, 12, 23, 13, 20, 14, 25, 15, 23, 16, 32, 17, 26, 18, 32, 19, 29, 20, 38, 21, 32, 22, 39, 23, 35, 24, 47, 25, 38, 26, 46, 27, 41, 28, 53, 29, 44, 30, 53, 31, 47, 32, 64, 33, 50, 34, 60, 35
Offset: 1

Author

Marcus Hedbring, May 17 2013

Keywords

Comments

In a Josephus problem such as A006257, a(n) is the order in which the person originally first in line is eliminated.
The number of remaining survivors after the person originally first in line has been eliminated, i.e., n-a(n), gives the fractal sequence A025480.
For the linear version, see A225489.

Examples

			If there are 7 persons to begin with, they are eliminated in the following order: 2,4,6,1,5,3,7. So the first person (the person originally first in line) is eliminated as number 4. Therefore a(7) = 4.
		

Crossrefs

Programs

  • Mathematica
    t = {1}; Do[AppendTo[t, If[OddQ[n], (n + 1)/2, t[[n/2]] + n/2]], {n, 2, 100}]; t (* T. D. Noe, May 17 2013 *)

Formula

a(n) = (n+1)/2 (odd n); a(n) = a(n/2) + n/2 (even n).
a(n) = n - A025480(n).
G.f.: Sum{n>=1} x^n/(1-x^A006519(n)). - Nicolas Nagel, Mar 19 2018

A225489 Elimination order for the first person in a linear Josephus problem.

Original entry on oeis.org

1, 2, 2, 3, 5, 6, 5, 6, 8, 9, 8, 9, 12, 13, 11, 12, 17, 18, 14, 15, 21, 22, 17, 18, 23, 24, 20, 21, 27, 28, 23, 24, 32, 33, 26, 27, 36, 37, 29, 30, 38, 39, 32, 33, 42, 43, 35, 36, 48, 49, 38, 39, 52, 53, 41, 42, 53, 54, 44, 45, 57, 58, 47, 48, 65, 66, 50, 51
Offset: 1

Author

Marcus Hedbring, May 08 2013

Keywords

Comments

The process is identical to that of A090569 where n persons are arranged on a line and every second person is eliminated. When we reach the end of the line the direction is reversed without double-counting the person at the end. a(n) is the order in which the person originally first in line is eliminated.

Examples

			If there are 7 persons to begin with, they are eliminated in the following order: 2,4,6,5,1,7,3. So the first person (the person originally first in line) is eliminated as number 5. Therefore a(7) = 5.
		

Crossrefs

Programs

  • Mathematica
    t = {1}; Do[AppendTo[t, Switch[Mod[n,4], 0, 3*n/4, 1, t[[1 + (n-1)/4]] + 3*(n-1)/4, 2, t[[1 + (n-2)/4]] + 3*(n-2)/4 + 1, 3, 3*(n-3)/4 + 2, 4, Mod[n,4] + 1]], {n, 2, 100}]; t (* T. D. Noe, May 17 2013 *)

Formula

For n=4m then a(n) = 3*n/4;
for n=4m+1 then a(n) = a(1+(n-1)/4) + 3*(n-1)/4;
for n=4m+2 then a(n) = a(1+(n-2)/4) + 3*(n-2)/4 + 1;
for n=4m+3 then a(n) = 3*(n-3)/4 + 2.