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

A356640 a(n) is the least number k such that the least base in which k is a Niven number is n, i.e., A356552(k) = n, or -1 if no such k exists.

Original entry on oeis.org

1, 3, 50, 5, 44, 7, 161, 119, 201, 11, 253, 13, 494, 226, 1444, 17, 799, 19, 437, 1189, 957, 23, 1081, 2263, 755, 767, 927, 29, 932, 31, 1147, 5141, 1191, 1226, 2009, 37, 1517, 1522, 1641, 41, 1927, 43, 2021, 2026, 2164, 47, 2491, 4559, 5001, 2602, 2757, 53, 2972
Offset: 2

Views

Author

Amiram Eldar, Aug 19 2022

Keywords

Examples

			a(3) = 3 since 3 is a Niven number in base 3 and in no other base smaller than 3. 1 and 2 are also Niven numbers in base 3, but they are also Niven numbers in base 2.
		

Crossrefs

Similar sequence: A249634.

Programs

  • Mathematica
    f[n_] := Module[{b = 2}, While[! Divisible[n, Plus @@ IntegerDigits[n, b]], b++]; b]; A356640[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n] - 1; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; A356640[50, 10^4]

Formula

a(p) = p for an odd prime p.

A356553 For any n > 0, let b > 1 be the least base where the sum of digits of n divides n; a(n) is the sum of digits of n in base b.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 3, 1, 1, 2, 1, 2, 3, 2, 1, 2, 5, 2, 1, 2, 1, 2, 1, 1, 3, 2, 5, 2, 1, 2, 3, 2, 1, 3, 1, 4, 3, 2, 1, 2, 1, 5, 3, 4, 1, 2, 5, 4, 3, 2, 1, 4, 1, 2, 3, 1, 5, 2, 1, 2, 3, 10, 1, 2, 1, 2, 5, 4, 7, 6, 1, 2, 3, 2, 1, 3, 5, 2, 3
Offset: 1

Views

Author

Rémy Sigrist, Aug 12 2022

Keywords

Comments

See A356552 for the corresponding bases.

Examples

			For n = 14:
- we have:
      b   sum of digits  divides 14?
      --  -------------  -----------
       2              3  no
       3              4  no
       4              5  no
       5              6  no
       6              4  no
       7              2  yes
- so a(14) = 2.
		

Crossrefs

Cf. A356552.

Programs

  • Mathematica
    a[n_] := Module[{b = 2}, While[!Divisible[n, (s = Plus @@ IntegerDigits[n, b])], b++]; s]; Array[a, 100] (* Amiram Eldar, Sep 19 2022 *)
  • PARI
    a(n) = { for (b=2, oo, my (s=sumdigits(n, b)); if (n % s==0, return (s))) }
    
  • Python
    from sympy.ntheory import digits
    def a(n):
        b = 2
        while n != 0 and n%sum(digits(n, b)[1:]): b += 1
        return sum(digits(n, b)[1:])
    print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Aug 12 2022

A356641 Indices of records in A356640.

Original entry on oeis.org

2, 3, 4, 8, 10, 12, 14, 16, 25, 33, 56, 63, 64, 75, 78, 81, 93, 120, 121, 125, 144, 160, 162, 169, 172, 196, 216, 225, 237, 244, 256, 288, 320, 361, 400, 456, 474, 484, 513, 592, 634, 676, 784, 808, 961, 1089, 1369, 1936, 2286, 2302, 2360, 2362, 2397, 2401
Offset: 1

Views

Author

Amiram Eldar, Aug 19 2022

Keywords

Examples

			The first 7 terms of A356640 are 1, 3, 50, 5, 44, 7 and 161. The record values, 1, 3, 50 and 161, occur at n = 2, 3, 4 and 8, the first 4 terms of this sequence.
		

Crossrefs

Cf. A356552, A356640, A356642 (the corresponding record values).

Programs

  • C
    See Links section.
  • Mathematica
    v = A356640[50, 10^4]; s = {}; m = 0; Do[If[v[[i]] > m, m = v[[i]]; AppendTo[s, i + 1]], {i, 1, Length[v]}]; s (* uses code from A356640 *)

Extensions

More terms from Rémy Sigrist, Sep 07 2022

A356555 Irregular triangle T(n, k), n > 0, k = 1..A080221(n) read by rows; the n-th row contains, in ascending order, the bases b from 2..n+1 where the sum of digits of n divides n.

Original entry on oeis.org

2, 2, 3, 3, 4, 2, 3, 4, 5, 5, 6, 2, 3, 4, 5, 6, 7, 7, 8, 2, 3, 4, 5, 7, 8, 9, 3, 4, 7, 9, 10, 2, 3, 5, 6, 9, 10, 11, 11, 12, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 13, 14, 7, 8, 13, 14, 15, 3, 5, 6, 7, 11, 13, 15, 16, 2, 3, 4, 5, 7, 8, 9, 13, 15, 16, 17, 17, 18
Offset: 1

Views

Author

Rémy Sigrist, Aug 12 2022

Keywords

Comments

A080221 provides row lengths (note that for n > 0, we consider the base n+1 but not the base 1, unlike A080221 that considers the base 1 but not the base n+1, however this does not matter as the sums of digits of n in base 1 and base n+1 are the same).

Examples

			Triangle T(n, k) begins:
    n    n-th row
    --   --------
     1   [2]
     2   [2, 3]
     3   [3, 4]
     4   [2, 3, 4, 5]
     5   [5, 6]
     6   [2, 3, 4, 5, 6, 7]
     7   [7, 8]
     8   [2, 3, 4, 5, 7, 8, 9]
     9   [3, 4, 7, 9, 10]
    10   [2, 3, 5, 6, 9, 10, 11]
    11   [11, 12]
    12   [2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13]
    13   [13, 14]
    14   [7, 8, 13, 14, 15]
    15   [3, 5, 6, 7, 11, 13, 15, 16]
    16   [2, 3, 4, 5, 7, 8, 9, 13, 15, 16, 17]
    17   [17, 18]
		

Crossrefs

Programs

  • PARI
    row(n) = select(b -> n % sumdigits(n,b)==0, [2..n+1])
    
  • Python
    from sympy.ntheory import digits
    def row(n): return [b for b in range(2, n+2) if n%sum(digits(n, b)[1:])==0]
    print([an for n in range(1, 18) for an in row(n)]) # Michael S. Branicky, Aug 12 2022

Formula

T(n, 1) = A356552(n).
T(n, A080221(n)-1) = n for n > 1.
T(n, A080221(n)) = n+1.

A356642 Record values in A356640.

Original entry on oeis.org

1, 3, 50, 161, 201, 253, 494, 1444, 2263, 5141, 5695, 8153, 9271, 10877, 18337, 23377, 23989, 30353, 33017, 50003, 51947, 55067, 55867, 56279, 88922, 94231, 95251, 100127, 131021, 134899, 169141, 252566, 314563, 323729, 389113, 415883, 453613, 523147, 902219, 1017505
Offset: 1

Views

Author

Amiram Eldar, Aug 19 2022

Keywords

Examples

			The first 7 terms of A356640 are 1, 3, 50, 5, 44, 7 and 161. The record values are 1, 3, 50 and 161, the first 4 terms of this sequence.
		

Crossrefs

Cf. A356552, A356640, A356641 (the corresponding bases).

Programs

  • Mathematica
    DeleteDuplicates[FoldList[Max, A356640[50, 10^4]]] (* uses code from A356640 *)
Showing 1-5 of 5 results.