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

A114440 Numbers which divided by the sum of their digits (Harshad or Niven numbers) give integers which are also divisible by the sum of their digits (until a single-digit Harshad remains).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 18, 21, 24, 27, 36, 42, 45, 48, 54, 63, 72, 81, 84, 108, 162, 216, 243, 324, 378, 405, 432, 486, 648, 756, 864, 972, 1296, 1458, 1944, 2916, 3402, 4374, 5832, 6804, 7290, 8748, 11664, 13122, 13608, 15552, 17496, 23328, 26244
Offset: 1

Views

Author

Piotr K. Olszewski (piotrkornelolszewski(AT)poczta.onet.pl), Feb 14 2006

Keywords

Comments

The sequence is finite with a(15095), a 1434-digit number, being the final term. - Hans Havermann and Ray Chandler, Jan 21 2014

Examples

			The number 216 is a term of the sequence because it is divisible by the sum of its digits: 2+1+6=9; 216/9=24. Also, the successive quotients are divisible by the sum of their digits, until a single-digit Harshad remains: 24: 2+4=6; 24/6=4 and 4: 4/4=1.
		

Crossrefs

Programs

  • Mathematica
    s=w={1}; Do[t={}; Do[v=s[[k]]; u={}; Do[If[Total[IntegerDigits[c*v]]==c, AppendTo[u,c*v]], {c,2,7000}]; t=Join[t,u], {k,Length[s]}]; s=Sort[t]; w=Join[w,s], {440}]; Union[w] (* Hans Havermann, Jan 21 2014 *)
  • PARI
    v=vector(118); for(n=1, 9, v[n]=n; print1(n ", ")); c=9; for(n=10, 10^9, d=length(Str(n)); m=n; s=0; for(j=1, d, s=s+m%10; m=m\10); if(s==1, next); if(n%s==0, m=n/s, next); forstep(j=c, 1, -1, if(v[j]<=m, if(v[j]==m, c++; v[c]=n; print1(n ", ")); next(2)))) /* Donovan Johnson, Apr 09 2013 */

Extensions

Offset corrected by Donovan Johnson, Apr 09 2013
a(54)-a(235) from Donovan Johnson, Apr 09 2013
a(236)-a(15095) from Hans Havermann and Ray Chandler, Jan 21 2014

A235600 a(n) = n/d(n) if d(n) divides n, otherwise a(n) = n, where d(n) is the sum of the digits of n (A007953).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 11, 4, 13, 14, 15, 16, 17, 2, 19, 10, 7, 22, 23, 4, 25, 26, 3, 28, 29, 10, 31, 32, 33, 34, 35, 4, 37, 38, 39, 10, 41, 7, 43, 44, 5, 46, 47, 4, 49, 10, 51, 52, 53, 6, 55, 56, 57, 58, 59, 10, 61, 62, 7, 64, 65, 66, 67, 68, 69, 10, 71, 8, 73, 74, 75, 76, 77, 78, 79, 10, 9, 82, 83, 7, 85
Offset: 1

Views

Author

N. J. A. Sloane, Jan 18 2014

Keywords

Crossrefs

Cf. A065517 (first differs at n=15).

Programs

  • Mathematica
    A235600[n_]:=With[{d=Total[IntegerDigits[n]]},If[Divisible[n,d],n/d,n]];
    Array[A235600,100] (* Paolo Xausa, Dec 06 2023 *)
  • PARI
    a(n) = my(s=sumdigits(n)); if (n % s, n, n/s); \\ Michel Marcus, Jul 15 2021

A235602 a(n) = n/wt(n) if wt(n) divides n, otherwise a(n) = n, where wt(n) is the binary weight of n (A000120).

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 6, 13, 14, 15, 16, 17, 9, 19, 10, 7, 22, 23, 12, 25, 26, 27, 28, 29, 30, 31, 32, 33, 17, 35, 18, 37, 38, 39, 20, 41, 14, 43, 44, 45, 46, 47, 24, 49, 50, 51, 52, 53, 54, 11, 56, 57, 58, 59, 15, 61, 62, 63, 64, 65, 33, 67, 34, 23, 70, 71, 36, 73, 74, 75, 76, 77, 78, 79, 40, 27, 82
Offset: 1

Views

Author

