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.

A357425 Smallest number for which the sum of digits in fractional base 4/3 is n.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 10, 11, 15, 21, 22, 23, 31, 39, 43, 54, 55, 74, 75, 101, 102, 103, 138, 139, 183, 187, 246, 247, 330, 331, 439, 443, 587, 783, 790, 791, 1047, 1355, 1398, 1399, 1866, 1867, 2487, 2491, 3318, 3319, 4199, 4427, 5903, 5911, 7882, 7883, 9959
Offset: 0

Views

Author

Kevin Ryde, Sep 28 2022

Keywords

Comments

The sum of digits is A244041 and k = a(n) is the smallest A244041(k) = n.
Terms are never multiples of 4, after a(0)=0, since a multiple of 4 is a final 0 digit in base 4/3 which can be removed for the same digit sum.
Terms are strictly increasing (and so are indices of record highs in A244041) since a(n) - 1 has sum of digits n-1 and so is an upper bound for a(n-1).
If a(n) != 3 (mod 4), then the next term is a(n+1) = a(n) + 1 by incrementing the least significant digit.
If a(n) == 3 (mod 4), then an upper bound on the next term is a(n+1) <= (a(n) - r)*4/3 + r+1, where r = a(n) mod 3, by reducing the last digit to reach a multiple of 3 then append a suitable additional digit.

Examples

			For n=10, a(10) = 21 = 32131 in base 4/3 is the smallest number with sum of digits = 10.
For n=11, a(11) = 22 = 32132 in base 4/3, and which differs from a(10) simply by increasing the least significant base 4/3 digit.
		

Crossrefs

Cf. A024631 (base 4/3), A244041 (sum of digits), A363758.

Programs

  • C
    /* See links. */