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-6 of 6 results.

A065877 Non-Niven (or non-Harshad) numbers: numbers which are not a multiple of the sum of their digits.

Original entry on oeis.org

11, 13, 14, 15, 16, 17, 19, 22, 23, 25, 26, 28, 29, 31, 32, 33, 34, 35, 37, 38, 39, 41, 43, 44, 46, 47, 49, 51, 52, 53, 55, 56, 57, 58, 59, 61, 62, 64, 65, 66, 67, 68, 69, 71, 73, 74, 75, 76, 77, 78, 79, 82, 83, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101
Offset: 1

Views

Author

Henry Bottomley, Nov 26 2001

Keywords

Comments

A188641(a(n)) = 0; A070635(a(n)) > 0. - Reinhard Zumkeller, Apr 07 2011

Examples

			13 is in the list because 13 is not a multiple of 1 + 3 = 4.
		

Crossrefs

Complement of A005349. Cf. A003635, A007953, A065878.
Cf. A188643.

Programs

  • Haskell
    import Data.List (findIndices)
    a065877 n = a065877_list !! (n-1)
    a065877_list = map succ $ findIndices (> 0) $ map a070635 [1..]
    -- Reinhard Zumkeller, Apr 07 2011
  • Mathematica
    Select[Range[101],!IntegerQ[#/Total[IntegerDigits[#]]] &] (* Jayanta Basu, May 05 2013 *)
  • PARI
    isok(k) = {(k % sumdigits(k)) != 0} \\ Harry J. Smith, Nov 03 2009
    

A065880 Largest positive number that is n times the number of 1's in its binary expansion, or 0 if no such number exists.

Original entry on oeis.org

0, 1, 2, 6, 4, 10, 12, 21, 8, 18, 20, 55, 24, 0, 42, 60, 16, 34, 36, 0, 40, 126, 110, 115, 48, 0, 0, 108, 84, 116, 120, 155, 32, 66, 68, 0, 72, 222, 0, 156, 80, 246, 252, 172, 220, 180, 230, 0, 96, 0, 0, 204, 0, 318, 216, 0, 168, 285, 232, 295, 240, 366, 310, 378, 64, 130
Offset: 0

Views

Author

Henry Bottomley, Nov 26 2001

Keywords

Comments

a(n) is bounded above by n*A272756(n), so a program only has to check values up to that point to see if a(n) is zero. - Peter Kagey, May 05 2016

Examples

			a(23)=115 since 115 is written in binary as 1110011 and 115/(1+1+1+0+0+1+1)=23 and there is no higher possibility (if k is more than 127 then k divided by its number of binary 1's is more than 26).
		

Crossrefs

A052489 is the base 10 equivalent.

Programs

  • Mathematica
    Table[SelectFirst[Reverse@ Range@ #, First@ DigitCount[#, 2] == #/n &] &[n SelectFirst[Range[2^12], # > IntegerLength[n #, 2] &]], {n, 80}] /. k_ /; MissingQ@ k -> 0 (* Michael De Vlieger, May 05 2016, Version 10.2 *)

A376615 a(n) is the number of iterations that n requires to reach a noninteger under the map x -> x / wt(x), where wt(k) is the binary weight of k (A000120); a(n) = 0 if n is a power of 2.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 1, 0, 1, 2, 1, 3, 1, 1, 1, 0, 1, 2, 1, 3, 2, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 0, 1, 2, 1, 3, 1, 1, 1, 4, 1, 2, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 0, 1, 2, 1, 3, 2, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 5, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Amiram Eldar, Sep 30 2024

Keywords

Comments

The powers of 2 are fixed points of the map, since wt(2^k) = 1 for all k >= 0. Therefore they are arbitrarily assigned the value a(2^k) = 0.
Each number n starts a chain of a(n) integers: n, n/wt(n), (n/wt(n))/wt(n/wt(n)), ..., of them the first a(n)-1 integers are binary Niven numbers (A049445).

Examples

			a(6) = 2 since 6/wt(6) = 3 and 3/wt(3) = 3/2 is a noninteger that is reached after 2 iterations.
a(20) = 3 since 20/wt(20) = 10, 10/wt(10) = 5 and 5/wt(5) = 5/2 is a noninteger that is reached after 3 iterations.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = Module[{bw = DigitCount[n, 2, 1]}, If[bw == 1, 0, If[!Divisible[n, bw], 1, 1 + a[n/bw]]]]; Array[a, 100]
  • PARI
    a(n) = {my(w = hammingweight(n)); if(w == 1, 0, if(n % w, 1, 1 + a(n/w)));}

Formula

a(n) = 0 if and only if n is in A000079 (by definition).
a(n) = 1 if and only if n is in A065878.
a(n) >= 2 if and only if n is in A049445 \ A000079 (i.e., n is a binary Niven number that is not a power of 2).
a(n) >= 3 if and only if n is in A376616 \ A000079.
a(n) >= 4 if and only if n is in A376617 \ A000079.
a(2*n) >= a(n).
a(3*2^n) = n+1 for n >= 0.
a(n) < A000005(n).

A065879 a(n) is the smallest positive number that is n times the number of 1's in its binary expansion, or 0 if no such number exists.

Original entry on oeis.org

1, 2, 6, 4, 10, 12, 21, 8, 18, 20, 55, 24, 0, 42, 60, 16, 34, 36, 0, 40, 126, 110, 69, 48, 0, 0, 81, 84, 116, 120, 155, 32, 66, 68, 0, 72, 185, 0, 156, 80, 205, 252, 172, 220, 180, 138, 0, 96, 0, 0, 204, 0, 212, 162, 0, 168, 228, 232, 295, 240, 366, 310, 378, 64, 130
Offset: 1

Views

Author

Henry Bottomley, Nov 26 2001

Keywords

Comments

a(n) is bounded above by n*A272756(n), so a program only has to check values up to that point to see if a(n) is zero. - Peter Kagey, May 05 2016

Examples

			a(23) is 69 since 69 is written in binary as 1000101, 69/(1+0+0+0+1+0+1)=23 and there is no smaller possibility (neither 23 nor 46 are divisible by their number of binary 1's).
		

Crossrefs

A003634 is the base-10 equivalent.

Programs

  • Mathematica
    Table[SelectFirst[Range[2^12], # == n First@ DigitCount[#, 2] &] /. k_ /; MissingQ@ k -> 0, {n, 80}] (* Michael De Vlieger, May 05 2016, Version 10.2 *)

A235602 a(n) = n/wt(n) if wt(n) divides n, otherwise a(n) = n, where wt(n) is the binary weight of n (A000120).

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 6, 13, 14, 15, 16, 17, 9, 19, 10, 7, 22, 23, 12, 25, 26, 27, 28, 29, 30, 31, 32, 33, 17, 35, 18, 37, 38, 39, 20, 41, 14, 43, 44, 45, 46, 47, 24, 49, 50, 51, 52, 53, 54, 11, 56, 57, 58, 59, 15, 61, 62, 63, 64, 65, 33, 67, 34, 23, 70, 71, 36, 73, 74, 75, 76, 77, 78, 79, 40, 27, 82
Offset: 1

Views

Author

N. J. A. Sloane, Jan 18 2014

Keywords

Crossrefs

Programs

  • Mathematica
    bw[n_]:=Module[{w=DigitCount[n,2,1]},If[Divisible[n,w],n/w,n]]; Array[ bw,90] (* Harvey P. Dale, Nov 06 2016 *)
  • PARI
    a(n) = my(s=hammingweight(n)); if (n % s, n, n/s); \\ Michel Marcus, Jul 15 2021

Formula

From Amiram Eldar, Aug 04 2025: (Start)
a(n) = n if and only if n is in A065878 or A000079.
a(n) < n if and only if n is in A049445 but not in A000079. (End)

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-6 of 6 results.