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.

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