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 10 results.

A047726 Number of different numbers that are formed by permuting digits of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 3, 6
Offset: 1

Views

Author

Keywords

Comments

The minimum value of a(A171102(n)) is 10*9!. - Altug Alkan, Jul 08 2016

Examples

			From 102 we get 102, 120, 210, 201, 12 and 21, so a(102)=6.
From 33950 with 5 digits, one '0', two '3', one '5' and one '9', we get 5! / (1! * 2! * 1! * 1!) = 60 different numbers and a(33950) = 60.  - _Bernard Schott_, Oct 20 2019
		

Crossrefs

Cf. A055098. Identical to A043537 and A043562 for n<100.
Cf. A179239. - Aaron Dunigan AtLee, Jul 14 2010

Programs

  • Haskell
    import Data.List (permutations, nub)
    a047726 n = length $ nub $ permutations $ show n
    -- Reinhard Zumkeller, Jul 26 2011
    
  • Maple
    f:= proc(n) local L;
      L:= convert(n,base,10);
      nops(L)!/mul(numboccur(i,L)!,i=0..9);
    end proc:
    map(f, [$1..1000]); # Robert Israel, Jul 08 2016
  • Mathematica
    pd[n_]:=Module[{p=Permutations[IntegerDigits[n]]},Length[Union [FromDigits/@p]]]; pd/@Range[120]  (* Harvey P. Dale, Mar 22 2011 *)
  • PARI
    a(n)=n=eval(Vec(Str(n)));(#n)!/prod(i=0,9,sum(j=1,#n,n[j]==i)!) \\ Charles R Greathouse IV, Sep 29 2011
    
  • PARI
    A047726(n)={local(c=Vec(0,10)); apply(d->c[d+1]++, digits(n)); logint(n*10,10)!/prod(i=1,10,c[i]!)} \\ M. F. Hasler, Oct 18 2019

Formula

a(n) << n / (log_10 n)^4.5 by Stirling's approximation. - Charles R Greathouse IV, Sep 29 2011
a(n) = A000142(A055642(n))/Product_{k=0..9} A000142(A100910(n,k)). - Robert Israel, Jul 08 2016

Extensions

Corrected by Henry Bottomley, Apr 19 2000

A268643 Number of 1's in decimal representation of n.

Original entry on oeis.org

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

Views

Author

Robert Israel, Feb 09 2016

Keywords

Crossrefs

Second column of A100910.

Programs

  • Maple
    f:= n -> numboccur(1,convert(n,base,10)):
    map(f, [$0..100]);
  • Mathematica
    DigitCount[Range[0,120],10,1] (* Harvey P. Dale, Apr 08 2018 *)
  • Python
    def A268643(n): return str(n).count('1') # Chai Wah Wu, Dec 23 2022

Formula

a(n) = a(floor(n/10)) + 1 if n == 1 (mod 10), otherwise a(n) = a(floor(n/10)).
G.f. g(x) satisfies g(x) = x/(1-x^10) + (1-x^10)*g(x^10)/(1-x).

A027387 Write digits for n, count endpoints (version 2).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of endpoints: 0,8 - zero, 6,9 - one, 1,2,3,5,7 - two, 4 - four. - Michael B. Porter, Oct 28 2017

Examples

			The digit 1 has two endpoints, and the digit 8 has no endpoints, so a(18) = 2. - _Michael B. Porter_, Oct 28 2017
		

Crossrefs

Programs

Formula

a(10*n + d) = a(n) + e where e is the number of endpoints of single digit d. - David A. Corneth, Oct 28 2017

Extensions

a(6) corrected by Michael B. Porter, Oct 28 2017 (per Andrew Howroyd)
a(27) to a(80) by Michael B. Porter, Oct 28 2017

A027388 Write digits for n, count endpoints (version 3).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of endpoints: 0,8 - zero, 6,9 - one, 1,2,3,4,5 - two, 7 - four. - Michael B. Porter, Oct 28 2017

Examples

			The digit 1 has two endpoints, and the digit 8 has no endpoints, so a(18) = 2. - _Michael B. Porter_, Oct 28 2017
		

Crossrefs

Programs

Formula

a(10*n + d) = a(n) + e where e is the number of endpoints of single digit d. - David A. Corneth, Oct 28 2017

Extensions

a(6) corrected by Michael B. Porter, Oct 28 2017 (per Andrew Howroyd)
a(27) to a(80) by Michael B. Porter, Oct 28 2017

A027389 Write decimal digits for n, count endpoints (version 4).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of endpoints: 0,8 - zero, 6,9 - one, 1,2,3,5 - two, 4,7 - four. - Michael B. Porter, Oct 28 2017

Examples

			The digit 1 has two endpoints, and the digit 8 has no endpoints, so a(18) = 2. - _Michael B. Porter_, Oct 28 2017
		

Crossrefs

Programs

  • Mathematica
    Table[Total[IntegerDigits[n]/.{1->2,3->2,5->2,6->1,7->4,8->0,9->1}],{n,0,100}] (* Harvey P. Dale, May 08 2022 *)
  • PARI
    a(n)=vecsum(apply(d->[0, 2, 2, 2, 4, 2, 1, 4, 0, 1][d+1], digits(n))); \\ based on program for A027386 by Andrew Howroyd, Michael B. Porter, Oct 28 2017

Formula

a(10*n + d) = a(n) + e where e is the number of endpoints of single digit d. - David A. Corneth, Oct 28 2017

Extensions

a(6) corrected by Michael B. Porter, Oct 28 2017 (per Andrew Howroyd)
a(27) to a(80) by Michael B. Porter, Oct 28 2017

A348783 Let c(i) be the number of times the digit i appears in n, for 0 <= i <= 9; then a(n) is the concatenation of c(9) c(8) ... c(1) c(0), with leading 0's omitted.

Original entry on oeis.org

1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 11, 20, 110, 1010, 10010, 100010, 1000010, 10000010, 100000010, 1000000010, 101, 110, 200, 1100, 10100, 100100, 1000100, 10000100, 100000100, 1000000100, 1001, 1010, 1100, 2000, 11000
Offset: 0

Views

Author

N. J. A. Sloane, Nov 14 2021

Keywords

Comments

"Leading zeros" means "zeros on the left".
21 -> 110 -> 21 is the first loop, when this operation is iterated. Another is 22 -> 200 -> 102 -> 111 -> 30 -> 1001 -> 22.
Suggested by an email from Allan C. Wechsler.
The numbers 2, 3, ..., 9 cannot appear, but 1 and all k >= 10 are terms. Specifically, if the decimal digits of k > 0 are d0^c, where d is a single nonzero digit and 0^c is a string of c > 0 concatenated 0's, then k appears as a(1^(d*10**(c-1))); otherwise, if the decimal digits of k are d0^cb where d and c are as before but c >= 0 and b is a string of digits not starting with 0, then k appears as a(1^(d*10^c) 0^b). - Michael S. Branicky, Nov 14 2021

Examples

			0 -> 1
1 -> 10
2 -> 100
3 -> 1000 (one 3, zero copies of 2, 1, 0, so 1 0 0 0)
4 -> 10000
5 -> 100000
6 -> 1000000
7 -> 10000000
8 -> 100000000
9 -> 1000000000
10 -> 11
11 -> 20
12 -> 110
...
2222222222 -> 1000 (ten 2's, zero 1's, zero 0's, so 10 0 0)
...
		

Crossrefs

Programs

  • Mathematica
    Array[FromDigits@*RotateLeft@*Reverse@*DigitCount,35,0] (* Giorgos Kalogeropoulos, Nov 15 2021 *)
  • PARI
    apply( {A348783(n)=if(n,eval(concat([Str(#[0|d<-n,d==i])|i<-+-[-vecmax(n=digits(n))..0]])),1)}, [0..66]) \\ M. F. Hasler, Nov 15 2021
  • Python
    def a(n):
        s = str(n)
        return int("".join(str(s.count(d)) for d in "9876543210").lstrip("0"))
    print([a(n) for n in range(35)]) # Michael S. Branicky, Nov 14 2021
    

Extensions

More terms from Michael S. Branicky, Nov 14 2021

A027386 Write digits for n, count endpoints (version 1).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of endpoints: 0,8 - zero, 6,9 - one, 1,2,3,4,5,7 - two. - Michael B. Porter, Oct 28 2017

Examples

			The digit 1 has two endpoints, and the digit 8 has no endpoints, so a(18) = 2. - _Michael B. Porter_, Oct 28 2017
		

Crossrefs

Programs

  • Mathematica
    Table[Total[IntegerDigits[n]/.{0->0,1->2,2->2,3->2,4->2,5->2,6->1,7->2,8->0,9->1}],{n,0,80}] (* Harvey P. Dale, Apr 28 2018 *)
  • PARI
    a(n)=vecsum(apply(d->[0, 2, 2, 2, 2, 2, 1, 2, 0, 1][d+1], digits(n))); \\ Andrew Howroyd, Oct 26 2017

Formula

a(10*n + d) = a(n) + e where e is the number of endpoints of single digit d. - David A. Corneth, Oct 28 2017

Extensions

a(6) corrected and a(27)-a(80) from Andrew Howroyd, Oct 26 2017

A100909 Concatenate number of occurrences in n of each decimal digit from 0 to 9 and drop leading zeros.

Original entry on oeis.org

1000000000, 100000000, 10000000, 1000000, 100000, 10000, 1000, 100, 10, 1, 1100000000, 200000000, 110000000, 101000000, 100100000, 100010000, 100001000, 100000100, 100000010, 100000001, 1010000000, 110000000, 20000000, 11000000, 10100000, 10010000, 10001000
Offset: 0

Views

Author

Rick L. Shepherd, Nov 21 2004

Keywords

Comments

n = 0 is normally represented as the single digit 0, so a(0) = 1000000000. This representation system is inherently ambiguous by disregarding the order of n's digits but without modification will correctly identify those digits for all numbers up to 999999999 decimal; i.e., a(999999999) = 9; and for many beyond (e.g., a(121212121212121212) = a(111222111222222111) = ... = 990000000). However, for any n in which more than 9 of any single digit occur, additional ambiguity is introduced unless some type of grouping is also used (say, parentheses around or bars over a group of consecutive digits when written) so that, for example, (10) is known to represent 9999999999 rather than 8.

Examples

			a(12) = 110000000 as 12 consists only of one 1 and one 2, hence the following are concatenated: 0 1 1 0 0 0 0 0 0 0 and dropping the leading 0 gives 110000000 (= a(21) also).
		

Crossrefs

Cf. A100910 (each number of digit occurrences is a separate term).

Programs

A298372 a(n), in decimal base, is the number of numbers k >= 0 with no more digits than n such that k + n can be computed without carry.

Original entry on oeis.org

1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 90, 81, 72, 63, 54, 45, 36, 27, 18, 9, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 70, 63, 56, 49, 42, 35, 28, 21, 14, 7, 60, 54, 48, 42, 36, 30, 24, 18, 12, 6, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5, 40, 36, 32, 28, 24, 20, 16, 12, 8
Offset: 0

Views

Author

Rémy Sigrist, Jan 18 2018

Keywords

Comments

We consider here that 0 has no digit, and hence a(0) = 1.
The corresponding sequence for the binary base is A080100.

Examples

			a(42) = (10 - 4) * (10 - 2) = 48.
		

Crossrefs

Programs

  • PARI
    a(n, {base=10}) = my (d=digits(n, base)); prod(i=1, #d, base-d[i])

Formula

a(0) = 1.
a(10 * k + d) = a(k) * (10 - d) when 10 * k + d > 0 and 0 <= d < 10.
a(n) = Product_{ d = 0..9 } (10 - d)^A100910(n, d) for any n > 0.

A015582 Inverse of 1573rd cyclotomic polynomial.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Keywords

Comments

Periodic with period length 1573. - Ray Chandler, Apr 07 2017

Crossrefs

Different from A014856 and A100910.

Programs

  • Maple
    with(numtheory,cyclotomic); c := n->series(1/cyclotomic(n, x), x,80); c(1573);
  • Mathematica
    CoefficientList[Series[1/Cyclotomic[1573, x], {x, 0, 100}], x][[;; 81]] (* Jean-François Alcover, Jul 05 2011 *)

Formula

cyclotomic(1573,x) is a polynomial of 120th order in the variable x^11, so it is c = 1 - x^11 - x^132 + x^264 + ... + x^1320, or with y = x^11 we can write c = 1 - y + y^11 - y^12 + y^13 - y^14 ... + y^120. - R. J. Mathar, Oct 20 2008

Extensions

Incorrect formula deleted by N. J. A. Sloane, Oct 20 2008
Showing 1-10 of 10 results.