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

A178403 Numbers containing the rounded up arithmetic mean of their digits at least once, cf. A004427.

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, 133, 134, 135, 143, 145, 146, 147, 153, 154, 157, 158, 159, 164, 169, 174, 175, 185
Offset: 1

Views

Author

Reinhard Zumkeller, May 27 2010

Keywords

Comments

A178401(a(n)) > 0; complement of A178402.
A010785, A050278, A178358, A178359 are subsequences;
a(n) = A131207(n) for n < 48;
a(n) = A134336(n) for n < 48;
a(n+1) = A032981(n) for n < 38.

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

A235163 Number of positive integers with n digits in which adjacent digits differ by at most 1.

Original entry on oeis.org

9, 26, 75, 217, 629, 1826, 5307, 15438, 44941, 130900, 381444, 1111926, 3242224, 9455987, 27583372, 80472698, 234799873, 685149328, 1999414181, 5835044495, 17029601028, 49702671494, 145066398937, 423412132499, 1235854038791, 3607255734629, 10529101874491
Offset: 1

Views

Author

Gerry Leversha, Jan 04 2014

Keywords

Examples

			a(2) = 26: 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.
		

Crossrefs

Cf. A032981, A090994, A126364 (allowing leading zeros).

Programs

  • Maple
    u:= proc(n, r) option remember; `if`(n=1, `if`(r=0, 0, 1),
          add(`if`(r+i in [$0..9], u(n-1, r+i), 0), i=-1..1))
        end:
    a:= n-> add(u(n, r), r = 0..9):
    seq(a(n), n=1..30);  # Alois P. Heinz, Jan 12 2014
  • Mathematica
    CoefficientList[Series[-x*(3*x^4-18*x^3-9*x^2+28*x-9)/(x^5-6*x^4-x^3+10*x^2-6*x+1),{x,0,30}],x]//Rest (* Harvey P. Dale, Aug 13 2019 *)
  • Python
    from functools import cache
    @cache
    def u(n, r):
        if r < 0 or r > 9: return 0
        if n == 1: return (r > 0)
        return u(n-1, r-1) + u(n-1, r) + u(n-1, r+1)
    def a(n): return sum(u(n, r) for r in range(10))
    print([a(n) for n in range(1, 28)]) # Michael S. Branicky, Sep 26 2021

Formula

a(n) = Sum_{r=0..9} u(n,r) where u(n,r) = 0 if r<0 or r>9, u(1,0) = 0, u(1,r) = 1 for 1<=r<=9, and otherwise u(n,r) = u(n-1,r-1) + u(n-1,r) + u(n-1,r+1).
G.f.: -x*(3*x^4-18*x^3-9*x^2+28*x-9)/(x^5-6*x^4-x^3+10*x^2-6*x+1). - Alois P. Heinz, Jan 12 2014

A068148 Primes in which neighboring digits differ at most by 1.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 43, 67, 89, 101, 109, 211, 223, 233, 433, 443, 677, 787, 877, 887, 1009, 1109, 1123, 1223, 2111, 2221, 2333, 3221, 3323, 3343, 3433, 4567, 5443, 7789, 7877, 8887, 8999, 9001, 9011, 9887, 9901, 10009, 10099, 10111, 10909, 10987, 12101, 12109
Offset: 1

Views

Author

Amarnath Murthy, Feb 23 2002

Keywords

Comments

Neighbors of 9 are 0 and 8 and 9.

Crossrefs

Cf. A010051, subsequence of A032981.

