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 13 results. Next

A203569 Numbers whose digits are a permutation of [0,...,n] and which contain the product of any two adjacent digits as a substring.

Original entry on oeis.org

0, 10, 102, 120, 201, 210, 1203, 1302, 2013, 2031, 2103, 2130, 3012, 3021, 3102, 3120, 12034, 12043, 20314, 20413, 21304, 21403, 30214, 30412, 31204, 31402, 34012, 34120, 40213, 40312, 41203, 41302, 43012, 43120, 120345, 120543, 203145, 203154, 204153
Offset: 1

Views

Author

M. F. Hasler, Jan 03 2012

Keywords

Comments

The subsequence A198298 corresponding to n=9 was suggested by E. Angelini (cf. link).
If we consider permutations of [1,...,n], the only solutions are { 1, 12, 21, 213, 312, 3412, 4312, 71532486 }.
There are 285 terms.

Examples

			The term 12034 is in the sequence since 1*2=2, 2*0=0, 0*3=0 and 3*4=12 are all substrings of 12034. This is the least nontrivial term in the sense that it contains two adjacent digits > 1, which is the case for all solutions > 42000.
		

Crossrefs

Programs

  • PARI
    n_digit_terms(n)={ my(a=[],p=vector(n,i,10^(n-i))~,t);for(i=(n-1)!,n!-1, is_A203565(t=numtoperm(n,i)%n*p) & a=concat(a,t));vecsort(a)}

A203566 Numbers that contain the product of any two adjacent digits as a substring, and have at least one pair of adjacent digits > 1.

Original entry on oeis.org

126, 153, 1025, 1052, 1126, 1153, 1260, 1261, 1262, 1530, 1531, 1535, 2045, 2054, 2126, 2137, 2153, 2173, 2204, 2214, 2306, 2316, 2408, 2418, 2510, 2612, 2714, 2816, 2918, 3056, 3065, 3126, 3153, 3206, 3216, 3309, 3319, 3412, 3515, 3618, 4022, 4058, 4085, 4122, 4126, 4153, 4208, 4218
Offset: 1

Views

Author

M. F. Hasler, Jan 03 2012

Keywords

Comments

Inspired by the problem restricted to pandigital numbers suggested by E. Angelini (cf. link).
Any number having no two adjacent digits larger than 1 is trivially in the sequence A203565, which motivated the present sequence.
In the same way, any number obtained from some a(n) of this sequence by adding any number of digits '0' and '1' on either side is again in this sequence (126 -> 1126, 1260, 1261, ...). This suggests that "primitive" numbers of this kind be defined.

Examples

			The number 126 is in the sequence since 1*2=2 and 2*6=12 are both substrings of "126".
		

Crossrefs

