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

A004152 Sum of digits of n!.

Original entry on oeis.org

1, 1, 2, 6, 6, 3, 9, 9, 9, 27, 27, 36, 27, 27, 45, 45, 63, 63, 54, 45, 54, 63, 72, 99, 81, 72, 81, 108, 90, 126, 117, 135, 108, 144, 144, 144, 171, 153, 108, 189, 189, 144, 189, 180, 216, 207, 216, 225, 234, 225, 216, 198, 279, 279, 261, 279, 333, 270, 288
Offset: 0

Views

Author

Keywords

Comments

If n > 5, then 9 divides a(n). - Enrique Pérez Herrero, Mar 01 2009

Examples

			a(5) = 3 because 5! = 120 and 1 + 2 + 0 = 3.
a(6) = 9 because 6! = 720 and 7 + 2 + 0 = 9.
		

Crossrefs

Cf. A000142 (factorial), A007953 (sum of digits), A079584 (same in base 2), A086358 (digital root of n!).
Cf. A066419 (k such that a(k) does not divide k!).

Programs

Formula

Luca shows that a(n) >> log n. In particular, a(n) > log_10 n - log_10 log_10 n. - Charles R Greathouse IV, Dec 27 2011
a(n) < floor(log_10(n)*9/2). - Carmine Suriano, Feb 20 2013
a(n) = A007953(A000142(n)). - Michel Marcus, Sep 18 2014
a(n) < 9*(A034886(n) - A027868(n)). - Enrique Pérez Herrero, Nov 16 2014
Sanna improved Luca's result to a(n) >> log n log log log n. - Charles R Greathouse IV, Jan 30 2015
a(n) = 9*A202708(n), n>=6. - R. J. Mathar, Jul 30 2021

A245663 The first number k such that the sum of the base n digits of k! does not divide k!.

Original entry on oeis.org

10, 43, 86, 87, 188, 156, 291, 364, 432, 410, 7, 510, 4, 4, 4, 813, 4, 1079, 4, 1900, 6, 10, 6, 2330, 2147, 5, 3463, 2401, 7, 2522, 5, 3884, 5, 5, 8316, 3621, 5, 8, 8, 4866, 5, 5, 5, 5, 6302, 5, 5, 8616, 5
Offset: 2

Views

Author

G. H. Faust, Jul 28 2014

Keywords

Comments

a(n)! > n. - Robert Israel, Aug 17 2014

Examples

			The sum of the base-2 digits of 10! is 1+1+0+1+1+1+0+1+0+1+1+1+1+1+0+0+0+0+0+0+0+0=11, which does not divide 10!.  Since the sum of the base-2 digits of k! divides k! for 0 <= k <= 9, a(2) = 10.
The sum of the base-3 digits of 43! is 106, which does not divide 43!.  Since the sum of the base-3 digits of k! divides k! for 0 <= k <= 42, a(3) = 43.
		

Crossrefs

Sum of the base n digits of k for n = 2, 3 and 10 respectively: A000120, A053735, A007953.
Cf. A066419.

Programs

  • Haskell
    fac :: Integer -> Integer
    fac 0 = 1
    fac n = foldl (*) 1 [2..n]
    base 0 b = []
    base a b = (a `mod` b) : base ((a-(a `mod` b)) `div` b) b
    bAse a b = reverse (base a b)
    sigbAse a b = foldl (+) 0 (bAse a b)
    f n = [k | k <- [1..], not ((fac k) `mod` (sigbAse (fac k) n) == 0)] !! 0
    main = print (map f [2..20]) -- generates values for n = 2 through 20. May be slow for values over 30.
    
  • Maple
    f:= proc(n)
      local f,k;
      for k from 1 do
        f:= k!;
        if f mod convert(convert(f,base,n),`+`) <> 0 then return k fi;
      od
    end proc:
    seq(f(n),n=2..30); # Robert Israel, Aug 10 2014
  • Mathematica
    a245663[n_Integer] := Module[{f = 2, k = 2}, While[Divisible[f, Total[IntegerDigits[f, n]]] == True, k++; f = k!]; k]; a245663 /@ Range[2, 50] (* Michael De Vlieger, Aug 15 2014 *)
  • PARI
    sumd(k, n) = my(d = digits(k, n)); sum(j=1, #d, d[j]);
    a(n) = {k = 2; fk = k!; while (fk % sumd(fk, n) == 0, k++; fk = k!); k;} \\ Michel Marcus, Aug 10 2014
Showing 1-2 of 2 results.