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

A171738 Number of n-digit terms in A115853.

Original entry on oeis.org

0, 9, 9, 252, 819, 11754, 72585, 803448, 6978159, 73047510, 744922341, 8023947732, 88219609227, 993117723282, 11397388906305, 132852212160624, 1568346473860839, 18699577205645646, 224600363892164061, 2711096523623447820, 32815659723020049411, 397495008150096639114
Offset: 1

Views

Author

Zak Seidov, Dec 17 2009

Keywords

Crossrefs

Cf. A115853 (numbers where every present decimal digit occurs more than once).

Programs

  • Mathematica
    Table[9 Sum[k! Binomial[9, k] (-1)^i Binomial[n, i] StirlingS2[n - i, k - i + 1], {k, 0, 9}, {i, 0, Min[n, k + 1]}], {n, 21}] (* Matthew House, Sep 06 2020 *)

Formula

From Matthew House, Sep 13 2020: (Start)
a(n) = Sum_{k=0..9} k!*C(9,k)*(S_2(n,k) + k*S_2(n,k+1)) = 9*Sum_{k=0..9} k!*C(9,k)*S_2(n,k+1), where S_2(n,k) = A008299(n,k).
a(n) = 9*Sum_{k=0..10} (-1)^k*9!/(10-k)!*C(n,k)*(10-k)^(n-k) for n >= 10, where 0^0 = 1.
All terms from a(11) onward satisfy a linear recurrence with characteristic polynomial (1-x)^10*(2-x)^9*(3-x)^8*(4-x)^7*(5-x)^6*(6-x)^5*(7-x)^4*(8-x)^3*(9-x)^2*(10-x). (End)

Extensions

More terms from Matthew House, Sep 06 2020

A033023 Numbers whose base-10 expansion has no run of digits with length < 2.

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 222, 333, 444, 555, 666, 777, 888, 999, 1100, 1111, 1122, 1133, 1144, 1155, 1166, 1177, 1188, 1199, 2200, 2211, 2222, 2233, 2244, 2255, 2266, 2277, 2288, 2299, 3300, 3311, 3322, 3333
Offset: 1

Views

Author

Keywords

Comments

Contains A014181 as subsequence. A115853 is a supersequence. - M. F. Hasler, Jun 24 2016

Crossrefs

