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 71-73 of 73 results.

A325309 Square array read by downward antidiagonals: A(n, k) is the k-th Niven number (or Harshad number) in base n.

Original entry on oeis.org

1, 2, 1, 4, 2, 1, 6, 3, 2, 1, 8, 4, 3, 2, 1, 10, 6, 4, 3, 2, 1, 12, 8, 6, 4, 3, 2, 1, 16, 9, 8, 5, 4, 3, 2, 1, 18, 10, 9, 6, 5, 4, 3, 2, 1, 20, 12, 12, 8, 6, 5, 4, 3, 2, 1, 21, 15, 16, 10, 10, 6, 5, 4, 3, 2, 1, 24, 16, 18, 12, 12, 7, 6, 5, 4, 3, 2, 1, 32, 18
Offset: 2

Views

Author

Felix Fröhlich, Sep 06 2019

Keywords

Examples

			The array starts as follows:
1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 21, 24, 32, 34, 36, 40, 42, 48, 55, 60
1, 2, 3, 4, 6,  8,  9, 10, 12, 15, 16, 18, 20, 21, 24, 25, 27, 28, 30, 32
1, 2, 3, 4, 6,  8,  9, 12, 16, 18, 20, 21, 24, 28, 30, 32, 33, 35, 36, 40
1, 2, 3, 4, 5,  6,  8, 10, 12, 15, 16, 18, 20, 24, 25, 26, 27, 28, 30, 32
1, 2, 3, 4, 5,  6, 10, 12, 15, 18, 20, 24, 25, 30, 36, 40, 42, 44, 45, 48
1, 2, 3, 4, 5,  6,  7,  8,  9, 12, 14, 15, 16, 18, 21, 24, 27, 28, 30, 32
1, 2, 3, 4, 5,  6,  7,  8, 14, 16, 21, 24, 28, 32, 35, 40, 42, 48, 49, 56
1, 2, 3, 4, 5,  6,  7,  8,  9, 10, 12, 16, 18, 20, 24, 27, 28, 30, 32, 36
1, 2, 3, 4, 5,  6,  7,  8,  9, 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42
1, 2, 3, 4, 5,  6,  7,  8,  9, 10, 11, 12, 15, 20, 22, 24, 25, 30, 33, 35
1, 2, 3, 4, 5,  6,  7,  8,  9, 10, 11, 12, 22, 24, 33, 36, 44, 48, 55, 60
1, 2, 3, 4, 5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 18, 24, 26, 27
1, 2, 3, 4, 5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 26, 28, 39, 42, 52, 56
1, 2, 3, 4, 5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 21, 28, 30, 32
1, 2, 3, 4, 5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 30, 32
1, 2, 3, 4, 5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 24
1, 2, 3, 4, 5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 34, 36
		

Crossrefs

Cf. A049445 (row 2), A064150 (row 3), A064438 (row 4), A064481 (row 5), A245802 (row 8), A005349 (row 10).
Cf. A005349.

Programs

  • PARI
    row(n, terms) = my(i=0); for(x=1, oo, if(i >= terms, break); if(x%sumdigits(x, n)==0, print1(x, ", "); i++))
    array(rows, cols) = for(x=2, rows+1, row(x, cols); print(""))
    array(18, 20) \\ Print initial 18 rows and 20 columns of array

A330812 Least number >= n that is a Niven number in all bases 1 <= b <= n.

Original entry on oeis.org

1, 2, 4, 4, 6, 6, 12, 24, 24, 24, 24, 24, 24, 432, 720, 720, 720, 720, 720, 840, 840, 840, 3360, 13860, 13860, 13860, 13860, 13860, 40320, 100800, 100800, 2106720, 7698600, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800
Offset: 1

Views

Author

Amiram Eldar, Jan 01 2020

Keywords

Examples

			a(4) = 4 since the representations of 4 in bases 1 to 4 are 1111, 100, 11, 10, the corresponding sums of digits are 4, 1, 2, and 1, and all are divisors of 4. Thus 4 is a Niven number in bases 1, 2, 3, and 4, and it is the least number with this property.
		

Crossrefs

Programs

  • Maple
    A[1]:= 1: m:= 1:
    for n from 2 while m < 30 do
       kk:= n;
       for k from 2 to n-1 do
         if n mod convert(convert(n,base,k),`+`) <> 0 then kk:= k-1; break fi;
         od;
       if kk > m then
         for k from m+1 to kk do A[k]:= n od;
         m:= kk;
       fi
    od:
    seq(A[k],k=1..m); # Robert Israel, Jan 01 2020
  • Mathematica
    nivenQ[n_, b_] := Divisible[n, Total @ IntegerDigits[n,b]]; a[n_] := Module[{k = n}, While[!AllTrue[Range[2, n], nivenQ[k, #] &], k++]; k]; Array[a,30]

A337079 The number of twin binary Niven numbers (k, k+1) such that k <= 2^n.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 5, 8, 18, 35, 61, 98, 187, 304, 492, 880, 1583, 2779, 5196, 9407, 17387, 31772, 58450, 106360, 193875, 351836, 642844, 1173333, 2155913, 3993379, 7466547, 14048253, 26680668, 50751057, 97052665, 185557893, 354235368, 674995568, 1284856970
Offset: 1

Views

Author

Amiram Eldar, Aug 14 2020

Keywords

Examples

			a(5) = 2 since there are two binary Niven numbers k below 2^5 = 32 such that k+1 is also a binary Niven number: 1 and 20.
		

Crossrefs

Programs

  • Mathematica
    binNivenQ[n_] := Divisible[n, DigitCount[n, 2, 1]]; s = {}; c = 0; p = 2; q1 = True; Do[q2 = binNivenQ[n]; If[q1 && q2, c++]; If[n - 1 == p, AppendTo[s, c]; p *= 2]; q1 = q2, {n, 2, 2^20}]; s

Formula

a(n) ~ c * 2^n/n^2, where c is a constant (consequence of the theorem of De Koninck et al., 2008). Apparently c ~ 0.28.
Previous Showing 71-73 of 73 results.