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

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

A330931 Numbers k such that both k and k + 1 are Niven numbers in base 2 (A049445).

Original entry on oeis.org

1, 20, 68, 80, 115, 155, 184, 204, 260, 272, 284, 320, 344, 355, 395, 404, 424, 464, 555, 564, 595, 623, 624, 636, 664, 675, 804, 835, 846, 847, 864, 875, 888, 904, 972, 1028, 1040, 1075, 1088, 1124, 1164, 1182, 1211, 1224, 1239, 1266, 1280, 1304, 1315, 1424
Offset: 1

Views

Author

Amiram Eldar, Jan 03 2020

Keywords

Comments

Cai proved that there are infinitely many runs of 4 consecutive Niven numbers in base 2. Therefore this sequence is infinite.

Examples

			20 is a term since 20 and 20 + 1 = 21 are both Niven numbers in base 2.
		

References

  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 382.

Crossrefs

Programs

  • Magma
    f:=func; a:=[]; for k in [1..1500] do  if forall{m:m in [0..1]|f(k+m)} then Append(~a,k); end if; end for; a; // Marius A. Burtea, Jan 03 2020
    
  • Mathematica
    binNivenQ[n_] := Divisible[n, Total @ IntegerDigits[n, 2]]; bnq1 = binNivenQ[1]; seq = {}; Do[bnq2 = binNivenQ[k]; If[bnq1 && bnq2, AppendTo[seq, k - 1]]; bnq1 = bnq2, {k, 2, 10^4}]; seq
  • Python
    def sbd(n): return sum(map(int, str(bin(n)[2:])))
    def niv2(n): return n%sbd(n) == 0
    def aupto(nn): return [k for k in range(1, nn+1) if niv2(k) and niv2(k+1)]
    print(aupto(1424)) # Michael S. Branicky, Jan 20 2021

A330933 Starts of runs of 4 consecutive Niven numbers in base 2 (A049445).

Original entry on oeis.org

6222, 33102, 53262, 66702, 94830, 221550, 268302, 284910, 295182, 300750, 316590, 364110, 379950, 427470, 533950, 554190, 570030, 590862, 617550, 633390, 696750, 791790, 807630, 855150, 870990, 902670, 934350, 1081422, 1140270, 1282830, 1314510, 1330350, 1343502
Offset: 1

Views

Author

Amiram Eldar, Jan 03 2020

Keywords

Comments

Cai proved that there are infinitely many runs of 4 consecutive Niven numbers in base 2.
Grundman proved that there are no runs of 5 or more consecutive Niven numbers in base 2.

Examples

			6222 is a term since 6222, 6223, 6224 and 6225 are all Niven numbers in base 2.
		

References

  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 382.

Crossrefs

Programs

  • Magma
    f:=func; a:=[]; for k in [1..1400000] do  if forall{m:m in [0..3]|f(k+m)} then Append(~a,k); end if; end for; a; // Marius A. Burtea, Jan 03 2020
  • Mathematica
    binNivenQ[n_] := Divisible[n, Total @ IntegerDigits[n, 2]]; bin = binNivenQ /@ Range[4]; seq = {}; Do[bin = Join[Rest[bin], {binNivenQ[k]}]; If[And @@ bin, AppendTo[seq, k - 3]], {k, 4, 10^6}]; seq

A331087 Starts of runs of 3 consecutive positive negaFibonacci-Niven numbers (A331085).

Original entry on oeis.org

4, 12, 86, 87, 88, 176, 230, 231, 232, 320, 464, 655, 1194, 1592, 1596, 1854, 1914, 2815, 3016, 3294, 4124, 4178, 4179, 4180, 4268, 4412, 5663, 5755, 8360, 9894, 10614, 10703, 10915, 10975, 13936, 14994, 15114, 15714, 17630, 18976, 19984, 20824, 21835, 23175, 23513
Offset: 1

Views

Author

Amiram Eldar, Jan 08 2020

Keywords

Comments

Numbers of the form F(6*k + 1) - 1, where F(m) is the m-th Fibonacci number, are terms.
Numbers of the form F(k) - 3, where k is congruent to {5, 11, 13, 19} mod 24 (A269819) are starts of runs of 5 consecutive negaFibonacci-Niven numbers.

