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.

Previous Showing 11-20 of 73 results. Next

A337078 The number of binary Niven numbers (A049445) not exceeding 2^n.

Original entry on oeis.org

2, 3, 5, 8, 13, 21, 37, 65, 124, 232, 431, 760, 1424, 2575, 4772, 8932, 17033, 32225, 61764, 117897, 224944, 428155, 814294, 1547596, 2934212, 5572886, 10609364, 20237826, 38773350, 74609953, 144275968, 280018507, 545782822, 1064716523, 2081890937, 4068716054
Offset: 1

Views

Author

Amiram Eldar, Aug 14 2020

Keywords

Examples

			a(1) = 2 since there are 2 binary Niven numbers not exceeding 2^1: 1 and 2.
		

Crossrefs

Programs

  • Mathematica
    binNivenQ[n_] := Divisible[n, DigitCount[n, 2, 1]]; s = {}; c = 0; p = 2; Do[If[binNivenQ[n], c++]; If[n == p, AppendTo[s, c]; p *= 2], {n, 1, 2^20}]; s

Formula

a(n) ~ 2^(n+1)/n (De Koninck et al., 2003, consequence of Theorem 1).

A152567 Numbers k such that A049445(k) is odd.

Original entry on oeis.org

1, 11, 19, 24, 27, 33, 43, 51, 54, 68, 71, 74, 76, 83, 89, 90, 98, 101, 107, 117, 130, 135, 138, 144, 151, 153, 156, 163, 165, 178, 181, 188, 195, 199, 203, 205, 207, 212, 215, 226, 230, 235, 238, 244, 249, 251, 258, 267, 272, 278, 282, 285, 294, 298, 304, 305, 325, 327
Offset: 1

Views

Author

Roger L. Bagula, Dec 07 2008

Keywords

Crossrefs

Programs

Extensions

Edited by N. J. A. Sloane, Dec 07 2008

A353988 Numbers k such that Fibonacci(k) is a binary Niven number (A049445).

Original entry on oeis.org

1, 2, 3, 6, 8, 9, 10, 12, 18, 24, 30, 36, 48, 56, 60, 100, 120, 144, 150, 168, 240, 270, 288, 300, 324, 330, 336, 360, 444, 540, 594, 600, 624, 720, 750, 840, 864, 896, 900, 936, 1080, 1152, 1200, 1210, 1360, 1404, 1632, 1720, 1921, 2028, 2400, 2520, 2552, 2864
Offset: 1

Views

Author

Amiram Eldar, May 13 2022

Keywords

Comments

Numbers k such that A011373(k) | A000045(k).

Examples

			1 is a term since A000045(1) = A011373(1) = 1 and 1 | 1.
10 is a term since A000045(10) = 55, A011373(1) = 5 and 5 | 55.
		

Crossrefs

Cf. A000045, A000120, A011373, A049445, A117774, A337448 (decimal analog).

