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

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

A330932 Starts of runs of 3 consecutive Niven numbers in base 2 (A049445).

Original entry on oeis.org

623, 846, 2358, 4206, 4878, 6127, 6222, 6223, 12438, 16974, 21006, 27070, 31295, 33102, 33103, 35343, 37134, 37630, 37638, 40703, 43263, 45550, 48190, 49230, 52590, 53262, 53263, 56110, 59630, 66198, 66702, 66703, 67878, 69310, 69487, 72655, 74766, 77230, 77958
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

			623 is a term since 623, 624 and 625 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..80000] 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
  • Mathematica
    binNivenQ[n_] := Divisible[n, Total @ IntegerDigits[n, 2]]; bin = binNivenQ /@ Range[3]; seq = {}; Do[bin = Join[Rest[bin], {binNivenQ[k]}]; If[And @@ bin, AppendTo[seq, k - 2]], {k, 3, 8*10^4}]; seq

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

A376616 Binary Niven numbers (A049445) k such that k/wt(k) is also a binary Niven number, where wt(k) = A000120(k) is the binary weight of k.

Original entry on oeis.org

1, 2, 4, 8, 12, 16, 20, 24, 32, 36, 40, 48, 64, 68, 72, 80, 96, 126, 128, 132, 136, 144, 160, 192, 240, 252, 256, 260, 264, 272, 276, 288, 320, 324, 345, 368, 384, 405, 414, 432, 460, 464, 480, 486, 504, 512, 516, 520, 528, 544, 552, 576, 624, 640, 648, 688, 690
Offset: 1

Views

Author

Amiram Eldar, Sep 30 2024

Keywords

Comments

Numbers k such that A376615(k) = 0 or A376615(k) >= 3.
If m is a term then 2^k * m is a term for all k >= 0.

Examples

			12 is a term since 12/wt(12) = 6 is an integer and also 6/wt(6) = 3 is an integer.
		

Crossrefs

Subsequence of A049445.
Subsequences: A000079, A376617, A376618.

Programs

  • Mathematica
    q[k_] := Module[{w = DigitCount[k, 2, 1]}, Divisible[k, w] && Divisible[k/w, DigitCount[k/w, 2, 1]]]; Select[Range[1000], q]
  • PARI
    is(k) = {my(w = hammingweight(k)); !(k % w) && !((k/w) % hammingweight(k/w));}

A376617 Binary Niven numbers (A049445) k such that m = k/wt(k) and m/wt(m) are also binary Niven numbers, where wt(k) = A000120(k) is the binary weight of k.

Original entry on oeis.org

1, 2, 4, 8, 16, 24, 32, 40, 48, 64, 72, 80, 96, 128, 136, 144, 160, 192, 256, 264, 272, 288, 320, 384, 512, 520, 528, 544, 576, 640, 756, 768, 960, 1024, 1032, 1040, 1056, 1088, 1104, 1152, 1280, 1296, 1380, 1472, 1512, 1536, 1620, 1656, 1728, 1840, 1856, 1920, 1944
Offset: 1

Views

Author

Amiram Eldar, Sep 30 2024

Keywords

Comments

Numbers k such that A376615(k) = 0 or A376615(k) >= 4.

Examples

			24 is a term since 24/wt(24) = 12 is an integer, 12/wt(12) = 6 is an integer, and 6/wt(6) = 3 is an integer.
		

Crossrefs

Subsequence of A049445 and A376616.
A000079 is a subsequence.

Programs

  • Mathematica
    q[k_] := Module[{w = DigitCount[k, 2, 1], w2, m, n}, IntegerQ[m = k/w] && Divisible[m, w2 = DigitCount[m, 2, 1]] && Divisible[n = m/w2, DigitCount[n, 2, 1]]]; Select[Range[2000], q]
  • PARI
    s(n) = {my(w = hammingweight(n)); if(w == 1, 0, if(n % w, 1, 1 + s(n/w)));}
    is(k) = {my(sk = s(k)); sk == 0 || sk >= 4;}

A144302 Odd members of A049445.

Original entry on oeis.org

1, 21, 55, 69, 81, 115, 155, 185, 205, 261, 273, 285, 295, 321, 345, 355, 395, 405, 425, 465, 535, 555, 565, 595, 623, 625, 637, 665, 675, 749, 775, 805, 835, 847, 861, 865, 875, 889, 905, 973, 1001, 1029, 1041, 1075, 1089, 1095, 1125, 1165, 1183, 1211, 1225, 1239
Offset: 1

Views

Author

Roger L. Bagula, Dec 07 2008

Keywords

Crossrefs

Intersection of A005408 and A049445.

