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.

A356384 For any n >= 0, let x_n(1) = n, and for any b > 1, x_n(b) = x_n(b-1) minus the sum of digits of x_n(b-1) in base b; a(n) is the least b such that x_n(b) = 0.

Original entry on oeis.org

1, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13
Offset: 0

Views

Author

Rémy Sigrist, Aug 05 2022

Keywords

Comments

This sequence is well defined: for any n >= 0: if x_n(b) > 0, then x_n(b+1) < x_n(b), and we must eventually reach 0.
This sequence is weakly increasing; this is related to the fact that for any base b > 1, k -> (k minus the sum of digits of k in base b) is weakly increasing.
Note that some values (like 7) do not appear in this sequence (see also A356386).

Examples

			For n = 42:
- we have:
      b  x(b)
      -  ----
      1    42
      2    39
      3    36
      4    33
      5    28
      6    20
      7    12
      8     7
      9     0
- so a(42) = 9.
		

Crossrefs

Programs

  • PARI
    See Links section.

A346502 a(n) = 3n - (sum of digits of 3n in base 3).

Original entry on oeis.org

0, 2, 4, 8, 10, 12, 16, 18, 20, 26, 28, 30, 34, 36, 38, 42, 44, 46, 52, 54, 56, 60, 62, 64, 68, 70, 72, 80, 82, 84, 88, 90, 92, 96, 98, 100, 106, 108, 110, 114, 116, 118, 122, 124, 126, 132, 134, 136, 140, 142, 144, 148, 150, 152, 160, 162, 164, 168, 170, 172
Offset: 0

Views

Author

Bernard Schott, Jul 21 2021

Keywords

Comments

Terms of A344853 without repetition.
All terms are even.
A new largest gap between 2 consecutive terms is obtained between a(3^m-1) and a(3^m), m >= 0 (see formula).
In base 2, A005187(n) = 2n - (sum of digits of 2n in base 2) is also the exponent of the largest power of 2 dividing (2n)!, but here the exponent of the largest power of 3 dividing (3n)! is not a(n) but A004128(n).

Examples

			a(8) = 24 - (sum of digits of 24 in base 3); 24_10 = 220_3 and 2+2+0 = 4, so a(8) = 24-4 = 20.
		

Crossrefs

Cf. A005187 (similar, with base 2).

Programs

  • Mathematica
    a[n_] := 3*n - Plus @@ IntegerDigits[3*n, 3]; Array[a, 100, 0] (* Amiram Eldar, Jul 22 2021 *)
  • PARI
    a(n) = 3*n - sumdigits(n,3); \\ Kevin Ryde, Jul 21 2021
    
  • Python
    from sympy.ntheory.digits import digits
    def a(n): return 3*n - sum(digits(3*n, 3)[1:])
    print([a(n) for n in range(60)]) # Michael S. Branicky, Jul 28 2021

Formula

a(n) = 3*n - A053735(3*n).
a(n) = 2*A004128(n).
a(n) = A344853(3n).
a(3^n) - a(3^n-1) = 2*(n+1).
Showing 1-2 of 2 results.