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 51-60 of 171 results. Next

A125289 Numbers with unique nonzero digit in decimal representation.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 22, 30, 33, 40, 44, 50, 55, 60, 66, 70, 77, 80, 88, 90, 99, 100, 101, 110, 111, 200, 202, 220, 222, 300, 303, 330, 333, 400, 404, 440, 444, 500, 505, 550, 555, 600, 606, 660, 666, 700, 707, 770, 777, 800, 808, 880, 888, 900, 909
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 26 2006

Keywords

Comments

A043537(a(n)) <= 2.
A043537(A004719(a(n))) = 1: A004719(a(n)) is a repdigit number, see A010785;
also numbers having exactly one partition into digit values of their decimal representations: A061827(a(n))=1.

Crossrefs

Cf. A125292.

Programs

  • PARI
    is(n, base=10) = #Set(select(sign, digits(n, base)))==1 \\ Rémy Sigrist, Mar 28 2020
    
  • PARI
    a(n,base=10) = { for (w=0, oo, if (n<=(base-1)*2^w, my (d=1+(n-1)\2^w, k=2^w+(n-1)%(2^w)); return (d*fromdigits(binary(k), base)), n -= (base-1)*2^w)) } \\ Rémy Sigrist, Mar 28 2020
  • Python
    A125289_list = [n for n in range(10**4) if len(set(str(n))-{'0'})==1]
    # Chai Wah Wu, Jan 04 2015
    
  • Python
    from itertools import count, product, islice
    def A125289_gen(): # generator of terms
        yield from (int(d+''.join(m)) for l in count(0) for d in '123456789' for m in product('0'+d,repeat=l))
    A125289_list = list(islice(A125289_gen(),20)) # Chai Wah Wu, Mar 14 2025
    

A134336 Nonnegative integers n containing each digit between n's smallest and largest decimal digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 21, 22, 23, 32, 33, 34, 43, 44, 45, 54, 55, 56, 65, 66, 67, 76, 77, 78, 87, 88, 89, 98, 99, 100, 101, 102, 110, 111, 112, 120, 121, 122, 123, 132, 201, 210, 211, 212, 213, 221, 222, 223, 231, 232, 233, 234, 243, 312, 321, 322, 323
Offset: 1

Views

Author

Rick L. Shepherd, Oct 21 2007

Keywords

Comments

A032981 is a subsequence; the term 102 is the first positive integer not also in A032981. A171102 (pandigital numbers) and A033075 are subsequences. Union of A010785 (repdigits) and A108965.
a(n) = A178403(n) for n < 48. - Reinhard Zumkeller, May 27 2010
Equivalently, numbers with the property that the set of its decimal digits is a set of consecutive numbers. - Tanya Khovanova and Charles R Greathouse IV, Jul 31 2012

Crossrefs

Cf. A032981, A050278, A033075 (a subsequence), A010785, A108965.