Programs

  • Mathematica
    Select[Range[10000], Min[Length/@Split[IntegerDigits[#, 10]]]>1&] (* Vincenzo Librandi, Feb 05 2014 *)
  • PARI
    is(n)={n=digits(n);while(#n>2 && n[2]==n[1], n=if(n[3]==n[1],n[^1],n[3..-1]));#n>1&&n[1]==n[2]} \\ M. F. Hasler, Jun 24 2016

A320485 Keep just the digits of n that appear exactly once; write -1 if all digits disappear.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, -1, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, -1, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, -1, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, -1, 1, 0, 102, 103, 104, 105, 106, 107, 108, 109, 0, -1, 2, 3, 4, 5, 6, 7, 8, 9, 120, 2, 1, 123, 124, 125, 126, 127, 128, 129, 130, 3
Offset: 0

Views

Author

N. J. A. Sloane, Oct 24 2018

Keywords

Comments

Digits that appear more than once in n are erased. Leading zeros are erased unless the result is 0. If all digits are erased, we write -1 for the result.
The map n -> a(n) was invented by Eric Angelini and described in a posting to the Sequence Fans Mailing List on Oct 24 2018.
More than the usual number of terms are shown in order to reach some interesting examples.
a(n) = -1 mostly. - David A. Corneth, Oct 24 2018

Examples

			1231 becomes 23, 1123 becomes 23, 11231 becomes 23, and 11023 becomes 23 (as we don't accept leading zeros). Note that 112323 disappears immediately and we get -1.
101 and 110 become 0 while 11000 and 10001 become -1.
		

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Oct 24 2018

Crossrefs

See A320486 for another version.

Programs

  • Maple
    f:= proc(n) local F,S;
      F:= convert(n,base,10);
      S:= select(t -> numboccur(t,F)>1, [$0..9]);
      if S = {} then return n fi;
      F:= subs(seq(s=NULL,s=S),F);
      if F = [] then -1
      else add(F[i]*10^(i-1),i=1..nops(F))
      fi
    end proc:
    map(f, [$0..200]); # Robert Israel, Oct 24 2018
  • Mathematica
    Array[If[# == {}, -1, FromDigits@ #] &@ Map[If[#[[-1]] > 1, -1, #[[1]] ] /. -1 -> Nothing &, Tally@ IntegerDigits[#]] &, 131] (* Michael De Vlieger, Oct 24 2018 *)
  • PARI
    a(n) = {my(d=digits(n), v = vector(10), res = 0, t = 0); for(i=1, #d, v[d[i]+1]++); for(i=1, #d, if(v[d[i]+1]==1, t = 1; res=10 * res + d[i])); res - !t + !n} \\ David A. Corneth, Oct 24 2018
    
  • Python
    def A320485(n):
        return (lambda x: int(x) if x != '' else -1)(''.join(d if str(n).count(d) == 1 else '' for d in str(n))) # Chai Wah Wu, Nov 19 2018

Formula

From Rémy Sigrist, Oct 24 2018: (Start)
a(n) = n iff n belong to A010784.
a(n) <= 9876543210 with equality iff n = 9876543210.
(End)
If n > 9876543210, then a(n) < n. If a(n) < n, then a(n) <= 99n/1000. - Chai Wah Wu, Oct 24 2018

A350444 a(n) is the smallest number that has not appeared yet in the sequence and has only one digit in common with a(n-1).

Original entry on oeis.org

1, 10, 12, 2, 20, 21, 13, 3, 23, 24, 4, 14, 15, 5, 25, 26, 6, 16, 17, 7, 27, 28, 8, 18, 19, 9, 29, 32, 30, 31, 34, 35, 36, 37, 38, 39, 43, 40, 41, 42, 45, 46, 47, 48, 49, 54, 50, 51, 52, 53, 56, 57, 58, 59, 65, 60, 61, 62, 63, 64, 67, 68, 69, 76, 70, 71, 72, 73, 74, 75, 78, 79, 87, 80, 81, 82, 83, 84, 85, 86, 89, 90
Offset: 1

Views

Author

Rodolfo Kurchan, Dec 31 2021

Keywords

Comments

Terms computed by Claudio Meller.
It appears that this sequence contains all numbers except those in A115853.

Examples

			a(2) = 10 because it is the smallest number that has exactly one digit in common with a(1) = 1; similarly, a(3) = 12 because it has one digit in common with a(2) = 10 and a(4) = 2 because it is the smallest number that is not already in the sequence that has exactly one digit in common with a(3) = 12.
		

Crossrefs

Programs

A339803 Base-10 super-weak Skolem-Langford numbers.

Original entry on oeis.org

2002, 30003, 131003, 200200, 231213, 300131, 312132, 400004, 420024, 1312132, 1410004, 2002000, 2002002, 2312131, 2312132, 3000300, 4000141, 5000005, 5300035, 12132003, 13100300, 14100141, 14130043, 15100005, 15120025, 20020000, 23121300, 23421314, 25121005, 25320035, 30003000, 30013100, 30023121, 31213200
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Dec 17 2020

Keywords

Comments

Pick any digit d of a(n): there are exactly d digits between d and the closest duplicate of d (either before or after) inside a(n).
There are infinitely many such terms.
From M. F. Hasler, Dec 19 2020: (Start)
If N is a term of the sequence, then:
(1) Any digit of N must be present at least twice in N (cf. A115853).
(2) N*10^k is also a term of the sequence, for all k >= 2.
(3) The reversal R(N) = A004086(N) is also a term (with leading zeros deleted). (End)

Examples

			a(1) = 2002: in 2002 the closest duplicate of the first 2 is 2 positions away to the right, the closest duplicate of the first 0 is 0 position away to the right, the closest duplicate of the second 0 is 0 position away to the left, the closest duplicate of the second 2 is 2 positions away to the left;
a(2) = 30003: in 30003 the closest duplicate of the first 3 is 3 positions away to the right, the closest duplicate of the first 0 is 0 position away to the right, the closest duplicate of the second 0 is 0 position away (either to the left or to the right), the closest duplicate of the third 0 is 0 position away to the left, the closest duplicate of the second 3 is 3 positions away to the left;
a(13) = 2312131: if you pick any digit 1, the closest duplicate of this 1 is 1 position away (either to the left or to the right), if you pick any 2, the closest duplicate of this 2 is 2 positions away, if you pick any 3, the closest duplicate of this 3 is 3 positions away, etc.
		

Crossrefs

Cf. base-10 Skolem-Langford numbers: A108116 (weak), A357826 (weaker), A132291 (strong).
Cf. A339611 (same idea turned into a different sequence).
Cf. A115853.

Programs

  • PARI
    is_A339803(n)={!for(i=1,#n=digits(n), (i>n[i]+1 && n[i-n[i]-1]==n[i])||(i+n[i]<#n && n[i+n[i]+1]==n[i])||return; for(j=max(i-n[i],1), min(i+n[i],#n), n[j]==n[i] && j!=i && return))} \\ M. F. Hasler, Dec 19 2020
  • Python
    def nn(ti, t, s):
      li = s.rfind(t, 0, max(ti, 0))
      ri = s.find(t, min(ti+1, len(s)), len(s))
      if li==-1: li = -11
      if ri==-1: ri = len(s)+11
      return min(ti-li, ri-ti) - 1
    def ok(n):
      strn = str(n)
      if any(strn.count(c)==1 for c in set(strn)): return False
      for i, c in enumerate(strn):
        if nn(i, c, strn) != int(c): return False
      return True
    for n in range(6*10**6):
      if ok(n): print(n, end=", ") # Michael S. Branicky, Dec 17 2020
    
Showing 1-5 of 5 results.