Programs

  • Mathematica
    Select[Range[1, 1240, 2], Divisible[#, DigitCount[#, 2, 1]] &] (* Amiram Eldar, Aug 16 2020 *)

Extensions

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

A363787 Primitive binary Niven numbers: binary Niven numbers (A049445) that are not twice another binary Niven number.

Original entry on oeis.org

1, 6, 10, 18, 21, 34, 55, 60, 66, 69, 81, 92, 108, 115, 116, 126, 130, 155, 156, 172, 180, 185, 204, 205, 212, 222, 228, 246, 258, 261, 273, 284, 285, 295, 300, 308, 318, 321, 332, 340, 345, 355, 356, 366, 378, 395, 396, 404, 405, 414, 420, 425, 438, 452, 462
Offset: 1

Views

Author

Amiram Eldar, Jun 22 2023

Keywords

Comments

Every binary Niven number is of the form m*2^k, where m is a term of this sequence and k >= 0.
Includes all the odd binary Niven numbers (A144302).
This sequence is infinite. E.g., 16^k + 4^k + 1 is a term for all k >= 1.

Examples

			6 is a term as 6 is a binary Niven number and 6/2 = 3 is not a binary Niven number.
		

Crossrefs

Subsequence of A049445.
Disjoint union of A144302 and A363788.
A363789 is a subsequence.
Cf. A356349 (decimal analog).

Programs

  • Mathematica
    binNivQ[n_] := Divisible[n, DigitCount[n, 2, 1]]; q[n_] := binNivQ[n] && ! (EvenQ[n] && binNivQ[n/2]); Select[Range[500], q]
  • PARI
    isbinniv(n) = !(n % hammingweight(n));
    is(n) = isbinniv(n) && !(!(n%2) && isbinniv(n/2));

A337077 Binary Niven numbers (A049445) with a record gap to the next binary Niven number.

Original entry on oeis.org

1, 2, 12, 24, 96, 690, 1386, 3024, 3738, 3794, 5544, 22834, 57278, 68908, 89060, 196240, 360000, 388421, 524160, 1556360, 1572480, 2359140, 3929940, 8057711, 11484900, 15201585, 16115505, 19910436, 32444160, 7348411575, 16097143458, 33273395232, 51333952011
Offset: 1

Views

Author

Amiram Eldar, Aug 14 2020

Keywords

Comments

The corresponding record gaps are 1, 2, 4, 8, 12, 18, 26, 27, 33, 38, 42, 44, 46, 50, 58, 68, 74, 77, 103, 109, 122, 137, 156, 157, 165, 189, 191, 204, 240, 265, 267, 312, 333, ...
De Koninck, Doyon and Kátai (2003) proved that the asymptotic density of the Niven numbers in any base >= 2 is 0. Therefore, the asymptotic density of the binary Niven numbers is 0 and this sequence is infinite.

Examples

			The first 8 binary Niven numbers are 1, 2, 4, 6, 8, 10, 12 and 16. The differences between them are 1, 2, 2, 2, 2, 2 and 4. The record gaps, 1, 2 and 4, occur at 1, 2 and 12.
		

Crossrefs

Programs

  • Mathematica
    binNivenQ[n_] := Divisible[n, DigitCount[n, 2, 1]]; gapmax = 0; n1 = 1; s = {}; Do[If[binNivenQ[n], gap = n - n1; If[gap > gapmax, gapmax = gap; AppendTo[s, n1]]; n1 = n], {n, 2, 10^6}]; s

A385482 a(n) is the least number k such that k*n is a binary Niven number (A049445).

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 3, 1, 2, 1, 5, 1, 10, 3, 4, 1, 2, 1, 12, 1, 1, 3, 3, 1, 12, 5, 3, 3, 4, 2, 5, 1, 2, 1, 12, 1, 5, 6, 4, 1, 5, 1, 4, 3, 4, 2, 12, 1, 12, 6, 4, 3, 4, 2, 1, 3, 4, 2, 5, 1, 6, 5, 2, 1, 2, 1, 12, 1, 1, 6, 4, 1, 6, 3, 4, 3, 4, 2, 5, 1, 1, 3, 4, 1, 4
Offset: 1

Views

Author

Amiram Eldar, Jun 30 2025

Keywords

Crossrefs

Cf. A049445, A144261 (decimal analog), A363788, A385483 (indices of records), A385484 (record values), A385485.

Programs

  • Mathematica
    a[n_] := Module[{m = n, k = 1}, While[!Divisible[m, DigitSum[m, 2]], m += n; k++]; k]; Array[a, 100]
  • PARI
    a(n) = {my(m = n, k = 1); while(m % hammingweight(m), m += n; k++); k;}
    
  • Python
    from itertools import count
    def a(n): return next(k for k in count(1) if (m:=k*n)%m.bit_count() == 0)
    print([a(n) for n in range(1, 86)]) # Michael S. Branicky, Jun 30 2025

Formula

a(n) = 1 if and only if n is in A049445.
a(n) = 2 if and only if 2*n is in A363788.

A385485 a(n) is the least number k such that k*n is not a binary Niven number (A049445).

Original entry on oeis.org

3, 7, 1, 7, 1, 5, 1, 7, 1, 3, 1, 29, 1, 1, 1, 7, 1, 3, 1, 5, 3, 1, 1, 29, 1, 1, 1, 1, 1, 1, 1, 7, 1, 3, 1, 13, 1, 1, 1, 5, 1, 5, 1, 1, 1, 1, 1, 29, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 17, 1, 1, 1, 7, 1, 3, 1, 7, 3, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 5, 3, 1, 1, 17, 1
Offset: 1

Views

Author

Amiram Eldar, Jun 30 2025

Keywords

Comments

All the terms are odd numbers because if k is even and k*n is not a binary Niven number then so is k*n/2, since A000120(k*n) = A000120(k*n/2).

Crossrefs

Cf. A000120, A049445, A065878, A144262 (decimal analog), A385482, A385486 (indices of records), A385487 (record values).

Programs

  • Mathematica
    a[n_] := Module[{m = n, k = 1}, While[Divisible[m, DigitSum[m, 2]], m += 2*n; k += 2]; k]; Array[a, 100]
  • PARI
    a(n) = {my(m = n, k = 1); while(!(m % hammingweight(m)), m += 2*n; k += 2); k;}
    
  • Python
    from itertools import count
    def a(n): return next(k for k in count(1) if (m:=k*n)%m.bit_count() != 0)
    print([a(n) for n in range(1, 86)]) # Michael S. Branicky, Jun 30 2025

Formula

a(n) = 1 if and only if n is in A065878.
Showing 1-10 of 73 results. Next