Programs

  • PARI
    has(n,m)={ my(p=10^#Str(m)); until( m>n\=10, n%p==m & return(1))}
    is_A203566(n)={ my(d,f=0); n>21 & vecsort(d=eval(Vec(Str(n))))[#d-1]>1 & for( i=2,#d, d[i]<2 & i++ & next; d[i-1]>1 | next; has(n,d[i]*d[i-1]) | return; f=1);f }
    for( n=22,9999, is_A203566(n) & print1(n","))

A210013 Pandigital numbers (A050278) with each product of three adjacent digits visible as a substring of the digits.

Original entry on oeis.org

5631890724, 6581324079, 6581324097, 7249056318
Offset: 1

Views

Author

N. J. A. Sloane, Mar 16 2012

Keywords

Comments

Computed by Jean-Marc Falcoz.

Crossrefs

A generalization of A198298. Cf. A210013-A210020, A203569, A203566.

A203565 Numbers that contain the product of any two adjacent digits as a substring.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 30, 31, 40, 41, 50, 51, 60, 61, 70, 71, 80, 81, 90, 91, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 126, 130, 131, 140, 141, 150, 151
Offset: 1

Views

Author

M. F. Hasler, Jan 03 2012

Keywords

Comments

Inspired by the problem restricted to pandigital numbers suggested by E. Angelini (cf. link).
E. Angelini observes that up to a(86) this is the same as "Numbers that contain the product of (all) their digits as a substring" (cf. A227510 for the zeroless terms); then 212 is here but not there, and 236 is there and not here. - M. F. Hasler, Oct 14 2014

Examples

			Any number having no two adjacent digits larger than 1 is trivially in the sequence.
The smallest nontrivial example is the number 126, which is in the sequence since 1*2=2 and 2*6=12 are both substrings of "126".
		

Crossrefs

Cf. A203569 (digits are permutations of 0...n).
Cf. A227510 (product of all digits is a substring and > 0).

Programs

  • Maple
    filter:= proc(n)
    local L,S,i;
    S:= convert(n,string);
    for i from 1 to length(S)-1 do
      if StringTools:-Search(convert(parse(cat(S[i],"*",S[i+1])),string),S) = 0 then
          return false
      fi
    od:
    true
    end proc:
    select(filter, [$0..1000]); # Robert Israel, Oct 15 2014
  • Mathematica
    d[n_] := IntegerDigits[n]; Select[Range[0, 151], And @@ Table[MemberQ[FromDigits /@ Partition[d[#], IntegerLength[k], 1], k], {k, Times @@@ Partition[d[#], 2, 1]}] &] (* Jayanta Basu, Aug 10 2013 *)
  • PARI
    has(n,m)={ my(p=10^#Str(m)); until( m>n\=10, n%p==m & return(1))}
    is_A203565(n)={ my(d); for(i=2,#d=eval(Vec(Str(n))), has(n,d[i]*d[i-1]) | return);1 }
    is_A203565(n)={ my(d=Vecsmall(Str(n))); for(i=2,#d, d[i]<50 & i++ & next; has(n,d[i-1]%48*(d[i]-48)) | return);1 } /* twice as fast */
    for( n=0,999, is_A203565(n) & print1(n","))

A210020 In base 9, numbers n which have 9 distinct digits, do not start with 0, and have property that the product (written in base 9) of any two adjacent digits is a substring of n.

Original entry on oeis.org

247053168, 264057138, 264075138, 264138057, 264138075, 426057138, 426075138, 426138057, 426138075, 531680247, 531680742, 532407168, 532416807, 570264138, 570426138, 571380264, 571380426, 705324168, 708423516, 716084235, 716805324, 742053168, 750264138, 750426138, 751380264, 751380426, 842071635, 842350716, 842351607
Offset: 1

Views

Author

N. J. A. Sloane, Mar 16 2012

Keywords

Comments

Computed by Jean-Paul Davalan.
The analog in base 2 is 10; in base 3, 102,120,201,210.

Crossrefs

A generalization of A198298. Cf. A210013-A210020, A203569, A203566.

A236402 Numbers with property that the sum of any pair of adjacent digits is a substring of the number.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 400, 401, 402, 403, 404, 405, 406, 407
Offset: 1

Views

Author

Eric Angelini, Jan 30 2014

Keywords

Comments

This sequence has density 1, since all numbers except a thin fraction have digits 0 through 18 in base 100. In particular, there are at most x^0.99782 non-members up to x for large enough x. (This can be improved.) - Charles R Greathouse IV, Jan 30 2014
1263907548 is the smallest term that contains all ten digits. - M. F. Hasler, Jan 30 2014
Where does this first differ from A032945? - R. J. Mathar, Feb 03 2014
This first differs from A032945 at a(110)=910 (followed by 1000, 1001, 1002, ...) while A032945(110)=1000 (followed by 1010, 1020, 1030, ...). - M. F. Hasler, Dec 28 2014

Examples

			Examples of numbers in the sequence:
80 --> 8+0=8
107 --> 1+0=1  /  0+7=7
910 --> 9+1=10  /  1+0=1
1037 --> 1+0=1  /  0+3=3  /  3+7=10
1459 --> 1+4=5  /  4+5=9  /  5+9=14
41358 --> 4+1=5  /  1+3=4  /  3+5=8  /  5+8=13
		

Crossrefs

Cf. A236403 (complement).

Programs

  • Mathematica
    fQ[n_] := Module[{d, p, s}, d = IntegerDigits[n]; p = Partition[d, 2, 1]; s = Plus @@@ p; Complement[s, Union[d, FromDigits /@ p]] == {}]; Join[Range[0, 9], Select[Range[10, 1000], fQ]] (* T. D. Noe, Jan 30 2014 *)
  • PARI
    is(n)=my(d=digits(n),S=Set(d),v=List(),t); for(i=2,#d, listput(v, 10*d[i-1]+d[i])); S=Set(concat(S,Vec(v))); for(i=2,#d, t=d[i-1]+d[i]; if(!setsearch(S, t), return(0))); 1 \\ Charles R Greathouse IV, Jan 13 2015
    
  • Python
    def ok(n):
      s = str(n)
      return all(str(sum(map(int, s[i:i+2]))) in s for i in range(len(s)-1))
    print(list(filter(ok, range(408)))) # Michael S. Branicky, Jun 11 2021

Formula

a(n) ~ n. - Charles R Greathouse IV, Jan 30 2014

A227510 Numbers such that product of digits of n is positive and a substring of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 31, 41, 51, 61, 71, 81, 91, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 126, 131, 141, 151, 153, 161, 171, 181, 191, 211, 236, 243, 311, 315, 324, 362, 411, 511, 611, 612
Offset: 1

Views

Author

Jayanta Basu, Jul 14 2013

Keywords

Comments

All numbers with at least one zero digit have a product of digits which is a substring; these have been kept out by the restriction on positivity.
The sequence is infinite: if n is a term 10n+1 is also a term. Are there any other patterns (except for prepending 1 to any term)? - Zak Seidov, Jul 24 2013
You can also insert 1 in any position outside the substring that gives the product of digits. - Robert Israel, Aug 26 2014
See also A203566 for a nontrivial subsequence of A203565. The zeroless members of the latter differ from this sequence from 212 on which is there but not here, while 236 is the first here but not there. - M. F. Hasler, Oct 14 2014

Examples

			The product of the digits of 236 is 36, a substring of 236, and hence 236 is a member.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n)
      local L;
      L:= convert(n,base,10);
      if has(L,0) then return false fi;
      verify(convert(convert(L,`*`),base,10),L,'sublist');
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Aug 26 2014
  • Mathematica
    Select[Range[650], FreeQ[x = IntegerDigits[#], 0] && MemberQ[FromDigits /@ Partition[x, IntegerLength[y = Times @@ x], 1], y] &]
  • PARI
    {isok(n)=d=digits(n);p=prod(i=1,#d,d[i]);k=1;while(p&&k<=(#d-#digits(p)+1),v=[];for(j=k,k+#digits(p)-1,v=concat(v,d[j]));if(v==digits(p),return(1));k++);return(0);}
    n=1;while(n<10^4,if(isok(n),print1(n,", "));n++) \\ Derek Orr, Aug 26 2014
    
  • PARI
    is_A227510(n)={(t=digits(prod(i=1,#n=digits(n),n[i])))&&for(i=0,#n-#t,vecextract(n,2^(i+#t)-2^i)==t&&return(1))} \\ M. F. Hasler, Oct 14 2014
  • Python
    from operator import mul
    from functools import reduce
    A227510 = [int(n) for n in (str(x) for x in range(1, 10**5)) if not n.count('0') and str(reduce(mul, (int(d) for d in n))) in n]
    # Chai Wah Wu, Aug 26 2014
    

Extensions

Edited by M. F. Hasler, Oct 14 2014

A210014 Pandigital numbers (A050278) with each product of four adjacent digits visible as a substring of the digits.

Original entry on oeis.org

4327059168, 4613590728, 4613590872, 7860241359, 7860291354, 8490536127, 8760241359, 8760291354
Offset: 1

Views

Author

N. J. A. Sloane, Mar 16 2012

Keywords

Comments

Computed by Jean-Marc Falcoz.

Examples

			Example for 4327059168: 4*3*2*7= 168; 5*9*1*6=270; 9*1*6*8=432 are substrings.
		

Crossrefs

A generalization of A198298. Cf. A210013-A210020, A203569, A203566.

A210015 In base 4, numbers n which have 4 distinct digits, do not start with 0, and have property that the product (written in base 4) of any two adjacent digits is a substring of n.

Original entry on oeis.org

1203, 1230, 1302, 2013, 2031, 2103, 2130, 3012, 3021, 3102, 3120
Offset: 1

Views

Author

N. J. A. Sloane, Mar 16 2012

Keywords

Comments

Computed by Jean-Paul Davalan.
The analog in base 2 is 10; in base 3, 102,120,201,210.

Crossrefs

A generalization of A198298. Cf. A210013-A210020, A203569, A203566.

A210016 In base 5, numbers n which have 5 distinct digits, do not start with 0, and have property that the product (written in base 5) of any two adjacent digits is a substring of n.

Original entry on oeis.org

13024, 13042, 20314, 20413, 21304, 21403, 24013, 24130, 30214, 30412, 31204, 31402, 40213, 40312, 41203, 41302, 42013, 42130
Offset: 1

Views

Author

N. J. A. Sloane, Mar 16 2012

Keywords

Comments

Computed by Jean-Paul Davalan.
The analog in base 2 is 10; in base 3, 102,120,201,210.

Crossrefs

A generalization of A198298. Cf. A210013-A210020, A203569, A203566.
Showing 1-10 of 13 results. Next