N. J. A. Sloane, Jan 18 2014

Keywords

Crossrefs

Programs

  • Mathematica
    bw[n_]:=Module[{w=DigitCount[n,2,1]},If[Divisible[n,w],n/w,n]]; Array[ bw,90] (* Harvey P. Dale, Nov 06 2016 *)
  • PARI
    a(n) = my(s=hammingweight(n)); if (n % s, n, n/s); \\ Michel Marcus, Jul 15 2021

Formula

From Amiram Eldar, Aug 04 2025: (Start)
a(n) = n if and only if n is in A065878 or A000079.
a(n) < n if and only if n is in A049445 but not in A000079. (End)

A236338 Number of iterations of A235600 to reach 1 when starting with n, or -1 if 1 is never reached. (A235600(x) = x/sum_of_digits(x) if this is an integer, otherwise A235600(x) = x.)

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 2, -1, -1, -1, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, 2, -1, -1, 2, -1, -1, 2, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1
Offset: 1

Views

Author

M. F. Hasler, Jan 22 2014

Keywords

Comments

Based on an idea from N. J. A. Sloane, cf. link.
Numbers n = 10^k and also numbers not divisible by their digital sum A007953, are fixed points of A235600, therefore a(n) = -1 for these, except for a(1) = 0, cf. Example.
A235601(k) is the smallest n for which a(n) = k.

Examples

			a(1) = 0 since no iteration of A235600 is needed to reach 1.
a(n) = 1 for 1 <= n <= 9, since these n are equal to (thus divisible by) their sum of digits A007953(n), and 1 is reached upon the first iteration of A235600 (which consists of dividing n by its sum of digits).
a(10) = -1 since A007953(10) = 1 and therefore application of A235600 yields a constant sequence that never reaches 1.
a(11) = -1 since 11 is not divisible by A007953(11) = 2 and therefore application of A235600 yields a constant sequence that never reaches 1.
a(12) = 2 since A235600(12) = 12/(1+2) = 4 and A235600(4) = 4/4 = 1, reached after 2 iterations.
		

Crossrefs

Programs

  • PARI
    A236338 = n -> for(i=0,999,n==1&&return(i);if(n%sumdigits(n)||n==n\=sumdigits(n),return(-1)))

A236385 Largest number m such that repeated application of A235600 takes n steps to reach 1, where A235600(k) = k/A007953(k) if the digital sum A007953(k) divides k, A235600(k) = k otherwise.

Original entry on oeis.org

1, 9, 84, 1458, 39366, 1062882, 47829690, 1721868840, 92980917360, 5020969537440, 361509806695680, 26028706082088960, 1874066837910405120, 58110713122393733760, 3643185932897827553280, 393464080752965375754240
Offset: 0

Views

Author

Ray Chandler, Jan 24 2014

Keywords

Crossrefs

A236295 Number of terms of A114440 that require n steps to arrive at 1.

Original entry on oeis.org

1, 8, 14, 15, 17, 21, 23, 21, 22, 27, 27, 30, 32, 26, 20, 23, 25, 22, 17, 20, 22, 32, 41, 34, 35, 38, 43, 45, 49, 51, 52, 43, 44, 41, 51, 40, 38, 37, 30, 30, 35, 26, 24, 24, 30, 22, 21, 25, 21, 18, 24, 19, 25, 23, 23, 22, 31, 22, 27, 28, 25, 21, 21, 25
Offset: 0

Views

Author

Hans Havermann, Jan 21 2014

Keywords

Comments

Because A114440 is finite, this sequence is necessarily also finite. The sum of all 441 terms of this sequence, a(0) to a(440), is 15095, the number of terms in A114440.

Examples

			There is 1 terms of A114440 that requires no steps to reach 1: {1}. So a(0) = 1.
There are 8 terms of A114440 that require one step to reach 1: {2,3,4,5,6,7,8,9}. So a(1) = 8.
There are 14 terms of A114440 that require two steps to reach 1: {12,18,21,24,27,36,42,45,48,54,63,72,81,84}. So a(2) = 14.
...
There are 4 terms of A114440 that require 440 steps to reach 1, so a(440) = 4. There are no terms that require more than 440 steps to reach 1.
		

Crossrefs

Showing 1-6 of 6 results.