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-10 of 11 results. Next

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

A144363 Records in A144261.

Original entry on oeis.org

1, 10, 12, 18, 21, 30, 42, 48, 54, 60, 72, 96, 108, 120, 130, 150, 165, 168, 180, 192, 210, 216, 240, 252, 280, 322, 441, 462, 472, 486, 488, 520, 528, 536, 560, 600, 630, 729, 1188
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), A144364 (where records occur 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, fi]], {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(fi, ", "))); \\ Amiram Eldar, Jun 30 2025

Extensions

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

A358067 a(n) is the smallest m such that A144261(m) = n.

Original entry on oeis.org

1, 15, 14, 33, 22, 17, 73, 49, 13, 11, 529, 31, 397, 293, 241, 199, 1633, 53, 3727, 761, 331, 491, 4343, 431, 1943, 887, 383, 3659, 3809, 377, 15863, 9419, 2713, 2993, 26753, 1583, 30311, 5297, 8971, 2753, 5363, 983, 11603, 4919, 18314, 14657, 59303, 1499, 99179
Offset: 1

Views

Author

Bernard Schott, Oct 29 2022

Keywords

Comments

In other words, a(n) is the smallest element m of the set of the integers k that satisfy {A144261(k) = n and n * k is a Niven number} (see Example section).
Same question as in A144261: does a(n) exist for all n?

Examples

			A144261(15) = A144261(25) = A144261(35) = A144261(51) = ... = 2 because 15, 25, 35, 51, ... are not Niven numbers and 2 is the smallest integer such that 2*15=30, 2*25=50, 2*35=70, 2*51=102, ..., are Niven (or Harshad) numbers. Since 15 is the least integer that, when multiplied by 2, yields a Niven number (2*15), a(2) = 15.
		

Crossrefs

Cf. A005349 (Niven numbers), A144261.

Programs

  • Mathematica
    f[n_] := Module[{k = 1, p}, While[! Divisible[p = k*n, Plus @@ IntegerDigits[p]], k++]; k]; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n]; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[50, 10^6] (* Amiram Eldar, Oct 29 2022 *)
  • PARI
    f(n) = my(k=1); while ((k*n) % sumdigits(k*n), k++); k; \\ A144261
    a(n) = my(k=1); while (f(k) != n, k++); k; \\ Michel Marcus, Oct 31 2022
    
  • Python
    from itertools import count
    def A358067(n): return next(filter(lambda m:n==next(filter(lambda k:not (r:=k*m) % sum(int(d) for d in str(r)), count(1))),count(1))) # Chai Wah Wu, Nov 04 2022

Extensions

More terms from Amiram Eldar, Oct 29 2022

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

A226169 Niven numbers when expressed in bases 1 through 10.

Original entry on oeis.org

1, 2, 4, 6, 24, 40, 48, 72, 120, 144, 180, 216, 252, 288, 324, 336, 360, 432, 504, 576, 648, 720, 756, 780, 840, 960, 1008, 1056, 1080, 1092, 1200, 1260, 1296, 1344, 1380, 1440, 1512, 1584, 1620, 1680, 1728, 1764, 1800, 1944, 2016, 2196, 2304, 2352, 2448
Offset: 1

Views

Author

Sergio Pimentel, May 29 2013

Keywords

Comments

The first 10 odd terms greater than 1 are a(1151) = 543375, 5329233, 18640125, 19178775, 23186625, 30131535, 35026425, 36797775, 46101825, 51856875. - Giovanni Resta, Jun 01 2013

