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-10 of 23 results. Next

A079584 Number of ones in the binary expansion of n!.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 4, 6, 6, 6, 11, 7, 12, 12, 12, 18, 18, 22, 23, 17, 22, 25, 28, 31, 29, 30, 35, 38, 42, 40, 48, 42, 42, 46, 51, 56, 51, 58, 59, 64, 63, 66, 64, 71, 74, 70, 77, 81, 89, 87, 89, 90, 88, 94, 87, 99, 103, 98, 101, 109, 113, 103, 113, 120, 120, 109, 123, 121, 130, 121
Offset: 0

Views

Author

Jose R. Brox (tautocrona(AT)terra.es), Jan 26 2003

Keywords

Examples

			a(5) = 4 because 5! = 120 and 120_10 = 1111000_2, with 4 ones.
		

Crossrefs

Cf. A000120 (binary weight), A000142 (factorial), A004152 (sum of decimal digits).

Programs

  • Maple
    seq(convert(convert(n!,base,2),`+`), n=0..1000); # Robert Israel, Sep 18 2014
  • Mathematica
    Table[DigitCount[n!,2,1],{n,70}] (* Harvey P. Dale, Jul 10 2012 *)
  • PARI
    for(n=1,300,b=binary(n!); print1(sum(k=1,length(b),b[k])","))
    
  • PARI
    a(n)=hammingweight(n!) \\ Charles R Greathouse IV, Mar 27 2013
    
  • Python
    import math
    def a(n):
        return bin(math.factorial(n))[2:].count("1") # Indranil Ghosh, Dec 23 2016

Formula

a(n) << n log n. - Charles R Greathouse IV, Mar 27 2013
a(n) = A000120(A000142(n)). - Michel Marcus, Sep 18 2014

Extensions

a(0)=1 prepended by Alois P. Heinz, Mar 07 2023

A066588 a(n) = sum of the digits of n^n.

Original entry on oeis.org

1, 1, 4, 9, 13, 11, 27, 25, 37, 45, 1, 41, 54, 58, 52, 99, 88, 98, 108, 127, 31, 117, 148, 146, 153, 151, 154, 189, 163, 167, 63, 184, 205, 207, 214, 260, 270, 271, 265, 306, 112, 308, 315, 313, 325, 306, 352, 374, 333, 355, 151, 414, 412, 350, 378, 442, 391, 450
Offset: 0

Views

Author

Robert A. Stump (bee_ess107(AT)yahoo.com), Jan 07 2002

Keywords

Examples

			a(7) = 25 because 7^7 = 823543 and 8 + 2 + 3 + 5 + 4 + 3 = 25.
		

Crossrefs