Programs

  • Mathematica
    Select[Range[3000], Divisible[(f = Fibonacci[#]), DigitCount[f, 2, 1]] &]
  • PARI
    isok(k) = my(f=fibonacci(k)); ! (f % hammingweight(f)); \\ Michel Marcus, May 13 2022

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
    

A333426 Primorial base Niven numbers: numbers divisible by their sum of digits in primorial base (A276150).

Original entry on oeis.org

1, 2, 4, 6, 8, 9, 12, 16, 18, 20, 24, 25, 30, 32, 33, 36, 40, 42, 44, 45, 48, 50, 60, 64, 65, 66, 68, 70, 72, 77, 84, 88, 90, 92, 96, 105, 108, 112, 117, 120, 132, 133, 136, 144, 150, 154, 156, 160, 168, 180, 182, 184, 189, 192, 198, 200, 210, 212, 213, 216, 220
Offset: 1

Views

Author

Amiram Eldar, Mar 20 2020

Keywords

Comments

Numbers k for which A276086(k) is in A373852. - Antti Karttunen, Jun 22 2024

Examples

			1 is a term since A276150(1) = 1 divides 1;
2 is a term since A276150(2) = 1 divides 2;
		

Crossrefs

Programs

  • Mathematica
    max = 5; bases = Prime @ Range[max, 1, -1]; nmax = Times @@ bases - 1; sumdig[n_] := Plus @@ IntegerDigits[n, MixedRadix[bases]]; Select[Range[nmax], Divisible[#, sumdig[#]] &]
  • PARI
    isA333426 = A373834; \\ Antti Karttunen, Jun 22 2024

A331728 Negabinary-Niven numbers: numbers divisible by the sum of digits in their negabinary representation (A027615).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 12, 14, 15, 16, 18, 20, 21, 24, 28, 30, 32, 33, 35, 36, 40, 42, 48, 50, 52, 54, 56, 57, 60, 62, 63, 64, 66, 68, 69, 72, 76, 78, 80, 81, 84, 88, 90, 91, 95, 96, 100, 102, 108, 110, 112, 114, 120, 124, 125, 126, 128, 129, 132, 136, 138, 140
Offset: 1

Views

Author

Amiram Eldar, Jan 27 2020

Keywords

Examples

			6 is a term since A039724(6) = 11010 and 1 + 1 + 0 + 1 + 0 = 3 is a divisor of 6.
		

Crossrefs

Programs

  • Mathematica
    negaBinWt[n_] := negaBinWt[n] = If[n==0, 0, negaBinWt[Quotient[n-1, -2]] + Mod[n, 2]]; negaBinNivenQ[n_] := Divisible[n, negaBinWt[n]]; Select[Range[100], negaBinNivenQ]

A064150 Numbers divisible by the sum of their ternary digits.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 10, 12, 15, 16, 18, 20, 21, 24, 25, 27, 28, 30, 32, 33, 35, 36, 39, 40, 45, 48, 54, 56, 57, 60, 63, 64, 65, 72, 75, 77, 78, 80, 81, 82, 84, 87, 88, 90, 92, 93, 95, 96, 99, 100, 105, 108, 111, 112, 115, 117, 120, 132, 133, 135, 136, 144, 145, 150, 152
Offset: 1

Views

Author

Len Smiley, Sep 11 2001

Keywords

Comments

a(n) mod A053735(a(n)) = 0. - Reinhard Zumkeller, Nov 25 2009

Crossrefs

Cf. A005349 (Decimal), A049445 (Binary).

Programs

  • Haskell
    a064150 n = a064150_list !! (n-1)
    a064150_list = filter (\x -> x `mod` a053735 x == 0) [1..]
    -- Reinhard Zumkeller, Oct 28 2012
    
  • Mathematica
    Select[Range[200], IntegerQ[#/(Plus@@IntegerDigits[#, 3])] &] (* Alonso del Arte, May 27 2011 *)
  • PARI
    isok(m)={m % sumdigits(m, 3) == 0} \\ Harry J. Smith, Sep 09 2009
    
  • Python
    import numpy as np
    def gen():
        for dec_num in range(1,153):
            tern_num = np.base_repr(dec_num, 3)
            sum_tern_digits = 0
            for i in tern_num:
                sum_tern_digits += int(i)
            if dec_num % sum_tern_digits == 0:
                yield dec_num
    print(list((gen()))) # Adrienne Leonardo, Dec 28 2024

Extensions

Corrected and extended by Vladeta Jovovic, Sep 22 2001
Offset corrected by Reinhard Zumkeller, Oct 28 2012

A064438 Numbers which are divisible by the sum of their quaternary digits.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 20, 21, 24, 28, 30, 32, 33, 35, 36, 40, 42, 48, 50, 52, 54, 60, 63, 64, 66, 68, 69, 72, 76, 78, 80, 81, 84, 88, 90, 91, 96, 100, 102, 108, 112, 114, 120, 126, 128, 129, 132, 136, 138, 140, 144, 148, 150, 154, 156, 160, 162, 168, 171, 180
Offset: 1

Views

Author

Len Smiley, Oct 01 2001

Keywords

Comments

A good "puzzle" sequence -- guess the rule given the first twenty or so terms.

Examples

			Quaternary representation of 28 is 130, 1 + 3 + 0 = 4 divides 28.
		

Crossrefs

Cf. A005349 (decimal), A049445 (binary), A064150 (ternary).

Programs

  • ARIBAS
    maxarg := 190; for n := 1 to maxarg do if n mod sum(quaternarray(n)) = 0 then write(n," "); end; end; function quaternarray(n: integer): array; var k: integer; stk: stack; begin while n > 0 do k := n mod 4; stack_push(stk,k); n := (n - k) div 4; end; return stack2array(stk); end;
    
  • Mathematica
    Select[Range[200],Divisible[#,Total[IntegerDigits[#,4]]]&] (* Harvey P. Dale, Jun 09 2011 *)
  • PARI
    isok(n) = !(n % sumdigits(n, 4)); \\ Michel Marcus, Jun 24 2018
    
  • Python
    from sympy.ntheory.factor_ import digits
    print([n for n in range(1, 201) if n%sum(digits(n, 4)[1:]) == 0]) # Indranil Ghosh, Apr 24 2017

Extensions

More terms from Matthew Conroy, Oct 02 2001
Offset changed from 0 to 1 by Harry J. Smith, Sep 14 2009

A064481 Numbers which are divisible by the sum of their base-5 digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 16, 18, 20, 24, 25, 26, 27, 28, 30, 32, 36, 40, 42, 45, 48, 50, 51, 52, 54, 56, 60, 63, 64, 65, 66, 72, 75, 76, 78, 80, 85, 88, 90, 91, 96, 99, 100, 102, 104, 105, 112, 117, 120, 125, 126, 128, 130, 132, 135, 136, 138, 140, 144, 145
Offset: 1

Views

Author

Klaus Brockhaus, Oct 03 2001

Keywords

Examples

			Base-5 representation of 28 is 103; 1 + 0 + 3 = 4 divides 28.
		

Crossrefs

Cf. A005349 (base 10), A049445 (base 2), A064150 (base 3), A064438 (base 4), A344341.

Programs

  • ARIBAS
    : maxarg := 160; for n := 1 to maxarg do if n mod sum(basearray(n,5)) = 0 then write(n," "); end; end; function basearray(n,b: integer): array; var k: integer; stk: stack; begin while n > 0 do k := n mod b; stack_push(stk,k); n := (n - k) div b; end; return stack2array(stk); end;.
    
  • PARI
    isok(n) = !(n % sumdigits(n, 5)); \\ Michel Marcus, Jun 24 2018

Extensions

Offset changed from 0 to 1 by Harry J. Smith, Sep 15 2009

A334308 Base phi Niven numbers: numbers divisible by the number of 1's in their base phi representation (A055778).

Original entry on oeis.org

1, 2, 6, 12, 15, 16, 18, 20, 30, 35, 36, 45, 48, 55, 60, 70, 72, 78, 84, 90, 91, 95, 96, 98, 104, 108, 132, 144, 147, 154, 168, 175, 184, 189, 208, 224, 231, 232, 245, 252, 256, 261, 264, 270, 275, 280, 282, 287, 294, 315, 322, 324, 330, 336, 340, 342, 351, 357
Offset: 1

Views

Author

Amiram Eldar, Apr 22 2020

Keywords

Examples

			6 is a term since its base phi representation is 1010.0001, and the number of 1's is 3, which is a divisor of 6.
		

Crossrefs

Programs

  • Mathematica
    phiDigSum[1] = 1; phiDigSum[n_] := Plus @@ RealDigits[n, GoldenRatio, 2*Ceiling[ Log[GoldenRatio, n]] ][[1]]; Select[Range[360], Divisible[#, phiDigSum[#]] &]
Previous Showing 11-20 of 73 results. Next