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

A144261 a(n) = smallest k such that k*n is a Niven (or Harshad) number.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1, 9, 3, 2, 3, 6, 1, 6, 1, 1, 5, 9, 1, 2, 6, 1, 3, 9, 1, 12, 6, 4, 3, 2, 1, 3, 3, 3, 1, 10, 1, 12, 3, 1, 5, 9, 1, 8, 1, 2, 3, 18, 1, 2, 2, 2, 9, 9, 1, 12, 6, 1, 3, 3, 2, 3, 3, 3, 1, 18, 1, 7, 3, 2, 2, 4, 2, 9, 1, 1, 5, 18, 1, 6, 6, 3, 3, 9, 1, 4, 5, 4, 9, 2, 2, 12, 4, 2, 1
Offset: 1

Views

Author

Sergio Pimentel, Sep 16 2008

Keywords

Comments

Niven (or Harshad) numbers are numbers that are divisible by the sum of their digits.
Does a(n) exist for all n? - Klaus Brockhaus, Sep 19 2008

Examples

			a(14) = 3 since neither 1*14 or 2*14 are Niven numbers, but 3*14 = 42 is a Niven number: 42 = 7*(4+2).
		

Crossrefs

Cf. A005349 (Niven numbers), A144262 (smallest k such that k*n is not a Niven number), A144363 (records in A144261), A144364 (where records occur in A144261).

Programs

  • Mathematica
    niv[n_]:=Module[{k=1},While[!Divisible[k*n,Total[IntegerDigits[ k*n]]], k++]; k]; Array[niv,100] (* Harvey P. Dale, Jul 23 2016 *)
  • PARI
    digitsum(n) = {local(s=0); while(n, s+=n%10; n\=10); s}
    {for(n=1, 100, k=1; while((p=k*n)%digitsum(p)>0, k++); print1(k, ","))} /* Klaus Brockhaus, Sep 19 2008 */
    
  • Python
    from itertools import count
    def A144261(n): return next(filter(lambda k:not (m:=k*n) % sum(int(d) for d in str(m)), count(1))) # Chai Wah Wu, Nov 04 2022

Extensions

Edited and extended by Klaus Brockhaus, Sep 19 2008

A144364 Where records occur in A144261.

Original entry on oeis.org

1, 11, 31, 53, 331, 377, 983, 1499, 2609, 3329, 6637, 6997, 19937, 34987, 157961, 173699, 256661, 1349923, 1616359, 1993333, 2199833, 5794969, 6906869, 12204431, 14223073, 20666551, 168499997, 4819002127, 7331752277, 8259275501, 27017515331, 27581017543
Offset: 1

Views

Author

Klaus Brockhaus, Sep 19 2008

Keywords

Crossrefs

Cf. A005349 (Niven numbers), A144261 (smallest k such that k*n is a Niven number), A144363 (records in A144261).

Programs

  • Mathematica
    f[n_] := Module[{k = 1, m = n}, While[!Divisible[m, DigitSum[m]], m +=n; k++]; k]; seq[lim_] := Module[{s = {}, fm = 0, fi}, Do[fi = f[i]; If[fi > fm, fm = fi; AppendTo[s, i]], {i, 1, lim}]; s]; seq[10^5] (* Amiram Eldar, Jun 30 2025 *)
  • PARI
    f(n) = {my(k = 1, m = n); while(m % sumdigits(m), m +=n; k++); k;}
    list(lim) = my(fm = 0, fi); for(i = 1, lim, fi = f(i); if(fi > fm, fm = fi; print1(i, ", "))); \\ Amiram Eldar, Jun 30 2025

Extensions

a(27)-a(30) from Donovan Johnson, Jul 20 2010
a(31)-a(32) from Amiram Eldar, Jun 30 2025

A385484 Records in A385482.

Original entry on oeis.org

1, 2, 3, 5, 10, 12, 42, 84, 88, 90, 99, 130, 165, 184, 187, 209, 221, 252, 299, 434, 450, 459, 486, 525, 555, 611, 675, 702, 726, 858, 899, 975, 984, 1034, 1036, 1104, 1107, 1197, 1275, 1357
Offset: 1

Views

Author

Amiram Eldar, Jun 30 2025

Keywords

Crossrefs

Cf. A049445, A144363 (decimal analog), A385482, A385483 (indices of records), A385487.

Programs

  • Mathematica
    f[n_] := Module[{m = n, k = 1}, While[!Divisible[m, DigitSum[m, 2]], m += n; k++]; k];
    seq[lim_] := Module[{s = {}, fm = -1, fi}, Do[fi = f[i]; If[fi > fm, fm = fi; AppendTo[s, fi]], {i, 1, lim}]; s]; seq[10^4]
  • PARI
    f(n) = {my(m = n, k = 1); while(m % hammingweight(m), m += n; k++); k;}
    list(lim) = my(fm = -1, fi); for(i = 1, lim, fi = f(i); if(fi > fm, fm = fi; print1(fi, ", ")));

Formula

a(n) = A385482(A385483(n)).
Showing 1-3 of 3 results.