Programs

  • Haskell
    a068148 n = a068148_list !! (n-1)
    a068148_list = filter ((== 1) . a010051') a032981_list
    -- Reinhard Zumkeller, Feb 14 2015
  • Mathematica
    Do[a = IntegerDigits[ Prime[n]]; k = 1; l = Length[a]; While[k < l && (Abs[a[[k]]- a[[k + 1]]] < 2 || Abs[a[[k]] - a[[k + 1]]] > 8), k++ ]; If[k == l, Print[ Prime[n]]], {n, 1, 10^4} ]
    Select[Prime[Range[1500]],Max[Abs[Differences[IntegerDigits[#]]]/.{9->1}] < 2&] (* Harvey P. Dale, Jan 31 2012 *)

Extensions

Edited and extended by Robert G. Wilson v and Sascha Kurz, Mar 01 2002
Corrected by T. D. Noe, Feb 15 2008

A252490 Numbers whose set of digits is simply connected, with 9 and 0 considered as neighbors.

Original entry on oeis.org

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, 90, 98, 99, 100, 101, 102, 109, 110, 111, 112, 120, 121, 122, 123, 132, 190, 201, 210, 211, 212, 213, 221, 222, 223, 231, 232, 233, 234, 243, 312, 321, 322, 323, 324, 332, 333, 334, 342, 343, 344, 345, 354, 423, 432
Offset: 1

Views

Author

M. F. Hasler, Dec 24 2014

Keywords

Comments

The set of digits must consist of a single run without "holes", but for a cyclic topology where 9 and 0 are seen as neighbors.
A superset of A134336. Namely, numbers in A134336 or such that the complement of their digits in {0,...,9} satisfies the criterion of A134336.

Crossrefs

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

Programs

  • PARI
    is(n)=vecmax(if((d=Set(digits(n)))[1],d,d=setminus(vector(9,i,i),d)))-vecmin(d)==#d-1

A032987 Numbers with the property that all pairs of consecutive base-10 digits differ by more than 2.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15, 16, 17, 18, 19, 25, 26, 27, 28, 29, 30, 36, 37, 38, 39, 40, 41, 47, 48, 49, 50, 51, 52, 58, 59, 60, 61, 62, 63, 69, 70, 71, 72, 73, 74, 80, 81, 82, 83, 84, 85, 90, 91, 92, 93, 94, 95, 96, 140, 141, 147, 148
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A032981.

Programs

  • Mathematica
    Select[Range[200],And@@(Abs[First[#]-Last[#]]>2&/@Partition[ IntegerDigits[#],2,1])&] (* Harvey P. Dale, Mar 28 2011 *)
    Select[Range[200],Min[Abs[Differences[IntegerDigits[#]]]]>2&] (* Harvey P. Dale, May 24 2015 *)

A252481 Numbers whose set of digits is simply connected to 1.

Original entry on oeis.org

1, 10, 11, 12, 21, 100, 101, 102, 110, 111, 112, 120, 121, 122, 123, 132, 201, 210, 211, 212, 213, 221, 231, 312, 321, 1000, 1001, 1002, 1010, 1011, 1012, 1020, 1021, 1022, 1023, 1032, 1100, 1101, 1102, 1110, 1111, 1112, 1120, 1121, 1122, 1123, 1132, 1200, 1201, 1202, 1203, 1210, 1211, 1212, 1213, 1220, 1221, 1222, 1223
Offset: 1

Views

Author

M. F. Hasler, Dec 24 2014

Keywords

Comments

"Simply connected" means that there must not be a "hole" in the set of digits. E.g., {1,2,4} would not be allowed since '3' is missing.

Crossrefs

Programs

  • PARI
    is(n)={d=Set(digits(n));d[1]==1 || (#d>1&&d[2]==1) || return; d[#d]==#d-!d[1]}
    
  • Python
    def ok(n):
      s = set(str(n)); return '1' in s and len(s) == ord(max(s))-ord(min(s))+1
    def aupto(nn): return [m for m in range(1, nn+1) if ok(m)]
    print(aupto(1223)) # Michael S. Branicky, Jan 10 2021

A284046 Numbers k, not ending in 0, such that the consecutive digits of k^2 differ by 0 or 1.

Original entry on oeis.org

1, 2, 3, 11, 26, 111, 1111, 11111, 105462, 111111, 460688, 753576, 1111111, 2806538, 3513626, 5858612, 11111111, 23335688, 111111111, 674874474, 8226042716, 2131535935501, 81655720279388
Offset: 1

Views

Author

Giovanni Resta, Mar 19 2017

Keywords

Comments

Equivalently, numbers not ending in 0, whose square belong to A032981.
All members k ending in 1 are generators of infinite numbers of the form k*10^e which satisfy the same property. In a sense, here we list only "primitive" terms, not ending in 0.
a(24) > 10^17, if it exists.

Examples

			81655720279388 belongs to this sequence because the consecutive digits of its square, 6667656654345656676777654544, differ by 0 or 1.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^6], Mod[#, 10] > 0 && Max@ Abs@ Differences@ IntegerDigits[ #^2] <= 1 &]

A357142 Nonnegative numbers all of whose pairs of consecutive decimal digits are adjacent digits, where 9 and 0 are considered adjacent.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 21, 23, 32, 34, 43, 45, 54, 56, 65, 67, 76, 78, 87, 89, 90, 98, 101, 109, 121, 123, 210, 212, 232, 234, 321, 323, 343, 345, 432, 434, 454, 456, 543, 545, 565, 567, 654, 656, 676, 678, 765, 767, 787, 789, 876, 878, 890, 898, 901, 909
Offset: 1

Views

Author

Ofer Zivony, Sep 14 2022

Keywords

Comments

This is very similar to A033075, with the exception of considering 0 and 9 as adjacent digits. This allows these digits to be equal to the other digits, making it a more balanced list.

Crossrefs

Cf. A032981, A033075, A043089 (ternary analog), A048491.

Programs

  • Maple
    q:= n-> (l-> andmap(x-> x in {1, 9}, {seq(abs(l[i]-l[i-1]),
                 i=2..nops(l))}))(convert(n, base, 10)):
    select(q, [$0..1000])[];  # Alois P. Heinz, Sep 14 2022
  • Mathematica
    q[n_] := AllTrue[Abs @ Differences @ IntegerDigits[n], MemberQ[{1, 9}, #] &]; Select[Range[0, 1000], q] (* Amiram Eldar, Sep 15 2022 *)
  • PARI
    a(n) = { n--; for (b=0, oo, if (n <= 9*2^b, my (v=ceil(n/2^b), p=(n-1)%(2^b)); while (b>0, v=10*v+vecsort([(v-1)%10, (v+1)%10])[1+bittest(p,b--)];); return (v), n -= 9*2^b)) } \\ Rémy Sigrist, Sep 15 2022
  • Python
    def add_dig(x):
      d = (x%10-1)%8 if x%10 != 0 else 1
      return 10*x+d
    def try_incr(x):
      if x < 10: return x+1
      r = x//10
      d2 = r%10
      d = max((d2+1)%10,(d2-1)%10)
      return 10*r+d
    def incr(x):
      new_x=try_incr(x)
      return new_x if new_x>x else add_dig(incr(x//10))
    x = 0
    for n in range(1,1000):
      print(f"{n} {x}")
      x = incr(x)
    
Showing 1-9 of 9 results.