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.

A005349 Niven (or Harshad, or harshad) numbers: numbers that are divisible by the sum of their digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42, 45, 48, 50, 54, 60, 63, 70, 72, 80, 81, 84, 90, 100, 102, 108, 110, 111, 112, 114, 117, 120, 126, 132, 133, 135, 140, 144, 150, 152, 153, 156, 162, 171, 180, 190, 192, 195, 198, 200, 201, 204
Offset: 1

Views

Author

Keywords

Comments

Both spellings, "Harshad" or "harshad", are in use. It is a Sanskrit word, and in Sanskrit there is no distinction between upper- and lower-case letters. - N. J. A. Sloane, Jan 04 2022
z-Niven numbers are numbers n which are divisible by (A*s(n) + B) where A, B are integers and s(n) is sum of digits of n. Niven numbers have A = 1, B = 0. - Ctibor O. Zizka, Feb 23 2008
A070635(a(n)) = 0. A038186 is a subsequence. - Reinhard Zumkeller, Mar 10 2008
A049445 is a subsequence of this sequence. - Ctibor O. Zizka, Sep 06 2010
Complement of A065877; A188641(a(n)) = 1; A070635(a(n)) = 0. - Reinhard Zumkeller, Apr 07 2011
A001101, the Moran numbers, are a subsequence. - Reinhard Zumkeller, Jun 16 2011
A140866 gives the number of terms <= 10^k. - Robert G. Wilson v, Oct 16 2012
The asymptotic density of this sequence is 0 (Cooper and Kennedy, 1984). - Amiram Eldar, Jul 10 2020
From Amiram Eldar, Oct 02 2023: (Start)
Named "Harshad numbers" by the Indian recreational mathematician Dattatreya Ramchandra Kaprekar (1905-1986) in 1955. The meaning of the word is "giving joy" in Sanskrit.
Named "Niven numbers" by Kennedy et al. (1980) after the Canadian-American mathematician Ivan Morton Niven (1915-1999). During a lecture given at the 5th Annual Miami University Conference on Number Theory in 1977, Niven mentioned a question of finding a number that equals twice the sum of its digits, which appeared in the children's pages of a newspaper. (End)

Examples

			195 is a term of the sequence because it is divisible by 15 (= 1 + 9 + 5).
		

References

  • Paul Dahlenberg and T. Edgar, Consecutive factorial base Niven numbers, Fib. Q., 56:2 (2018), 163-166.
  • D. R. Kaprekar, Multidigital Numbers, Scripta Math., Vol. 21 (1955), p. 27.
  • Robert E. Kennedy and Curtis N. Cooper, On the natural density of the Niven numbers, Abstract 816-11-219, Abstracts Amer. Math. Soc., 6 (1985), 17.
  • Robert E. Kennedy, Terry A. Goodman, and Clarence H. Best, Mathematical Discovery and Niven Numbers, The MATYC Journal, Vol. 14, No. 1 (1980), pp. 21-25.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 381.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, 171.

Crossrefs

Cf. A001102 (a subsequence).
Cf. A118363 (for factorial-base analog).
Cf. A330927, A154701, A141769, A330928, A330929, A330930 (start of runs of 2, 3, ..., 7 consecutive Niven numbers).

