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.

A338829 a(n) is the greatest number not yet in the sequence with the same number of digits and the same sum of digits as n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 91, 11, 21, 31, 41, 51, 61, 71, 81, 82, 92, 12, 22, 32, 42, 52, 62, 72, 73, 83, 93, 13, 23, 33, 43, 53, 63, 64, 74, 84, 94, 14, 24, 34, 44, 54, 55, 65, 75, 85, 95, 15, 25, 35, 45, 46, 56, 66, 76
Offset: 0

Views

Author

Rémy Sigrist, Nov 11 2020

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.
We have a fixed point with m digits and sum of digits k whenever A289410(m, k) is odd.

Examples

			For n = 23:
- the numbers with 2 digits and sum of digits 5 are: 14, 23, 32, 41 and 50,
- so  a(14) = 50,
      a(23) = 41,
      a(32) = 32,
      a(41) = 23,
      a(50) = 14.
		

Crossrefs

Cf. A055642, A289410, A331274 (binary analog), A333659, A338834 (factorial base analog), A338835 (primorial base analog).

Programs

  • Mathematica
    Block[{a = {}, f, k}, f[x_] := Total@ IntegerDigits@ x; Do[k = f[i]; AppendTo[a, SelectFirst[Range[10^# - 1, 10^(# - 1), -1] &@ Floor[1 + Log10[i]], And[f[#] == k, FreeQ[a, #]] &]], {i, 67}]; a] (* Michael De Vlieger, Nov 13 2020 *)
  • PARI
    See Links section.

Formula

A055642(a(n)) = A055642(n).
A007953(a(n)) = A007953(n).

A332144 Nonnegative numbers ordered by number of digits, and then by sum of digits, and then by value.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 12, 21, 30, 13, 22, 31, 40, 14, 23, 32, 41, 50, 15, 24, 33, 42, 51, 60, 16, 25, 34, 43, 52, 61, 70, 17, 26, 35, 44, 53, 62, 71, 80, 18, 27, 36, 45, 54, 63, 72, 81, 90, 19, 28, 37, 46, 55, 64, 73, 82, 91, 29, 38, 47, 56
Offset: 0

Views

Author

Rémy Sigrist, Nov 20 2020

Keywords

Comments

This sequence is a permutation of the nonnegative integers with inverse A332166.
This sequence can also be seen as an irregular triangle with first row consisting of a zero, and subsequent row lengths given by A289410.

Examples

			Triangle starts:
    0;
    1;
    2;
    3;
    4;
    5;
    6;
    7;
    8;
    9;
    10;
    11, 20;
    12, 21, 30;
    13, 22, 31, 40;
    14, 23, 32, 41, 50;
    15, 24, 33, 42, 51, 60;
    16, 25, 34, 43, 52, 61, 70;
    17, 26, 35, 44, 53, 62, 71, 80;
    18, 27, 36, 45, 54, 63, 72, 81, 90;
    19, 28, 37, 46, 55, 64, 73, 82, 91;
    29, 38, 47, 56, 65, 74, 83, 92;
    39, 48, 57, 66, 75, 84, 93;
    49, 58, 67, 76, 85, 94;
    59, 68, 77, 86, 95;
    69, 78, 87, 96;
    79, 88, 97;
    89, 98;
    99;
    ...
		

Crossrefs

Cf. A187769 (binary analog), A289410, A332166 (inverse).

Programs

  • PARI
    See Links section.

Formula

a(10^k - 1) = 10^k - 1 for any k >= 0.
a(10^k) = 10^k for any k >= 0.
a(10^k + 1) = 10^k + 1 for any k >= 0.
Showing 1-2 of 2 results.