Examples

			Example: 336 is in the sequence because the sum of digits of 336 when expressed in bases 1 through 10 is: 336, 3, 4, 3, 8, 6, 12, 7, 8, 12; and 336 is divisible by all these numbers.  In this particular example 336 keeps this property in bases 11, 12 and 13, but not 14.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^4], Catch[Do[If[Mod[#, Total@IntegerDigits[#, b]] > 0, Throw@ False], {b, 2, 10}]; True] &] (* Giovanni Resta, May 29 2013 *)
    t = Table[b = 2; While[s = Total[IntegerDigits[n, b]]; s < n && Mod[n, s] == 0, b++]; If[s == n, b = 0]; b, {n, 2000}]; Flatten[Position[t, ?(# == 0 || # > 10 &)]] (* _T. D. Noe, May 30 2013 *)

Extensions

Missing a(17) and a(35)-a(49) from Giovanni Resta, May 29 2013

A385482 a(n) is the least number k such that k*n is a binary Niven number (A049445).

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Jun 30 2025

Keywords

Crossrefs

Cf. A049445, A144261 (decimal analog), A363788, A385483 (indices of records), A385484 (record values), A385485.

Programs

  • Mathematica
    a[n_] := Module[{m = n, k = 1}, While[!Divisible[m, DigitSum[m, 2]], m += n; k++]; k]; Array[a, 100]
  • PARI
    a(n) = {my(m = n, k = 1); while(m % hammingweight(m), m += n; k++); k;}
    
  • Python
    from itertools import count
    def a(n): return next(k for k in count(1) if (m:=k*n)%m.bit_count() == 0)
    print([a(n) for n in range(1, 86)]) # Michael S. Branicky, Jun 30 2025

Formula

a(n) = 1 if and only if n is in A049445.
a(n) = 2 if and only if 2*n is in A363788.

A226171 Smallest base in which n is not Niven (or zero if n is Niven in every base).

Original entry on oeis.org

0, 0, 2, 0, 2, 0, 2, 6, 2, 4, 2, 8, 2, 2, 2, 6, 2, 8, 2, 7, 5, 2, 2, 14, 2, 2, 2, 2, 2, 2, 2, 6, 2, 3, 2, 8, 2, 2, 2, 12, 2, 3, 2, 2, 2, 2, 2, 14, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 8, 2, 2, 2, 6, 2, 3, 2, 3, 3, 2, 2, 14, 2, 2, 2, 2, 2, 2, 2, 8, 5, 2, 2, 5, 2, 2
Offset: 1

Views

Author

Sergio Pimentel, May 29 2013

Keywords

Comments

Niven numbers (in base b) are divisible by the sum of their digits (in base b).
Questions: are 1, 2, 4 and 6 the only zeros in this sequence? Where are the records or high water marks?
From Bert Dobbelaere, Oct 08 2018: (Start)
1,2,4,6 are the only numbers that are Niven in every base.
Proof: Suppose n is Niven in every base, then consider the base-b representations of n for (n/2) < b <= n. These are all 2-digit numbers with 1 as 1st digit and (n-b) as last digit. Then 1+n-b is a divisor of n for all b, meaning that all numbers between 1 up to n/2 are divisors of n. Clearly there are no such numbers larger than 6.
a(n) < 60 for n < 10^13.
(End)

Examples

			The sum of digits of 24 in bases 1 through 14 are:  24, 2, 4, 3, 8, 4, 6, 3, 8, 6, 4, 2, 12, 11.  24 is divisible by all these numbers except the last one; therefore a(24) = 14.
		

Crossrefs

Cf. A225427 (least Niven number for all bases from 1 to n).

Programs

  • Mathematica
    Table[b = 2; While[s = Total[IntegerDigits[n, b]]; s < n && Mod[n, s] == 0, b++]; If[s == n, b = 0]; b, {n, 100}] (* T. D. Noe, May 30 2013 *)
  • PARI
    a(n) = {for (b=2, n-1, if (frac(n/sumdigits(n,b)), return(b));); 0;} \\ Michel Marcus, Oct 23 2018

A357936 a(n) is the least multiple of n that is a Niven (or Harshad) number.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 110, 12, 117, 42, 30, 48, 102, 18, 114, 20, 21, 110, 207, 24, 50, 156, 27, 84, 261, 30, 372, 192, 132, 102, 70, 36, 111, 114, 117, 40, 410, 42, 516, 132, 45, 230, 423, 48, 392, 50, 102, 156, 954, 54, 110, 112, 114, 522, 531, 60
Offset: 1

Views

Author

Rémy Sigrist, Oct 21 2022

Keywords

Comments

Niven (or Harshad) numbers are divisible by the sum of their digits, and correspond to sequence A005349.

Examples

			For n = 67, we have:
.
      k  67*k  Niven?
      -  ----  ------
      1    67  No
      2   134  No
      3   201  Yes
so a(67) = 201.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Module[{k=1}, While[!Divisible[k*n, Total[IntegerDigits[k*n]]], k++]; k*n]; Array[a, 60]
  • PARI
    a(n, base=10) = forstep (m=n, oo, n, if (m%sumdigits(m, base)==0, return (m)))

Formula

a(n) = n * A144261(n).

A144378 Initial term of a series of exactly n consecutive non-Niven (or Harshad) numbers.

Original entry on oeis.org

11, 22, 37, 136, 13, 64, 73, 163, 91, 1730, 289, 1639, 379, 1660, 2737, 919, 559, 14878, 7561, 5671, 9753, 2890, 7777, 4888, 5785, 5590, 27973, 47872, 28681, 22681, 3785, 36184, 46281, 71281, 6481, 48952, 48763, 64978, 119773, 69782, 77881, 55973
Offset: 1

Views

Author

Sergio Pimentel, Sep 18 2008

Keywords

Comments

Multiples of 18 seem to be the high water marks, while terms of the form 18n - 1 seem to be the valleys of this sequence.
Many terms end in '81' for some reason.
This sequence is analog to A060159 with non-Niven numbers.
This sequence is infinite, as opposed as A060159.

Examples

			a(5) = 13 since 13, 14, 15, 16 and 17 are all non-Niven numbers and this is the first occurrence of exactly 5 non-Niven numbers.
		

Crossrefs

Programs

  • PARI
    digitsum(n) = {local(s=0); while(n, s+=n%10; n\=10); s}
    {m=120000; z=42; w=vector(z); n=1; while(n<=m, while(n%digitsum(n)==0, n++); a=n; c=0; while(n%digitsum(n)>0, n++; c++); if(c<=z&&w[c]==0, w[c]=a)); j=1; while(j<=z&&w[j]>0, print1(w[j], ","); j++)} /* Klaus Brockhaus, Sep 24 2008 */

Extensions

a(2), a(22), a(42) corrected by Klaus Brockhaus, Sep 24 2008

A337731 a(n) is the smallest k >= 1 such that k*n is a Moran number.

Original entry on oeis.org

18, 9, 6, 21, 9, 3, 3, 19, 2, 19, 18, 7, 9, 3, 3, 37, 9, 1, 6, 199, 1, 9, 9, 37, 199, 6, 1, 3, 9, 1663, 12, 937, 6, 1117, 1657, 1361, 3, 3, 3, 17497, 18, 1, 12, 10909, 1, 14563, 9, 18541, 17551, 199999, 3, 3, 18, 87037, 1108909, 157141, 2, 154981, 9, 1483333
Offset: 1

Views

Author

Marius A. Burtea, Sep 18 2020

Keywords

Comments

m is a Moran number if m /digsum(m) is a prime number (A001101).
a(n) = 1 if and only if n is a Moran number.

Examples

			For n = 6, (1*6) / digsum(1*6) = 1, (2*6) / digsum(2*6) = 12 / 3 = 4, (3*6) / digsum(3*6) = 18 / 9 = 2 = prime(1), so a(6) = 3.
For n = 7, (1*7) / digsum(1*7) = 1, (2*7) / digsum(2*7) = 14 / 5, (3*7) / digsum(3*7) = 21 / 3 = 7 = prime(4), so a(7) = 3.
		

Crossrefs

Programs

  • Magma
    moran:=func;
    a:=[]; for n in [1..60] do k:=1; while not moran(k*n) do k:=k+1; end while; Append(~a,k); end for; a;
  • Mathematica
    moranQ[n_] := PrimeQ[n / Plus @@ IntegerDigits[n]]; a[n_] := Module[{k = 1}, While[!moranQ[k*n], k++]; k]; Array[a, 60] (* Amiram Eldar, Sep 19 2020 *)
Showing 1-10 of 11 results. Next