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.

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

Original entry on oeis.org

11, 7, 5, 4, 3, 11, 2, 2, 11, 13, 1, 8, 1, 1, 1, 1, 1, 161, 1, 8, 5, 1, 1, 4, 1, 1, 7, 1, 1, 13, 1, 1, 1, 1, 1, 83, 1, 1, 1, 4, 1, 4, 1, 1, 11, 1, 1, 2, 1, 5, 1, 1, 1, 537, 1, 1, 1, 1, 1, 83, 1, 1, 3, 1, 1, 1, 1, 1, 1, 5, 1, 68, 1, 1, 1, 1, 1, 1, 1, 2, 7, 1, 1, 2, 1, 1, 1, 1, 1, 211, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Sergio Pimentel, Sep 16 2008

Keywords

Comments

Niven (or Harshad) numbers are numbers that can be divided by the sum of their digits.
If n is not a Niven number then a(n) is obviously 1. Some terms are rather large: a(108) = 3611, a(540) = 537037; see also A144375 and A144376.
Does a(n) exist for all n? - Klaus Brockhaus, Sep 19 2008
a(n) should exist for all n since the density of the Niven numbers is zero and it has been proved that arbitrarily large gaps exist between Niven numbers. [Sergio Pimentel, Sep 20 2008]
Let N be the number formed by concatenating R copies of n, where R is the smallest power of 10 that exceeds n. Then N is a multiple of n, but not a Niven number; since R divides the sum of the digits of N, but R does not divide N. - David Radcliffe, Oct 06 2014

Examples

			a(2) = 7 since 2, 4, 6, 8, 10 and 12 are all Niven numbers; but 7*2 = 14 is not.
		

Crossrefs

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

Programs

  • Mathematica
    a[n_] := Module[{k = 1}, While[Divisible[k*n, Plus @@ IntegerDigits[k*n]], k++]; k]; Array[a, 100] (* Amiram Eldar, Sep 05 2020 *)
  • 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
    def a(n):
        kn = n
        while kn % sum(map(int, str(kn))) == 0: kn += n
        return kn//n
    print([a(n) for n in range(1, 100)]) # Michael S. Branicky, Nov 07 2021

Extensions

Edited by Klaus Brockhaus, Sep 19 2008

A385486 Where records occur in A385485.

Original entry on oeis.org

1, 2, 12, 126, 252, 504, 2040, 4080, 16380, 32760, 65520, 524286, 1048572, 4194300, 8388600, 134217720, 268435440, 7516192740, 10737418230, 21474836460, 137438953440, 274877906880, 274877906940, 549755813880, 8796093022200, 8796093022206, 17592186044412
Offset: 1

Views

Author

Amiram Eldar, Jun 30 2025

Keywords

Crossrefs

Cf. A049445, A144376 (decimal analog), A385483, A385485, A385487 (record values).

Programs

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

Formula

A385485(a(n)) = A385487(n).

Extensions

a(21)-a(27) from Chai Wah Wu, Jul 02 2025

A144375 Records in A144262.

Original entry on oeis.org

11, 13, 161, 537, 3611, 537037, 740737, 1005291, 5290873, 216005291, 352733597, 9219175481, 16835016827, 1166734500037
Offset: 1

Views

Author

Klaus Brockhaus, Sep 19 2008

Keywords

Comments

14*10^11 < a(15) <= 6007881003256. [From Donovan Johnson, Jul 22 2010]

Crossrefs

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

Extensions

a(11), a(12) from Klaus Brockhaus, Sep 30 2008
a(13)-a(14) from Donovan Johnson, Jul 22 2010
Showing 1-3 of 3 results.