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 317 results. Next

A342262 Numbers divisible both by the product of their nonzero digits (A055471) and by the sum of their digits (A005349).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 20, 24, 30, 36, 40, 50, 60, 70, 80, 90, 100, 102, 110, 111, 112, 120, 132, 135, 140, 144, 150, 200, 210, 216, 220, 224, 240, 300, 306, 312, 315, 360, 400, 432, 480, 500, 510, 540, 550, 600, 612, 624, 630, 700, 735, 800, 900, 1000, 1002, 1008
Offset: 1

Views

Author

Bernard Schott, Mar 27 2021

Keywords

Comments

Equivalently, Niven numbers that are divisible by the product of their nonzero digits. A Niven number (A005349) is a number that is divisible by the sum of its digits.
Niven numbers without zero digit that are divisible by the product of their digits are in A038186.
Differs from super Niven numbers, the first 16 terms are the same, then A328273(17) = 48 while a(17) = 50.
This sequence is infinite since if m is a term, then 10*m is another term.

Examples

			The product of the nonzero digits of 306 =  3*6 = 18, and 306 divided by 18 = 17. The sum of the digits of 306 = 3 + 0 + 6 = 9, and 306 divided by 9 = 34. Thus 306 is a term.
		

Crossrefs

Intersection of A005349 and A055471.
Supersequence of A038186.

