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

A118363 Factorial base Niven (or Harshad) numbers: numbers that are divisible by the sum of their factorial base digits.

Original entry on oeis.org

1, 2, 4, 6, 8, 9, 12, 16, 18, 20, 24, 26, 27, 30, 35, 36, 40, 48, 52, 54, 56, 60, 70, 72, 75, 80, 90, 91, 96, 105, 108, 112, 117, 120, 122, 123, 126, 132, 135, 140, 144, 148, 150, 152, 156, 161, 168, 175, 180, 186, 192, 204, 208, 210, 222, 224, 240, 244, 245, 246
Offset: 1

Views

Author

Alonso del Arte, May 15 2006

Keywords

Comments

Also called "Fiven" numbers [Dahlenberg and Edgar]. - N. J. A. Sloane, Jun 25 2018

Examples

			a(8) = 16 because it is written 220 in factorial base and 2 + 2 + 0 = 4, which is a divisor of 16.
17 is not on the list because it is written 221 in factorial base and 2 + 2 + 1 = 5, which is not a divisor of 17.
		

Crossrefs

Cf. A007623 (integers written in factorial base), A005349 (base 10 Harshad numbers).
Cf. A286607 (complement), A034968, A286590.
Positions of zeros in A286604.

Programs

  • Mathematica
    (*For the definition of the factorial base version of IntegerDigits, see A007623*) Select[Range[250],IntegerQ[ #/(Plus@@factBaseIntDs[ # ])]&]
  • PARI
    is(n) = {my(k = n, m = 2, r, s = 0); while([k, r] = divrem(k, m); k != 0 || r != 0, s += r; m++); !(n % s);} \\ Amiram Eldar, Oct 08 2024
  • Python
    def a007623(n, p=2): return n if n

A286604 a(n) = n mod sum of digits of n in factorial base.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 18 2017

Keywords

Crossrefs

Cf. A118363 (positions of zeros), A286607 (of nonzeros).

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, r, s = 0}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, s += r; m++]; Mod[n, s]]; Array[a, 100] (* Amiram Eldar, Feb 21 2024 *)
  • Python
    def a007623(n, p=2): return n if n
  • Scheme
    (define (A286604 n) (modulo n (A034968 n)))
    

Formula

a(n) = n mod A034968(n).

A377384 a(n) is the number of iterations that n requires to reach a noninteger or a factorial number under the map x -> x / f(x), where f(k) = A034968(k) is the sum of digits in the factorial-base representation of k; a(n) = 0 if n is a factorial number.

Original entry on oeis.org

0, 0, 1, 1, 1, 0, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 0, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Amiram Eldar, Oct 27 2024

Keywords

Comments

The factorial numbers are fixed points of the map, since f(k!) = 1 for all k >= 0. Therefore they are arbitrarily assigned the value a(k!) = 0.
Each number n starts a chain of a(n) integers: n, n/f(n), (n/f(n))/f(n/f(n)), ..., of them the first a(n)-1 integers are factorial-base Niven numbers (A118363).

Examples

			a(8) = 2 since 8/f(8) = 4 and 4/f(4) = 2 is a factorial number that is reached after 2 iterations.
a(27) = 3 since 27/f(27) = 9, 9/f(9) = 3 and 3/f(3) = 3/2 is a noninteger that is reached after 3 iterations.
		

Crossrefs

Analogous sequences: A376615 (binary), A377208 (Zeckendorf).

Programs

  • Mathematica
    fdigsum[n_] := Module[{k = n, m = 2, r, s = 0}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, s += r; m++]; s]; a[n_] := a[n] = Module[{s = fdigsum[n]}, If[s == 1, 0, If[!Divisible[n, s], 1, 1 + a[n/s]]]]; Array[a, 100]
  • PARI
    fdigsum(n) = {my(k = n, m = 2, r, s = 0); while([k, r] = divrem(k, m); k != 0 || r != 0, s += r; m++); s;}
    a(n) = {my(f = fdigsum(n)); if(f == 1, 0, if(n % f, 1, 1 + a(n/f)));}
    
  • Python
    def f(n, p=2): return n if n

Formula

a(n) = 0 if and only if n is in A000142 (by definition).
a(n) = 1 if and only if n is in A286607.
a(n) >= 2 if and only if n is in A118363 \ A000142 (i.e., n is a factorial-base Niven number that is not a factorial number).
a(n) >= 3 if and only if n is in A377385 \ A000142.
a(n) >= 4 if and only if n is in A377386 \ A000142.
a(n) < A000005(n).
Showing 1-3 of 3 results.