Programs

  • GAP
    Filtered([1..230],n-> n mod List(List([1..n],ListOfDigits),Sum)[n]=0); # Muniru A Asiru
  • Haskell
    a005349 n = a005349_list !! (n-1)
    a005349_list = filter ((== 0) . a070635) [1..]
    -- Reinhard Zumkeller, Aug 17 2011, Apr 07 2011
    
  • Magma
    [n: n in [1..250] | n mod &+Intseq(n) eq 0];  // Bruno Berselli, May 28 2011
    
  • Magma
    [n: n in [1..250] | IsIntegral(n/&+Intseq(n))];  // Bruno Berselli, Feb 09 2016
    
  • Maple
    s:=proc(n) local N:N:=convert(n,base,10):sum(N[j],j=1..nops(N)) end:p:=proc(n) if floor(n/s(n))=n/s(n) then n else fi end: seq(p(n),n=1..210); # Emeric Deutsch
  • Mathematica
    harshadQ[n_] := Mod[n, Plus @@ IntegerDigits@ n] == 0; Select[ Range[1000], harshadQ] (* Alonso del Arte, Aug 04 2004 and modified by Robert G. Wilson v, Oct 16 2012 *)
    Select[Range[300],Divisible[#,Total[IntegerDigits[#]]]&] (* Harvey P. Dale, Sep 07 2015 *)
  • PARI
    is(n)=n%sumdigits(n)==0 \\ Charles R Greathouse IV, Oct 16 2012
    
  • Python
    A005349 = [n for n in range(1,10**6) if not n % sum([int(d) for d in str(n)])] # Chai Wah Wu, Aug 22 2014
    
  • Sage
    [n for n in (1..10^4) if sum(n.digits(base=10)).divides(n)] # Freddy Barrera, Jul 27 2018
    

A236748 Positive integers k such that k^2 divided by the digital sum of k is a square.

Original entry on oeis.org

1, 4, 9, 10, 18, 22, 27, 36, 40, 45, 54, 63, 72, 81, 88, 90, 100, 108, 112, 117, 126, 130, 135, 144, 153, 162, 171, 180, 196, 202, 207, 216, 220, 225, 234, 243, 252, 261, 268, 270, 306, 310, 315, 324, 333, 342, 351, 360, 376, 400, 405, 414, 423, 432, 441
Offset: 1

Views

Author

Colin Barker, Jan 30 2014

Keywords

Comments

Subsequence of A028839 (sum of digits of n is a square). - Jon Perry and Michel Marcus, Oct 30 2014
A028839 is the sequence of positive integers such that n^2 divided by the sum of the digits is a rational square. For this sequence, it is required to be an integer square. - Franklin T. Adams-Watters, Oct 30 2014
The sequence is infinite since if m = 10^j then m^2 / digitsum(m) = m^2. - Marius A. Burtea, Dec 21 2018

Examples

			153 is in the sequence because the digital sum of 153 is 9, and 153^2/9 = 2601 = 51^2.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..1500] | IsIntegral((n^2)/(&+Intseq(n))) and IsSquare((n^2)/(&+Intseq(n)))]; // Marius A. Burtea, Dec 21 2018
  • Maple
    filter:= n -> issqr(n^2/convert(convert(n,base,10),`+`)):
    select(filter, [$1..10000]); # Robert Israel, Oct 30 2014
  • Mathematica
    Select[Range[500],IntegerQ[Sqrt[#^2/Total[IntegerDigits[#]]]]&] (* Harvey P. Dale, Nov 19 2014 *)
  • PARI
    s=[]; for(n=1, 600, d=sumdigits(n); if(n^2%d==0 && issquare(n^2\d), s=concat(s, n))); s
    

A236750 Positive integers k such that k^3 divided by the digital sum of k is a square.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, 81, 100, 144, 150, 192, 196, 200, 225, 242, 288, 300, 320, 324, 375, 400, 441, 484, 500, 512, 600, 640, 648, 700, 704, 735, 800, 832, 882, 900, 960, 1014, 1088, 1200, 1250, 1452, 1458, 1521, 1815, 2023, 2025, 2028
Offset: 1

Views

Author

Colin Barker, Jan 30 2014

Keywords

Comments

The sequence is infinite since if m = 10^(2*j) then m^3 / digitsum(m) = m^(6*k). - Marius A. Burtea, Dec 21 2018

Examples

			192 is in the sequence because the digital sum of 192 is 12, and 192^3/12 = 589824 = 768^2.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..1500] | IsIntegral((n^3)/(&+Intseq(n))) and IsSquare((n^3)/(&+Intseq(n)))]; // Marius A. Burtea, Dec 21 2018
  • PARI
    s=[]; for(n=1, 5000, d=sumdigits(n); if(n^3%d==0 && issquare(n^3\d), s=concat(s, n))); s
    

A354078 Squares k that are not divisible by 10, and whose reverse and digit sum are also squares, such that the digit sum divides both k and its reverse.

Original entry on oeis.org

1, 4, 9, 144, 441, 10404, 12321, 40401, 69696, 1004004, 1022121, 1212201, 4004001, 4088484, 4848804, 100040004, 100220121, 102030201, 121022001, 400040001, 400880484, 404492544, 420578064, 445294404, 460875024, 484088004, 617323716, 10000400004, 10002200121
Offset: 1

Views

Author

Keywords

Comments

Palindromic terms include 12321, 69696, 102030201, 617323716.
144, 10404, 1004004, 100040004, 10000400004, 1000004000004, ... are all terms, so the sequence is infinite.
From Jon E. Schoenfield, May 20 2022: (Start)
Among the 3358 terms < 10^21, several classes of terms are rare or nonexistent:
- no term has an even number of digits
- no term begins or ends with a 5
- no term begins with 18 or 92
- no term that begins with 16 has any digit other than 9 as its third digit
- only one term (420578064) begins with 42, and only one (460875024) begins with 46
- only one term (9488660854689) begins with 94, and only one (9864580668849) begins with 98
- only two terms begin or end with a 6: 69696 and 617323716 (each of which is a palindrome)
- only three terms begin with a 9 and end with anything other than a 1: 9, 9488660854689, and 9864580668849
Do there exist any terms > 10^21 of any of these classes?
(End)

Examples

			10404 and its reverse, 40401 are terms because both are squares,
10404 = 102^2 and 40401 = 201^2, both have digit sum 9 and digit sum divides both 10404 and its reverse. 10404/9 = 1156, and 40401/9 = 4489.
		

Crossrefs

Subsequence of A061457.

Programs

  • C
    int get_digit_sum(int integer, int *reverse)
    {
        int sum = 0;
        int rev_num = 0;
        int num = integer;
        int rem = 0;
        while (num != 0) {
            rem = num % 10;
            sum += rem;
            num = num / 10;
            rev_num = 10*rev_num + rem;
        }
        *reverse = rev_num;
        return sum;
    }
    int is_square(int integer)
    {
        int mid = (int)(sqrt(integer));
        if ((mid*mid) == integer) {
            return mid;
        }
        else {
            return 0;
        }
    }
    int main(int argc, char *argv[])
    {
       int reverse = 0;
       for (int j = 1; j <= 100011; j++) {
           if (j % 10 == 0) {
               continue;
           }
           int i = j*j;
           int digit_sum = get_digit_sum(i, &reverse);
           if ((i % digit_sum == 0) && (reverse % digit_sum == 0) &&
                    (is_square(digit_sum) != 0) && (is_square(reverse) != 0)) {
               printf("%d, ", i);
           }
       }
       printf("\n");
       return 0;
    }
    
  • Magma
    J:=100011; a:=[]; for j in [1..J] do if j mod 10 ne 0 then k:=j^2; I:=Intseq(k); s:=&+I; if (k mod s eq 0) and IsSquare(s) then r:=Seqint(Reverse(I)); if (r mod s eq 0) and IsSquare(r) then a[#a+1]:=k; end if; end if; end if; end for; a; // Jon E. Schoenfield, May 19 2022
  • PARI
    isok1(k) = if (k % 100, my(s=sumdigits(k), q=k/s); issquare(s) && issquare(q) && (denominator(q)==1));
    isok(k) = isok1(k) && isok1(fromdigits(Vecrev(digits(k)))); \\ Michel Marcus, May 17 2022
    

A331203 Numbers k such that k/(digsum(k)) is an integer cube.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 72, 243, 320, 486, 512, 640, 704, 832, 960, 1000, 1088, 1125, 2000, 2401, 3000, 3430, 4000, 4116, 4802, 5000, 5145, 5831, 6000, 6174, 6517, 6860, 7000, 7546, 8000, 8575, 8918, 9000, 9216, 9947, 19683, 35152, 35937, 41743, 43940, 46137
Offset: 1

Views

Author

K. D. Bajpai, Jan 12 2020

Keywords

Comments

If m belongs to the sequence, then 1000*m also belongs to the sequence. - Rémy Sigrist, Jan 12 2020

Examples

			a(11) = 243: 243/(2 + 4 + 3) = 27 = 3^3.
a(12) = 320: 320/(3 + 2 + 0) = 64 = 4^3.
		

Crossrefs

Programs

  • Magma
    [n : n in[1 .. 1000] | IsIntegral((n/(&+Intseq(n)))^(1/3))];
    
  • Mathematica
    Select[Range[100000], IntegerQ[CubeRoot[#/Total[IntegerDigits[#]]]] &]
  • PARI
    is(n) = my (k=n/sumdigits(n)); type(k)==type(42) && ispower(k,3) \\ Rémy Sigrist, Jan 12 2020

A358693 Numbers k such that k / (sum of digits of k) is the square of a prime.

Original entry on oeis.org

12, 24, 36, 48, 81, 150, 225, 375, 441, 735, 882, 1014, 1452, 1521, 1815, 2023, 2028, 2178, 2312, 2535, 2601, 3549, 3610, 4046, 4332, 4335, 4624, 4913, 5054, 5415, 5491, 5780, 6069, 6137, 6358, 6647, 6936, 7581, 7942, 8664, 8959, 9386, 9522, 9747, 10092, 11532, 12321, 12615, 12696
Offset: 1

Views

Author

Andi Fugard, Jan 01 2023

Keywords

Comments

Terms k from A001102 such that k / (sum of digits of k) is the square of a prime.

Crossrefs

Programs

  • Mathematica
    Select[Range[13000], PrimeQ[Sqrt[#/Plus @@ IntegerDigits[#]]] &] (* Amiram Eldar, Jan 01 2023 *)
  • PARI
    isok(k) = my(r); issquare(k/sumdigits(k), &r) && (denominator(r)==1) && isprime(r); \\ Michel Marcus, Jan 01 2023

Extensions

More terms from Michel Marcus, Jan 01 2023
Showing 1-6 of 6 results.