Crossrefs

Programs

  • Mathematica
    ind[n_] := Floor[Log[Abs[n]*Sqrt[5] + 1/2]/Log[GoldenRatio]];
    f[1] = 1; f[n_] := If[n > 0, i = ind[n - 1]; If[EvenQ[i], i++]; i, i = ind[-n]; If[OddQ[i], i++]; i];
    negaFibTermsNum[n_] := Module[{k = n, s = 0}, While[k != 0, i = f[k]; s += 1; k -= Fibonacci[-i]]; s];
    negFibQ[n_] := Divisible[n, negaFibTermsNum[n]];
    nConsec = 3; neg = negFibQ /@ Range[nConsec]; seq = {}; c = 0; k = nConsec + 1; While[c < 55, If[And @@ neg, c++; AppendTo[seq, k - nConsec]];neg = Join[Rest[neg], {negFibQ[k]}]; k++]; seq

A333428 Starts of runs of 3 consecutive primorial base Niven numbers (A333426).

Original entry on oeis.org

64, 244, 424, 2344, 2524, 4624, 16180, 30064, 30244, 32344, 43900, 60064, 71620, 91408, 99340, 127060, 154780, 182500, 210220, 250936, 338632, 365860, 477280, 510544, 510724, 512824, 513160, 540544, 540880, 790900, 842884, 876988, 1021024, 1021648, 1024000, 1051720
Offset: 1

Views

Author

Amiram Eldar, Mar 20 2020

Keywords

Examples

			64 is a term since 64, 65 and 66 are all primorial base Niven numbers.
		

Crossrefs

Programs

  • Mathematica
    max = 7; bases = Prime @ Range[max, 1, -1]; nmax = Times @@ bases - 1; primNivenQ[n_] := Divisible[n, Plus @@ IntegerDigits[n, MixedRadix[bases]]]; q1 = primNivenQ[1]; q2 = primNivenQ[2]; seq = {}; Do[q3 = primNivenQ[n]; If[q1 && q2 && q3, AppendTo[seq, n - 2]]; q1 = q2; q2 = q3, {n, 3, nmax}]; seq

A342428 Starts of runs of 3 consecutive Niven numbers in base 3/2 (A342426).

Original entry on oeis.org

2196, 7656, 15624, 16335, 64375, 109224, 171624, 202824, 328887, 329427, 392733, 393640, 447578, 482238, 494450, 520695, 631824, 723519, 773790, 785695, 820960, 876987, 981783, 986607, 1021824, 1026750, 1030455, 1084048, 1108094, 1160670, 1235070, 1242824, 1412908
Offset: 1

Views

Author

Amiram Eldar, Mar 11 2021

Keywords

Examples

			2196 is a term since 2196, 2197 and 2198 are all Niven numbers in base 3/2.
		

Crossrefs

Subsequence of A342426 and A342427.
Subsequences: A342429.
Similar sequences: A154701 (decimal), A328206 (factorial), A328210 (Zeckendorf), A328214 (lazy Fibonacci), A330932 (binary), A331087 (negaFibonacci), A333428 (primorial), A334310 (base phi), A331822 (negabinary).

Programs

  • Mathematica
    s[0] = 0; s[n_] := s[n] = s[2*Floor[n/3]] + Mod[n, 3]; q[n_] := Divisible[n, s[n]]; Select[Range[10^6], AllTrue[# + {0, 1, 2}, q] &]

A331822 Starts of runs of 3 consecutive positive negabinary-Niven numbers (A331728).

Original entry on oeis.org

1, 2, 14, 62, 124, 184, 244, 254, 304, 468, 484, 544, 784, 904, 964, 1022, 1084, 1098, 1144, 1264, 1265, 1308, 1448, 1504, 1518, 1924, 1938, 1984, 2044, 2104, 2105, 2358, 2888, 2944, 2945, 3064, 3198, 3248, 3424, 3544, 3604, 3618, 3664, 3828, 3844, 3904, 3964
Offset: 1

Views

Author

Amiram Eldar, Jan 27 2020

Keywords

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]]; nConsec = 3; neg = negaBinNivenQ /@ Range[nConsec]; seq = {}; c = 0; k = nConsec+1; While[c < 50, If[And @@ neg, c++; AppendTo[seq, k - nConsec]]; neg = Join[Rest[neg], {negaBinNivenQ[k]}]; k++]; seq