Programs

  • Mathematica
    q[n_] := And @@ Divisible[n, {Times @@ (d = Select[IntegerDigits[n], # > 0 &]), Plus @@ d}]; Select[Range[1000], q] (* Amiram Eldar, Mar 27 2021 *)
    Select[Range[1200],Mod[#,Times@@(IntegerDigits[#]/.(0->1))]== Mod[#,Total[ IntegerDigits[#]]]==0&] (* Harvey P. Dale, Sep 26 2021 *)
  • PARI
    isok(m) = my(d=select(x->(x!=0), digits(m))); !(m % vecprod(d)) && !(m % vecsum(d)); \\ Michel Marcus, Mar 27 2021

Extensions

Example clarified by Harvey P. Dale, Sep 26 2021

A082517 Numbers n such that N(n+1) - N(n) sets a new record, where N(n) = A005349.

Original entry on oeis.org

1, 10, 11, 26, 28, 32, 83, 102, 143, 561, 716, 1118, 2948, 4194, 5439, 33494, 51544, 61588, 94748, 265336, 800054, 3750017, 6292149, 44194186, 55065654, 61074615, 179838772, 399977785, 497993710, 502602764, 547594831, 1039028518, 14192408715, 14761794180
Offset: 1

Views

Author

Jason Earls, Apr 30 2003

Keywords

Crossrefs

Where records occur in A082516. Cf. A005349.

Extensions

a(22)-a(34) from Donovan Johnson, Nov 10 2011

A092787 Primes in the sequence A005349 - 1.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 19, 23, 29, 41, 47, 53, 59, 71, 79, 83, 89, 101, 107, 109, 113, 131, 139, 149, 151, 179, 191, 197, 199, 223, 227, 229, 233, 239, 251, 263, 269, 307, 311, 359, 401, 409, 419, 431, 439, 443, 449, 467, 479, 499, 503, 509, 521, 557, 587, 593, 599
Offset: 1

Views

Author

Jorge Coveiro, Apr 14 2004

Keywords

Crossrefs

Cf. A005349.

Programs

  • Mathematica
    nivenQ[n_] := Divisible[n, Plus @@ IntegerDigits[n]]; Select[Range[600], PrimeQ[#] && nivenQ[# + 1] &] (* Amiram Eldar, Dec 05 2021 *)

Extensions

More terms from Pab Ter (pabrlos(AT)yahoo.com), May 24 2004

A100432 Bisection of A005349.

Original entry on oeis.org

1, 3, 5, 7, 9, 12, 20, 24, 30, 40, 45, 50, 60, 70, 80, 84, 100, 108, 111, 114, 120, 132, 135, 144, 152, 156, 171, 190, 195, 200, 204, 209, 216, 222, 225, 230, 240, 247, 261, 266, 280, 288, 306, 312, 320, 324, 333, 342, 360, 370, 375, 392, 399, 402, 407, 410, 420
Offset: 1

Views

Author

N. J. A. Sloane, Nov 20 2004

Keywords

Crossrefs

Programs

  • Magma
    A005349:=[n: n in [1..10000] | n mod &+Intseq(n) eq 0];
    A100432:= func< n | A005349[2*n-1] >;
    [A100432(n): n in [1..150]]; // G. C. Greubel, Apr 09 2023
    
  • 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: A:=[seq(p(n),n=1..440)]: seq(A[2*j-1],j=1..58); # Emeric Deutsch, Dec 16 2004
  • Mathematica
    Select[Range[1000], Divisible[#, Total[IntegerDigits[#]]] &][[1;; ;; 2]] (* G. C. Greubel, Apr 09 2023 *)
  • SageMath
    A005349=[n for n in (1..10^4) if sum(n.digits(base=10)).divides(n)]
    def A100432(n): return A005349[2*n-2]
    [A100432(n) for n in range(1, 151)] # G. C. Greubel, Apr 09 2023

Formula

a(n) = A005349(2*n-1). - G. C. Greubel, Apr 09 2023

Extensions

More terms from Emeric Deutsch, Dec 16 2004

A349484 Niven numbers whose arithmetic derivative is also a Niven number (A005349).

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 10, 18, 20, 21, 27, 36, 48, 50, 54, 72, 81, 100, 108, 111, 112, 135, 153, 156, 180, 192, 201, 209, 210, 216, 224, 225, 230, 243, 280, 288, 306, 324, 336, 351, 364, 378, 392, 400, 405, 407, 420, 432, 441, 480, 481, 486, 500, 504, 511, 512
Offset: 1

Views

Author

Marius A. Burtea, Nov 20 2021

Keywords

Comments

The sequence is infinite because the numbers of the form m = 2*10^(10^k), k >= 1, are terms. Indeed, m is a Niven number, m' = 10^(10^k) + 2*10^k*10^(10^k - 1)*7 = 10^(10^k - 1)*(10 + 140*10^k) = 10^(10^k)*(1 + 14*10^k), digsum(m') = 6 and m' is divisible by 6, so it is a Niven number.

Examples

			2 = A005349(2) and 2' = 1 = A005349(1), so 2 is a term.
18 = A005349(12) and 18' = 21 = A005349(14), so 18 is a term.
		

Crossrefs

Cf. A002808, A005349 (Niven numbers), A003415 (arithmetic derivative).

Programs

  • Magma
    f:=func; a:=[]; niven:=func; [n:n in [2..520]|niven(n) and niven(Floor(f(n)))];
  • Mathematica
    nivenQ[n_] := Divisible[n, Plus @@ IntegerDigits[n]]; d[n_] := n * Plus @@ ((Last[#]/First[#]) & /@ FactorInteger[n]); Select[Range[2, 512], And @@ nivenQ /@ {#, d[#]} &] (* Amiram Eldar, Nov 20 2021 *)

A007602 Numbers that are divisible by the product of their digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 24, 36, 111, 112, 115, 128, 132, 135, 144, 175, 212, 216, 224, 312, 315, 384, 432, 612, 624, 672, 735, 816, 1111, 1112, 1113, 1115, 1116, 1131, 1176, 1184, 1197, 1212, 1296, 1311, 1332, 1344, 1416, 1575, 1715, 2112, 2144
Offset: 1

Views

Author

Keywords

Comments

These are called Zuckerman numbers to base 10. [So-named by J. J. Tattersall, after Herbert S. Zuckerman. - Charles R Greathouse IV, Jun 06 2017] - Howard Berman (howard_berman(AT)hotmail.com), Nov 09 2008
This sequence is a subsequence of A180484; the first member of A180484 that is not a member of A007602 is 1114. - D. S. McNeil, Sep 09 2010
Complement of A188643; A188642(a(n)) = 1; A038186 is a subsequence; A168046(a(n)) = 1: subsequence of A052382. - Reinhard Zumkeller, Apr 07 2011
The terms of n digits in the sequence, for n from 1 to 14, are 9, 5, 20, 40, 117, 285, 747, 1951, 5229, 13493, 35009, 91792, 239791, 628412, 1643144, 4314987. Empirically, the counts seem to grow as 0.858*2.62326^n. - Giovanni Resta, Jun 25 2017
De Koninck and Luca showed that the number of Zuckerman numbers below x is at least x^0.122 but at most x^0.863. - Tomohiro Yamada, Nov 17 2017
The quotients obtained when Zuckerman numbers are divided by the product of their digits are in A288069. - Bernard Schott, Mar 28 2021

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters (2005), 2nd Edition, p. 86 (see problems 44-45).

Crossrefs

Cf. A286590 (for factorial-base analog).
Subsequence of A002796, A034838, and A055471.

Programs

  • Haskell
    import Data.List (elemIndices)
    a007602 n = a007602_list !! (n-1)
    a007602_list = map succ $ elemIndices 1 $ map a188642 [1..]
    -- Reinhard Zumkeller, Apr 07 2011
    
  • Magma
    [ n: n in [1..2144] | not IsZero(&*Intseq(n)) and IsZero(n mod &*Intseq(n)) ];  // Bruno Berselli, May 28 2011
    
  • Maple
    filter:= proc(n)
    local p;
    p:= convert(convert(n,base,10),`*`);
    p <> 0 and n mod p = 0
    end proc;
    select(filter, [$1..10000]); # Robert Israel, Aug 24 2014
  • Mathematica
    zuckerQ[n_] := Module[{d = IntegerDigits[n], prod}, prod = Times @@ d; prod > 0 && Mod[n, prod] == 0]; Select[Range[5000], zuckerQ] (* Alonso del Arte, Aug 04 2004 *)
  • PARI
    for(n=1,10^5,d=digits(n);p=prod(i=1,#d,d[i]);if(p&&n%p==0,print1(n,", "))) \\ Derek Orr, Aug 25 2014
  • Python
    from operator import mul
    from functools import reduce
    A007602 = [n for n in range(1,10**5) if not (str(n).count('0') or n % reduce(mul, (int(d) for d in str(n))))] # Chai Wah Wu, Aug 25 2014
    

A049445 Numbers k with the property that the number of 1's in binary expansion of k (see A000120) divides k.

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 21, 24, 32, 34, 36, 40, 42, 48, 55, 60, 64, 66, 68, 69, 72, 80, 81, 84, 92, 96, 108, 110, 115, 116, 120, 126, 128, 130, 132, 136, 138, 144, 155, 156, 160, 162, 168, 172, 180, 184, 185, 192, 204, 205, 212, 216, 220, 222, 228
Offset: 1

Views

Author

Keywords

Comments

If instead of base 2 we take base 10, then we have the so-called Harshad or Niven numbers (i.e., positive integers divisible by the sum of their digits; A005349). - Emeric Deutsch, Apr 11 2007
A199238(a(n)) = 0. - Reinhard Zumkeller, Nov 04 2011

Examples

			20 is in the sequence because 20 is written 10100 in binary and 1 + 1 = 2, which divides 20.
21 is in the sequence because 21 is written 10101 in binary and 1 + 1 + 1 = 3, which divides 21.
22 is not in the sequence because 22 is written 10110 in binary 1 + 1 + 1 = 3, which does not divide 22.
		

Crossrefs

Programs

  • Haskell
    a049445 n = a049445_list !! (n-1)
    a049445_list = map (+ 1) $ elemIndices 0 a199238_list
    -- Reinhard Zumkeller, Nov 04 2011
    
  • Maple
    a:=proc(n) local n2: n2:=convert(n,base,2): if n mod add(n2[i],i=1..nops(n2)) = 0 then n else fi end: seq(a(n),n=1..300); # Emeric Deutsch, Apr 11 2007
  • Mathematica
    binHarshadQ[n_] := Divisible[n, Count[IntegerDigits[n, 2], 1]]; Select[Range[228], binHarshadQ] (* Jean-François Alcover, Dec 01 2011 *)
    Select[Range[300],Divisible[#,DigitCount[#,2,1]]&] (* Harvey P. Dale, Mar 20 2016 *)
  • PARI
    for(n=1,1000,b=binary(n);l=length(b); if(n%sum(i=1,l, component(b,i))==0,print1(n,",")))
    
  • PARI
    is_A049445(n)={n%norml2(binary(n))==0} \\ M. F. Hasler, Oct 09 2012
    
  • PARI
    isok(n) = ! (n % hammingweight(n)); \\ Michel Marcus, Feb 10 2016
    
  • Python
    A049445 = [n for n in range(1,10**5) if not n % sum([int(d) for d in bin(n)[2:]])] # Chai Wah Wu, Aug 22 2014

Formula

{k : A000120(k) | k}. - R. J. Mathar, Mar 03 2008
a(n) seems to be asymptotic to c*n*log(n) where 0.7 < c < 0.8. - Benoit Cloitre, Jan 22 2003
Heuristically, c should be 1/(2*log(2)), since a random d-bit number should have probability approximately 2/d of being in the sequence. - Robert Israel, Aug 22 2014
{a(n)} = {k : A199238(k) = 0}. - M. F. Hasler, Oct 09 2012
De Koninck et al. (2003) proved that the number of base-b Niven numbers not exceeding x, N_b(x), is asymptotically equal to ((2*log(b)/(b-1)^2) * Sum_{j=1..b-1} gcd(j, b-1) + o(1)) * x/log(x). For b=2, N_2(n) ~ (2*log(2) + o(1)) * x/log(x). Therefore, the constant c mentioned above is indeed 1/(2*log(2)). - Amiram Eldar, Aug 16 2020

Extensions

More terms from Michael Somos
Edited by N. J. A. Sloane, Oct 07 2005 and May 16 2008

A328208 Zeckendorf-Niven numbers: numbers divisible by the number of terms in their Zeckendorf representation (A007895).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 12, 13, 14, 16, 18, 21, 22, 24, 26, 27, 30, 34, 36, 42, 45, 48, 55, 56, 58, 60, 66, 68, 69, 72, 76, 78, 80, 81, 84, 89, 90, 92, 93, 94, 96, 99, 102, 105, 108, 110, 111, 116, 120, 126, 132, 135, 140, 144, 146, 150, 152, 153, 156, 159, 162
Offset: 1

Views

Author

Amiram Eldar, Oct 07 2019

Keywords

Examples

			12 is in the sequence since A007895(12) = 3 and 3 is a divisor of 12.
		

References

  • Andrew Ray, On the natural density of the k-Zeckendorf Niven numbers, Ph.D. dissertation, Central Missouri State University, 2005.

Crossrefs

Programs

  • Maple
    fib:= combinat:-fibonacci:
    phi:= 1/2 + sqrt(5)/2:
    fibapp:= n -> phi^n/sqrt(5):
    invfib := proc(x::posint)
      local q, n;
      q:= evalf((ln(x+1/2) + ln(5)/2)/ln(phi));
      n:= floor(q);
      if fib(n) <= x then
        while fib(n+1) <= x do
          n := n+1
        end do
      else
        while fib(n) > x do
          n := n-1
        end do
      end if;
      n
    end proc:
    zeck:= proc(x) local n;
     if x = 0 then 0
     else
       n:= invfib(x);
       F[n] + zeck(x-fib(n));
     fi
    end proc:
    filter:= n -> n mod nops(zeck(n)) = 0:
    select(filter, [$1..200]); # Robert Israel, Oct 25 2019
  • Mathematica
    z[n_] := Length[DeleteCases[NestWhileList[# - Fibonacci[Floor[Log[Sqrt[5]*# + 3/2]/Log[GoldenRatio]]] &, n, # > 1 &], 0]]; aQ[n_] := Divisible[n, z[n]]; Select[Range[1000], aQ] (* after Alonso del Arte at A007895 *)

A118363 Factorial base Niven (or Harshad) numbers: numbers that are divisible by the sum of their factorial base digits.

Original entry on oeis.org

1, 2, 4, 6, 8, 9, 12, 16, 18, 20, 24, 26, 27, 30, 35, 36, 40, 48, 52, 54, 56, 60, 70, 72, 75, 80, 90, 91, 96, 105, 108, 112, 117, 120, 122, 123, 126, 132, 135, 140, 144, 148, 150, 152, 156, 161, 168, 175, 180, 186, 192, 204, 208, 210, 222, 224, 240, 244, 245, 246
Offset: 1

Views

Author

Alonso del Arte, May 15 2006

Keywords

Comments

Also called "Fiven" numbers [Dahlenberg and Edgar]. - N. J. A. Sloane, Jun 25 2018

Examples

			a(8) = 16 because it is written 220 in factorial base and 2 + 2 + 0 = 4, which is a divisor of 16.
17 is not on the list because it is written 221 in factorial base and 2 + 2 + 1 = 5, which is not a divisor of 17.
		

Crossrefs

Cf. A007623 (integers written in factorial base), A005349 (base 10 Harshad numbers).
Cf. A286607 (complement), A034968, A286590.
Positions of zeros in A286604.

Programs

  • Mathematica
    (*For the definition of the factorial base version of IntegerDigits, see A007623*) Select[Range[250],IntegerQ[ #/(Plus@@factBaseIntDs[ # ])]&]
  • PARI
    is(n) = {my(k = n, m = 2, r, s = 0); while([k, r] = divrem(k, m); k != 0 || r != 0, s += r; m++); !(n % s);} \\ Amiram Eldar, Oct 08 2024
  • Python
    def a007623(n, p=2): return n if n

A154701 Numbers k such that k, k + 1 and k + 2 are 3 consecutive Harshad numbers.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 110, 510, 511, 1010, 1014, 1015, 2022, 2023, 2464, 3030, 3031, 4912, 5054, 5831, 7360, 8203, 9854, 10010, 10094, 10307, 10308, 11645, 12102, 12103, 12255, 12256, 13110, 13111, 13116, 13880, 14704, 15134, 17152, 17575, 18238, 19600, 19682
Offset: 1

Views

Author

Avik Roy (avik_3.1416(AT)yahoo.co.in), Jan 14 2009, Jan 15 2009

Keywords

Comments

Harshad numbers are also known as Niven numbers.
Cooper and Kennedy proved that there are infinitely many runs of 20 consecutive Niven numbers. Therefore this sequence is infinite. - Amiram Eldar, Jan 03 2020

Examples

			110 is a term since 110 is divisible by 1 + 1 + 0 = 2, 111 is divisible by 1 + 1 + 1 = 3, and 112 is divisible by 1 + 1 + 2 = 4.
		

References

  • Jean-Marie De Koninck, Those Fascinating Numbers, American Mathematical Society, 2009, p. 36, entry 110.

Crossrefs

Programs

  • C
    #include 
    #include 
    int is_harshad(int n){
      int i,j,count=0;
      i=n;
      while(i>0){
        count=count+i%10;
        i=i/10;
      }
      return n%count==0?1:0;
    }
    main(){
      int k;
      clrscr();
      for(k=1;k<=30000;k++)
        if(is_harshad(k)&&is_harshad(k+1)&&is_harshad(k+2))
          printf("%d,",k);
      getch();
      return 0;
    }
    
  • Magma
    f:=func; a:=[]; for k in [1..20000] do  if forall{m:m in [0..2]|f(k+m)} then Append(~a,k); end if; end for; a; // Marius A. Burtea, Jan 03 2020
    
  • Maple
    Res:= NULL: count:= 0:
    state:= 1:
    L:= [1]:
    for n from 2 while count < 100 do
      L[1]:=L[1]+1;
      for k from 1 while L[k]=10 do L[k]:= 0;
        if k = nops(L) then L:= [0$nops(L),1]; break
        else L[k+1]:= L[k+1]+1 fi
      od:
      s:= convert(L,`+`);
      if n mod s = 0 then
         state:= min(state+1,3);
         if state = 3 then count:= count+1; Res:= Res, n-2; fi
      else state:= 0
      fi
    od:
    Res; # Robert Israel, Feb 01 2019
  • Mathematica
    nivenQ[n_] := Divisible[n, Total @ IntegerDigits[n]]; niv = nivenQ /@ Range[3]; seq = {}; Do[niv = Join[Rest[niv], {nivenQ[k]}]; If[And @@ niv, AppendTo[seq, k - 2]], {k, 3, 2*10^4}]; seq (* Amiram Eldar, Jan 03 2020 *)
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        h1, h2, h3 = 1, 2, 3
        while True:
            if h3 - h1 == 2: yield h1
            h1, h2, h3 = h2, h3, next(k for k in count(h3+1) if k%sum(map(int, str(k))) == 0)
    print(list(islice(agen(), 45))) # Michael S. Branicky, Mar 17 2024
Previous Showing 11-20 of 317 results. Next