Programs

  • Magma
    [&+Intseq((n^n)): n in [0..80] ]; // Vincenzo Librandi, Jun 18 2015
  • Maple
    a:= n-> add(i, i=convert(n^n, base, 10)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Oct 06 2023
  • Mathematica
    Table[Plus@@IntegerDigits@(n^n), {n, 80}] (* Vincenzo Librandi, Jun 18 2015 *)
  • PARI
    a(n) = sumdigits(n^n) \\ Michel Marcus, Jun 18 2015
    

Extensions

More terms from Paolo P. Lava, May 15 2007
a(0)=1 inserted by Sean A. Irvine, Oct 06 2023

A120390 Sum of digits of double factorial numbers.

Original entry on oeis.org

1, 2, 3, 8, 6, 12, 6, 15, 18, 15, 18, 18, 18, 18, 18, 18, 36, 45, 45, 36, 45, 45, 36, 54, 63, 45, 72, 45, 72, 72, 90, 90, 90, 81, 108, 81, 108, 81, 126, 90, 108, 108, 144, 81, 144, 90, 135, 117, 144, 126, 153, 108, 180, 135, 180, 135, 171, 180, 180, 171, 198, 180, 198
Offset: 1

Views

Author

Keywords

Comments

If n > 10, then 9 divides a(n). - Michel Lagneau, Dec 22 2011

Examples

			5!! = 5*3*1 = 15 --> 1+5 = 6
		

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,j,k,t1,t2; for i from 1 by 1 to n do j:=i; k:=i-2; while k>0 do j:=j*k; k:=k-2; od; t1:=j; t2:=0; while t1 <> 0 do t2:= t2+(t1 mod 10); t1 := floor(t1/10); od; print(t2); od; end: P(100);
  • Mathematica
    Table[Total[IntegerDigits[n!!]],{n,70}] (* Harvey P. Dale, May 19 2021 *)

Formula

a(n) = A007953(A006882(n)) - Eric Chen, Jun 13 2018

A131954 a(n) = sum of digits of (n! + a(n-1)), with a(1)=1.

Original entry on oeis.org

1, 3, 9, 6, 9, 18, 18, 18, 36, 36, 45, 36, 36, 54, 54, 72, 72, 63, 54, 63, 72, 81, 108, 90, 81, 90, 117, 99, 144, 126, 144, 117, 153, 153, 153, 180, 162, 117, 198, 207, 153, 198, 198, 234, 216, 225, 234, 243, 234, 225, 207, 288, 297, 279, 297, 351, 279, 306, 333, 297
Offset: 1

Views

Author

Keywords

Comments

If n >= 5, then 9 divides a(n); see comment in A004152. - Bernard Schott, Jun 27 2019

Examples

			a(4) = Sum_digits(4!+9) = 6.
		

Crossrefs

Programs

  • Maple
    P:=proc(n) local a,i,k,w; a:=0; for i from 1 by 1 to n do w:=0; k:=a+i!; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; a:=w; print(a); od; end: P(100);
    # alternative:
    sd:= n-> convert(convert(n,base,10),`+`):
    A[1]:= 1:
    for n from 2 to 100 do A[n]:= sd(n!+A[n-1]) od:
    seq(A[i],i=1..100); # Robert Israel, Jun 26 2019
  • Mathematica
    s={1};Do[AppendTo[s,DigitSum[n!+s[[-1]]]],{n,2,60}];s (* James C. McMahon, Mar 03 2025 *)

Formula

a(n) = Sum_digits(n!+a(n-1)).

Extensions

Offset corrected by Robert Israel, Jun 26 2019

A066419 Numbers k such that k! is not divisible by the sum of the decimal digits of k!.

Original entry on oeis.org

432, 444, 453, 458, 474, 476, 485, 489, 498, 507, 509, 532, 539, 541, 548, 550, 552, 554, 555, 556, 560, 565, 567, 576, 593, 597, 603, 608, 609, 610, 611, 612, 613, 624, 630, 632, 634, 640, 645, 657, 663, 665, 683, 685, 686, 692, 698, 703, 706, 708, 714
Offset: 1

Views

Author

Matthew Conroy, Dec 25 2001

Keywords

Examples

			The sum of the decimal digits of 5! is 1+2+0=3 and 3 divides 120, so 5 is not in the sequence.
The sum of the decimal digits of 432! is 3897 = (9)(433) and 3897 does not divide 432!, so 432 is in the sequence.
		

Crossrefs

Cf. A004152 (sum of digits of n!).

Programs

  • Mathematica
    Select[Range[1000], !Divisible[Factorial[#],Total[IntegerDigits[Factorial[#]]]] &], (* Tanya Khovanova, Jun 13 2021 *)
  • PARI
    isA066419(n) = (Mod(n!, sumdigits(n!)) != 0) \\ Jianing Song, Aug 26 2024
  • Python
    from math import factorial
    def sd(n): return sum(map(int, str(n)))
    def ok(f): return f%sd(f) != 0
    print([n for n in range(1, 715) if ok(factorial(n))]) # Michael S. Branicky, Jun 13 2021
    

A086358 Digital root of n!.

Original entry on oeis.org

1, 1, 2, 6, 6, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9
Offset: 0

Views

Author

Labos Elemer, Jul 21 2003

Keywords

Comments

a(n) = 9 for n >= 6.

Examples

			n = 5, 5 != 120, iteration list = {120,3}, a(5) = 3.
		

Crossrefs

Programs

  • Mathematica
    sud[x_] := Apply[Plus, DeleteCases[IntegerDigits[x], 0]]; Table[FixedPoint[sud, w!], {w, 1, 87}]

Formula

a(n) = A010888(n!) = fixed-point of A007953(n!). It equals n! modulo(9); at r = 0 use 9.
G.f.: (1 + x^2 + 4*x^3 - 3*x^5 + 6*x^6)/(1 - x). - Stefano Spezia, Jan 26 2023

Extensions

a(0) = 1 prepended by Alois P. Heinz, Dec 05 2018

A135204 Numbers n for which Sum_digits(n!) is a multiple of Sum_digits(n).

Original entry on oeis.org

1, 2, 3, 9, 10, 11, 12, 14, 16, 18, 20, 21, 22, 27, 28, 30, 33, 35, 36, 44, 45, 51, 54, 60, 61, 63, 72, 75, 81, 87, 90, 99, 100, 102, 105, 108, 111, 114, 117, 120, 126, 130, 135, 143, 144, 153, 158, 162, 165, 171, 180, 182, 185, 189, 190, 192, 200, 201, 202, 204, 206
Offset: 1

Views

Author

Keywords

Comments

I expect a(n) to be around kn log n for some constant k. - Charles R Greathouse IV, Apr 24 2013

Examples

			11 -> 11*10*9*8*7*6*5*4*3*2*1=39916800 -> (3+9+9+1+6+8+0+0)/(1+1)=18.
		

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,k,w,x; for i from 1 by 1 to n do w:=0; k:=i; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; x:=0; k:=i!; while k>0 do x:=x+k-(trunc(k/10)*10); k:=trunc(k/10); od; if trunc(x/w)=x/w then print(i); fi; od; end: P(1000);
  • Mathematica
    Select[Range[100], Divisible[Total[IntegerDigits[#!, 10]], Total[IntegerDigits[#, 10]]] &] (* G. C. Greubel, Sep 30 2016 *)
  • PARI
    is(n)=sumdigits(n!)%sumdigits(n)==0 \\ Charles R Greathouse IV, Apr 24 2013

A135205 Numbers m for which Sum_digits(m!!) is a multiple of Sum_digits(m).

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 10, 11, 12, 15, 18, 20, 21, 24, 25, 27, 30, 32, 33, 36, 42, 45, 46, 54, 55, 63, 72, 75, 81, 88, 90, 91, 93, 100, 101, 102, 105, 108, 111, 112, 117, 120, 121, 122, 123, 124, 126, 127, 135, 141, 144, 153, 154, 156, 162, 171, 176, 180, 182, 189, 198
Offset: 1

Views

Author

Paolo P. Lava, Nov 30 2007

Keywords

Examples

			11 -> 11*9*7*5*3*1=10395 -> (1+0+3+9+5)/(1+1) = 9.
		

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,j,k,w,x; for i from 1 by 1 to n do w:=0; k:=i; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; x:=i; j:=i-2; while j >0 do x:=x*j; j:=j-2; od: k:=x; x:=0; while k>0 do x:=x+k-(trunc(k/10)*10); k:=trunc(k/10); od; if trunc(x/w)=x/w then print(i); fi; od; end: P(1000);
  • Mathematica
    Select[Range[100], Divisible[Total[IntegerDigits[#!!, 10]], Total[IntegerDigits[#, 10]]] &] (* G. C. Greubel, Sep 30 2016 *)

Extensions

Offset 1 and b-file adapted by Paolo P. Lava, Jun 17 2024

A135206 Numbers m for which Sum_digits(m!) is a multiple of Sum_digits(m!!).

Original entry on oeis.org

1, 2, 3, 11, 19, 28, 48, 64, 158, 164, 190, 308, 324, 602, 782, 926, 1202, 1540, 1568, 1614, 2076, 2122, 2340, 2546, 2818, 2858, 2866, 3334, 3582, 3714, 4120, 4266, 4794, 5084, 5432, 5454, 5696, 6112, 6250, 6276, 6358, 6760, 7368, 8218, 8970, 9004, 9088
Offset: 1

Views

Author

Paolo P. Lava, Nov 30 2007

Keywords

Examples

			11!=11*10*9*8*7*6*5*4*3*2*1=39916800 -> (3+9+9+1+6+8+0+0)=36,
11!!=11*9*7*5*3*1=10395 -> (1+0+3+9+5)=18,
36/18=2.
		

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,j,k,w,x; for i from 1 by 1 to n do w:=0; k:=i!; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; x:=i; j:=i-2; while j >0 do x:=x*j; j:=j-2; od: k:=x; x:=0; while k>0 do x:=x+k-(trunc(k/10)*10); k:=trunc(k/10); od; if trunc(w/x)=w/x then print(i); fi; od; end: P(1000);
  • Mathematica
    Select[Range[1000], Divisible[Total[IntegerDigits[#!, 10]], Total[IntegerDigits[#!!, 10]]] &] (* G. C. Greubel, Sep 30 2016 *)
  • PARI
    df(n) = prod(i=0, (n-1)\2, n - 2*i ); \\ A006882
    isok(m) = !(sumdigits(m!) % sumdigits(df(m))); \\ Michel Marcus, Jun 18 2024

Extensions

Changed offset to 1 by Paolo P. Lava, Jun 17 2024

A066235 Numbers k such that the sum of digits of k! is a square.

Original entry on oeis.org

0, 1, 6, 7, 8, 11, 24, 26, 33, 34, 35, 41, 47, 49, 59, 64, 76, 79, 116, 159, 167, 186, 253, 285, 314, 345, 376, 405, 413, 445, 459, 478, 480, 513, 520, 526, 676, 710, 769, 797, 833, 843, 852, 898, 937, 1004, 1032, 1043, 1098, 1192, 1291, 1365, 1478, 1491, 1496
Offset: 1

Views

Author

Jason Earls, Dec 19 2001

Keywords

Crossrefs

Cf. A004152.

Programs

  • Mathematica
    Select[Range[0,1500],IntegerQ[Sqrt[Total[IntegerDigits[#!]]]]&] (* Harvey P. Dale, May 26 2020 *)
  • PARI
    isok(m) = issquare(sumdigits(m!)) \\ Harry J. Smith, Feb 07 2010
Showing 1-10 of 23 results. Next