A334310 Starts of runs of 3 consecutive base phi Niven numbers (A334308).

Original entry on oeis.org

17171, 20760, 29183, 32772, 51336, 65840, 66608, 67990, 89054, 95563, 103682, 108910, 133990, 136512, 167598, 173640, 190094, 197218, 205478, 207364, 223873, 241934, 247115, 248443, 252014, 258816, 261135, 278783, 285129, 285130, 289392, 325934, 326520, 335178
Offset: 1

Views

Author

Amiram Eldar, Apr 22 2020

Keywords

Examples

			17171 is a term since 17171, 17172 and 17173 are all base phi Niven numbers.
		

Crossrefs

Programs

  • Mathematica
    phiDigSum[1] = 1; phiDigSum[n_] := Plus @@ RealDigits[n, GoldenRatio, 2*Ceiling[ Log[GoldenRatio, n] ]][[1]]; phiNivenQ[n_] := Divisible[n, phiDigSum[n]]; q1 = phiNivenQ[1]; q2 = phiNivenQ[2]; seq = {}; Do[q3 = phiNivenQ[n]; If[q1 && q2 && q3, AppendTo[seq, n - 2]]; q1 = q2; q2 = q3, {n, 3, 300000}]; seq

A344343 Starts of runs of 3 consecutive Gray-code Niven numbers (A344341).

Original entry on oeis.org

1, 2, 6, 7, 14, 30, 31, 62, 126, 127, 174, 184, 234, 243, 254, 304, 474, 483, 510, 511, 534, 543, 544, 783, 784, 903, 904, 954, 963, 1022, 1134, 1144, 1253, 1264, 1448, 1475, 1504, 1895, 1914, 1923, 1974, 2046, 2047, 2093, 2094, 2104, 2814, 2888, 2944, 3054, 3064
Offset: 1

Views

Author

Amiram Eldar, May 15 2021

Keywords

Examples

			1 is a term since 1, 2 and 3 are all Gray-code Niven numbers.
		

Crossrefs

Subsequence of A344341 and A344342.
Subsequences: A344344.
Similar sequences: A154701 (decimal), A328206 (factorial), A328210 (Zeckendorf), A328214 (lazy Fibonacci), A330932 (binary), A331087 (negaFibonacci), A333428 (primorial), A334310 (base phi), A331822 (negabinary), A342428 (base 3/2).

Programs

  • Mathematica
    gcNivenQ[n_] := Divisible[n, DigitCount[BitXor[n, Floor[n/2]], 2, 1]]; Select[Range[3000], AllTrue[# + {0, 1, 2}, gcNivenQ] &]

A351721 Starts of runs of 3 consecutive lazy-Lucas-Niven numbers (A351719).

Original entry on oeis.org

607068, 640618, 665720, 900921, 1000880, 1375940, 1505878, 1537250, 1924224, 1938508, 1966338, 2527998, 3394224, 3935424, 4242624, 4476624, 4747224, 4794624, 5351367, 5401824, 5526024, 5636356, 5992298, 6103900, 6343298, 7028362, 7113024, 8879424, 8998262, 9431424
Offset: 1

Views

Author

Amiram Eldar, Feb 17 2022

Keywords

Comments

Conjecture: There are no runs of 4 consecutive lazy-Lucas-Niven numbers (checked up to 3*10^9).

Examples

			607068 is a term since 607068, 607069 and 607070 are all divisible by the number of terms in their maximal representation:
     k                   A130311(k)  A131343(k)  k/A131343(k)
-------------------------------------------------------------
607068  111010101010101011110111101         18          33726
607069  111010101010101011110111111         19          31951
607070  111010101010101011111010110         17          35710
		

Crossrefs

Showing 1-10 of 28 results. Next