Programs

  • PARI
    is(n)=my(v=vecsort(eval(Vec(Str(n))),,8));for(i=2,#v,if(v[i]!=1+v[i-1],return(0)));1 \\ Tanya Khovanova and Charles R Greathouse IV, Jul 31 2012
    
  • PARI
    is_A134336(n)={vecmax(n=Set(digits(n)))-vecmin(n)==#n-1} \\ M. F. Hasler, Dec 24 2014
    
  • Python
    def ok(n): d = sorted(set(map(int, str(n)))); return d[-1]-d[0]+1 == len(d)
    print([k for k in range(324) if ok(k)]) # Michael S. Branicky, Dec 12 2023

Formula

a(n) ~ n. - Charles R Greathouse IV, Sep 09 2011

Extensions

Edited by N. J. A. Sloane, Aug 06 2012

A366958 Numbers whose difference between the largest and smallest digits is equal to 1.

Original entry on oeis.org

10, 12, 21, 23, 32, 34, 43, 45, 54, 56, 65, 67, 76, 78, 87, 89, 98, 100, 101, 110, 112, 121, 122, 211, 212, 221, 223, 232, 233, 322, 323, 332, 334, 343, 344, 433, 434, 443, 445, 454, 455, 544, 545, 554, 556, 565, 566, 655, 656, 665, 667, 676, 677, 766, 767, 776, 778, 787, 788
Offset: 1

Views

Author

Stefano Spezia, Oct 30 2023

Keywords

Comments

The number of n-digit terms of this sequence is 17*A000225(n-1).

Crossrefs

Cf. A010785 (difference = 0), A366959 (difference = 2), A366960 (difference = 3), A366961 (difference = 4), A366962 (difference = 5), A366963 (difference = 6), A366964 (difference = 7), A366965 (difference = 8), A366966 (difference = 9).

Programs

  • Mathematica
    Select[Range[800],Max[d=IntegerDigits[#]]-Min[d]==1 &]
  • PARI
    isok(n) = my(d=digits(n)); vecmax(d) - vecmin(d) == 1; \\ Michel Marcus, Oct 30 2023
    
  • Python
    def ok(n): return max(d:=list(map(int, str(n))))-min(d) == 1
    print([k for k in range(800) if ok(k)]) # Michael S. Branicky, Oct 30 2023
    
  • Python
    # faster version for large terms
    from itertools import count, islice, product
    def agen(diff=1): # generator of terms; change diff for A366960-A366966
        for digits in count(2):
            s = set()
            for lo in range(10-diff):
                hi = lo + diff
                allowed = list(range(lo, hi+1))
                for p in product(allowed, repeat=digits):
                    if p[0]==0 or lo not in p or hi not in p: continue
                    s.add(int("".join(map(str, p))))
            yield from sorted(s)
    print(list(islice(agen(), 60))) # Michael S. Branicky, Oct 30 2023

A075024 a(n) is the largest prime divisor of the number A173426(n) = concatenate(1,2,...,n-1,n,n-1,...,2,1); a(1) = 1.

Original entry on oeis.org

1, 11, 37, 101, 271, 37, 4649, 137, 333667, 12345678910987654321, 17636684157301569664903, 2799473675762179389994681, 2354041513534224607850261, 2068140300159522133, 498056174529497, 112240064764214229701, 4188353169004802474320231191377
Offset: 1

Views

Author

Amarnath Murthy, Sep 01 2002

Keywords

Comments

Also for 1 < n < 10, a(n) is the common prime divisor for all A010785(m) which consist of n digits. - Alexander R. Povolotsky, Jun 05 2014, corrected by M. F. Hasler, Jul 30 2015
According to the definition (and given terms), this is the greatest prime factor (A006530) of A173426 and not of A002477, as an earlier formula asserted and which may have been an assumption of the preceding comment. - M. F. Hasler, Jul 29 2015

Examples

			a(5) = 271 as 123454321 = 41*41*271*271.
a(25) = 12471243489559387823527232424981012432152516319410549 is the larger factor of the semiprime A173426(24) = A075023(25) * a(n).
		

Crossrefs

Programs

  • Mathematica
    Table[FactorInteger[FromDigits[Join[Flatten[IntegerDigits/@Range[ n]], Flatten[ IntegerDigits/@Range[n-1,1,-1]]]]][[-1,1]],{n,20}] (* Harvey P. Dale, May 20 2016 *)
  • PARI
    a(n) = {if (n == 1, return (1)); s = ""; for (i=1, n, s = concat(s, Str(i));); forstep (i=n-1, 1, -1, s = concat(s, Str(i));); f = factor(eval(s)); f[#f~, 1];} \\ Michel Marcus, Jun 05 2014
    
  • PARI
    A075024(n)=A006530(A173426(n)) \\ A006530 should provide efficient code and also covers the case n=1. - M. F. Hasler, Jul 29 2015

Formula

a(n) = A006530(A173426(n)). - Michel Marcus, Jun 05 2014, corrected by M. F. Hasler, Jul 29 2015

Extensions

More terms from Sascha Kurz, Jan 03 2003
a(16)-a(17) from Michel Marcus, Jun 05 2014
More terms from M. F. Hasler, Jul 29 2015

A088670 Number of partitions of n into distinct decimal repdigit numbers.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 17, 19, 21, 23, 26, 27, 30, 32, 34, 36, 37, 39, 40, 42, 42, 44, 44, 45, 45, 47, 47, 47, 49, 48, 50, 50, 52, 52, 55, 55, 58, 60, 60, 64, 65, 68, 69, 73, 73, 77, 78, 82, 84, 84, 88, 88, 92, 92, 96, 96, 100, 100, 105, 107, 107, 113
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 03 2003

Keywords

Comments

a(n) <= A000009(n).
Not the same as A091581: a(n) < A091581(n) for n > 101.
A109967(n) = a(n+1) - a(n). - Reinhard Zumkeller, Jul 06 2005

Crossrefs

Programs

  • Haskell
    a088670 = p $ tail a010785_list where
       p _      0 = 1
       p (k:ks) m = if m < k then 0 else p ks (m - k) + p ks m
    -- Reinhard Zumkeller, Dec 10 2011

Extensions

a(0)=1 added and offset adjusted by Reinhard Zumkeller, Dec 10 2011

A178401 Number of times the rounded up arithmetic mean of digits of n occurs in n, cf. A004427.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, May 27 2010

Keywords

Comments

a(A178402(n)) = 0; a(A050278(n)) = 1; a(A178403(n)) > 0;
a(A010785(n)) > 0; a(A178358(n)) > 0; a(A178359(n)) > 0.

A180160 (sum of digits) mod (number of digits) of n in decimal representation.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 15 2010

Keywords

Comments

a(n) = A007953(n) mod A055642(n);
a(A061383(n)) = 0; a(A180157(n)) > 0;
a(repdigits)=0: a(A010785(n))=0: a(A002275(n))=0: a(A002276(n))=0: a(A002277(n))=0: a(A002278(n))=0: a(4(n))=0: a(A002279(n))=0: a(A002280(n))=0: a(A002281(n))=0: a(A002282(n))=0: a(A002283(n))=0;
A123522 gives smallest m such that a(m) = n.

Crossrefs

Programs

  • Mathematica
    A180160[n_] := If[n == 0, 0, Mod[Total[#], Length[#]] & [IntegerDigits[n]]];
    Array[A180160, 100, 0] (* Paolo Xausa, Jun 30 2024 *)
    Join[{0},Table[Mod[Total[IntegerDigits[n]],IntegerLength[n]],{n,110}]] (* Harvey P. Dale, Jul 30 2025 *)

A329198 Size of the orbit of n under "ghost iterations" A329200.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Nov 10 2019

Keywords

Comments

Or: Number of iterations of A329200 until a number is seen for the second time in the trajectory of n.
A329200 consists of adding to n the number whose digits are the differences of adjacent digits of n in case it is even, or subtracting it if it is odd.
The trajectory of most small numbers ends in a repdigit (A010785) which are fixed points of this map. Some larger numbers enter nontrivial cycles, cf. examples and A329196. In both cases, some number(s) will appear infinitely often in the trajectory. This sequence gives the number of iterations until a value is repeated for the first time in the trajectory of n. This is also the size of n's orbit, i.e. the total number of distinct values that will ever appear.
If n is part of the cycle, a(n) gives the length of the cycle; in particular a(n) = 1 for fixed points.
For 11 <= n <= 99 the pattern (1, 2, 5, 2, 4, 2, 3, 2, 3, 2, 3) of length 11 repeats, i.e., a(n) = a(n') if n = n' (mod 11). But the trajectory of congruent n with same a(n) does not always end in the corresponding repdigit, e.g., 11+2 and 22+2 both end in 22, 33+2 ends in 33, 44+2 ends in 44, 55+2 and 66+2 both end in 66, 77+2 and 88+2 in 77, etc.

Examples

			The smallest starting value for which the trajectory does not end in a fixed point is n = 8059: Here it enters after 14 iterations a cycle of length 5, 11090 -> 10891 -> 12709 -> 11130 -> 11107 -> 11090 etc., so a(8059) = 14 + 5 = 19.
Many other values after this n  (8079, 8260, 8262, ..., 9008, ...) enter the same loop at 11090, others (9060, 9062, 9064, 9066, ...) enter the same loop at 12709.
Starting value n = 37908 leads after two steps into the new cycle (44232, 44021, 43600, 44960, 45496, 44343) of length 6, so a(37908) = 8.
Starting value n = 68060 leads after 8 steps into a cycle of length 7, (75800, 78180, 79958, 77915, 78199, 79979, 82001), so a(68060) = 15.
a(70502) = 6 because this starting value leads after 3 steps into the loop (74780, 78098, 76207).
a(70515) = 20, entering the loop (111090, 110891, 112709, 111130, 111107) after 15 steps. See A329196 for more cycles and related information.
		

Crossrefs

Cf. A329200, A329196 (cycles), A329197 (length of cycles).
Cf. A329340 (analog for the variant A329201).

Programs

  • PARI
    A329198(n,M=oo,U=[n])={for(k=1,M,setsearch(U,n=A329200(n))&&return(k); U=setunion(U,[n]))}

Formula

a(n) = 1 <=> n is a fixed point of A329200 <=> n is a repdigit number (A010785).

A116692 Primes with only one distinct decimal digit. Also called repunit primes or repdigit primes.

Original entry on oeis.org

2, 3, 5, 7, 11, 1111111111111111111, 11111111111111111111111
Offset: 1

Views

Author

Rick L. Shepherd, Feb 22 2006

Keywords

Comments

Primes in A010785 (repdigit numbers). Union of single-digit primes and A004022 (repunit primes). A004023 shows that the next term has 317 1's. The Mersenne primes (A000668) are the binary analog (i.e., bits are all 1's).

References

  • Clifford A. Pickover, A Passion for Mathematics (2005) at 60, 297.

Crossrefs

A004022 is a subsequence.
A subsequence of A055387, but not of A225053.

Extensions

Reference provided by Harvey P. Dale, Apr 19 2014
Definition expanded by N. J. A. Sloane, Jan 22 2023

A244602 First repdigit number with n digits occurring in the decimal expansion of e, starting after the decimal point.

Original entry on oeis.org

7, 66, 999, 8888, 66666, 0, 5555555, 99999999, 111111111, 1111111111
Offset: 1

Views

Author

Felix Fröhlich, Jul 01 2014

Keywords

Comments

A244601 allows consecutive 0's and says "Resulting repdigits are A244602", so 000000 = 0 is apparently allowed here as a repdigit with 6 digits. Otherwise a(6) would be 555555 at position 210482 (which extends to a seventh 5). - Jens Kruse Andersen, Jul 20 2014

Examples

			Decimal expansion of e:
2.|7|18281828459045235360287471352|66|24977572470936|999|59574966967627724..
		

Crossrefs

Programs

  • Mathematica
    e = Rest[First[RealDigits[E, 10, 2000000]]];
    A244602 = ConstantArray[0, 8];
    For[i = 1, i <= Length[e], i++,
    t = e[[i]]; c = 1;
    While[e[[i + c]] == t, c++];
    If[A244602[[c]] == 0,
      A244602[[c]] = FromDigits[ConstantArray[t, c]]; i = i + c - 1;
      Continue[]]
    ]; A244602 (* Robert Price, Sep 07 2019 *)
    With[{edg=Rest[RealDigits[E,10,10^6][[1]]]},Table[FromDigits[SequenceCases[ edg, PadRight[ {},n,x_],1][[1]]],{n,7}]] (* The program generates the first seven terms of the sequence. *) (* Harvey P. Dale, Aug 13 2022 *)

Extensions

a(5)-a(8) from Jens Kruse Andersen, Jul 20 2014
a(9)-a(10) from Felix Fröhlich, Aug 26 2014
a(1) prepended by Alois P. Heinz, Aug 26 2014
Previous Showing 51-60 of 171 results. Next