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

A241176 Numbers n such that there is exactly one number m with m + (some digit of m) = n.

Original entry on oeis.org

0, 2, 4, 6, 8, 11, 13, 15, 17, 19, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 89, 91, 93, 95, 97, 99, 111, 113, 115, 117, 119, 121, 143, 165, 187, 221, 223, 225, 227, 229, 231, 243, 265, 287, 321, 333, 335, 337, 339, 341, 343, 365, 387, 421
Offset: 1

Views

Author

N. J. A. Sloane, Apr 23 2014

Keywords

Examples

			Since 10 = 5+5 = 10+0, there are two possibilities of writing 10 in the given way, therefore 10 is not in this list.
For numbers in A241175 = {1, 3, 5, 7, 9, 21, 43, 65, 87}, there is NO way of writing them in the given form, therefore they are not in this list.
		

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Apr 20 2014

Crossrefs

Programs

  • Maple
    See A241177.
  • Mathematica
    A241176[n_] := Module[{m, c = 0},
       Do[c = c + Count[m + Union[IntegerDigits[m]], n], {m, 0, n}]; c];
    Select[Range[0, 421], A241176[#] == 1 &] (* Robert Price, Mar 20 2019 *)
  • PARI
    is(n)={sum(i=0, min(n, 9), setsearch(Set(digits(n-i)), i)>0)==1||n==0} \\ M. F. Hasler, Apr 26 2014

Extensions

Example corrected by M. F. Hasler, Apr 26 2014

A241177 Numbers n such that there are exactly two numbers m with m + (some digit of m) = n.

Original entry on oeis.org

10, 12, 24, 32, 36, 48, 54, 60, 72, 76, 84, 96, 98, 109, 112, 123, 125, 127, 129, 131, 132, 133, 135, 137, 139, 141, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 167, 169, 171, 172, 173, 175, 177, 179, 181, 183, 185, 189, 191, 193, 195, 197, 199, 201, 209, 211, 213, 215, 217, 219, 224, 233, 235, 237, 239, 241, 245
Offset: 1

Views

Author

N. J. A. Sloane, Apr 23 2014

Keywords

Comments

The numbers 12, 112, 1112, ..., 111...112, ... are terms of the sequence. - Marius A. Burtea, Feb 18 2020

Examples

			12 = 6 + 6 = 11 + 1.
32 = 26 + 6 = 31 + 1.
112 = 106 + 6 = 111 + 1.
		

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Apr 20 2014.

Crossrefs

Programs

  • Magma
    f:=func; [k:k in [1..250]| #[m:m in [1..k]| f(k,m)] eq 2]; // Marius A. Burtea, Feb 18 2020
  • Maple
    M:=2000;
    M2:=M+10;
    A:=Array[0..M2];
    for n from 0 to M2 do A[n]:=0; od:
    for n from 0 to M do
    t1:=convert(n,base,10);
    t2:=convert(t1,set); t3:=convert(t2,list);
    for i from 1 to nops(t3) do A[n+t3[i]]:= A[n+t3[i]]+1; od:
                      od:
    ans:=[];
    for n from 0 to M do if A[n]=2 then ans:=[op(ans),n]; fi; od:
    [seq(ans[i],i=1..nops(ans))];
  • Mathematica
    A241177[n_] := Module[{m, c = 0},
       Do[c = c + Count[m + Union[IntegerDigits[m]], n], {m, 0, n}]; c];
    Select[Range[0, 245], A241177[#] == 2 &] (* Robert Price, Mar 20 2019 *)
  • PARI
    upto(n) = {my(v = vector(n + 9)); for(i = 1, n, d = Set(digits(i)); for(j = 1, #d, v[i + d[j]]++ ) ); for(i = n + 1, n + 9, v[i] = 0); select(x -> x == 2, v, 1) } \\ David A. Corneth, Mar 20 2019
    

A241178 Numbers n such that there are exactly three numbers m with m + (some digit of m) = n.

Original entry on oeis.org

14, 16, 18, 20, 22, 26, 28, 30, 34, 38, 40, 42, 44, 46, 50, 52, 56, 58, 62, 64, 66, 68, 70, 74, 78, 80, 82, 86, 88, 90, 92, 94, 100, 101, 103, 105, 107, 110, 114, 116, 118, 120, 122, 124, 136, 142, 148, 152, 154, 160, 162, 176, 182, 184, 192, 196, 198, 203, 205, 207, 210, 212, 214, 222, 226, 228, 230, 232, 234, 236
Offset: 1

Views

Author

N. J. A. Sloane, Apr 23 2014

Keywords

Comments

The numbers 14, 114, 1114, ..., 111...114, ... are terms of the sequence. - Marius A. Burtea, Feb 18 2020

Examples

			14 = 7 + 7 = 12 + 2 = 13 + 1.
28 = 19 + 9 = 24 + 4 = 26 + 2.
		

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Apr 20 2014.

Crossrefs

Programs

  • Magma
    f:=func; [k:k in [11..236]| #[m:m in [1..k]| f(k,m)] eq 3]; // Marius A. Burtea, Feb 18 2020
  • Maple
    See A241177.
  • Mathematica
    A241178[n_] := Module[{m, c = 0},
       Do[c = c + Count[m + Union[IntegerDigits[m]], n], {m, 0, n}]; c];
    Select[Range[0, 236], A241178[#] == 3 &] (* Robert Price, Mar 20 2019 *)

A241179 Numbers n such that there are exactly four numbers m with m + (some digit of m) = n.

Original entry on oeis.org

102, 108, 126, 128, 130, 134, 138, 140, 144, 146, 150, 156, 158, 164, 166, 168, 170, 174, 178, 180, 186, 188, 190, 194, 200, 204, 208, 216, 218, 220, 238, 240, 242, 246, 250, 252, 256, 258, 262, 266, 268, 270, 278, 280, 282, 286, 288, 290, 292, 300, 302, 306, 308, 314, 318, 320, 322, 328, 330, 344, 350, 352, 358, 362
Offset: 1

Views

Author

N. J. A. Sloane, Apr 23 2014

Keywords

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Apr 20 2014

Crossrefs

Programs

  • Maple
    See A241177.
  • Mathematica
    A241179[n_] := Module[{m, c = 0},
       Do[c = c + Count[m + Union[IntegerDigits[m]], n], {m, 0, n}]; c];
    Select[Range[0, 362], A241179[#] == 4 &] (* Robert Price, Mar 20 2019 *)

A241180 Start with n; add to it any of its digits; repeat; a(n) = minimal number of steps needed to reach a prime greater than n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Apr 23 2014

Keywords

Comments

Is it a theorem that a(n) aways exists?
Yes: as long as nonzero digits are used, eventually you reach a number x starting with 10, large enough that there is a prime between x and 3*x/2. All the numbers from x to 3*x/2 start with 1, so if you use the digit 1 you will eventually reach a prime. - Robert Israel, Mar 17 2019
A variant of this (A241181) sets a(n) = 0 if n is already a prime.

Examples

			Examples, in condensed notation:
1+1=2
2+2=4+4=8+8=16+1=17
3+3=6+6=12+1=13
4+4=8+8=16+1=17
5+5=10+1=11
6+6=12+1=13
7+7=14+4=18+1=19
8+8=16+1=17
9+9=18+1=19
10+1=11
11+1=12+1=13
12+1=13
13+3=16+1=17
14+4=18+1=19
15+1=16+1=17
16+1=17
17+1=18+1=19
18+1=19
19+9=28+8=36+3=39+9=48+8=56+5=61
20+2=22+2=24+2=26+6=32+2=34+3=37
...
		

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Apr 20 2014

Crossrefs

Programs

  • Maple
    g:= proc(n,Nmax) option remember; local L,d,t;
      if isprime(n) then return 0 fi;
      if n > Nmax then return infinity fi;
      L:= convert(convert(n,base,10),set) minus {0};
      1 + min(seq(procname(n+d),d=L));
    end proc:
    f:= proc(n,Nmax) local L,d,t;
      L:= convert(convert(n,base,10),set) minus {0};
      1 + min(seq(g(n+d, Nmax),d=L))
    end proc:
    map(f, [$1..200], 1000); # Robert Israel, Mar 17 2019
  • Mathematica
    A241180[n_] := Module[{c, nx},
       c = 1; nx = n;
       While[ !
         AnyTrue[nx = Flatten[nx + IntegerDigits[nx]],
          PrimeQ [#] && # > n &], c++];
       Return[c]];
    Table[A241180[i], {i, 100}] (* Robert Price, Mar 17 2019 *)

Extensions

a(23)-a(87) from Hiroaki Yamanouchi, Sep 05 2014

A241181 Start with n; add to it any of its digits; repeat; a(n) = minimal number of steps needed to reach a prime.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Apr 23 2014

Keywords

Comments

a(n) = 0 iff n is a prime.
Is it a theorem that a(n) always exists?
Yes: the proof is similar to that of Robert Israel for A241180. - Rémy Sigrist, Jul 25 2020

Examples

			Examples, in condensed notation:
1+1=2
2
3
4+4=8+8=16+1=17
5
6+6=12+1=13
7
8+8=16+1=17
9+9=18+1=19
10+1=11
11
12+1=13
13
14+4=18+1=19
15+1=16+1=17
16+1=17
17
18+1=19
19
20+2=22+2=24+2=26+6=32+2=34+3=37
...
		

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Apr 20 2014

Crossrefs

Programs

  • Mathematica
    A241181[n_] := Module[{c, nx},
       If[PrimeQ[n], Return[0]];
       c = 1; nx = n;
       While[ ! AnyTrue[nx = Flatten[nx + IntegerDigits[nx]], PrimeQ], c++];
       Return[c]];
    Table[A241181[i], {i, 100}] (* Robert Price, Mar 17 2019 *)

Extensions

a(23)-a(87) from Hiroaki Yamanouchi, Sep 05 2014

A241182 Smallest number requiring n steps to reach a prime under the "add a digit" process described in A241180.

Original entry on oeis.org

1, 5, 3, 2, 22, 19, 4020, 4280, 22198, 22194, 22193, 31400, 221101, 360648, 370260, 604062, 604060, 1357201, 2010734, 2010733, 4652353, 4652352, 17051708, 17051707, 20831329, 20831323, 47326699, 47326692, 123346277, 256526120, 428045488, 436273045, 436273038
Offset: 1

Views

Author

N. J. A. Sloane, Apr 23 2014

Keywords

Comments

The analogous sequence corresponding to A241181 is A336382. - Rémy Sigrist, Jul 25 2020

Crossrefs

Programs

  • Mathematica
    A241180[n_] := Module[{c, nx},
       c = 1; nx = n;
       While[ !
         AnyTrue[nx = Union[Flatten[nx + IntegerDigits[nx]]],
          PrimeQ [#] && # > n &], c++];
       Return[c]];
    A241182[n_] := Module[{i = 1},
       While[A241180[i] != n, i++];
       Return[i]];
    Table[A241182[i], {i, 8}] (* Robert Price, Mar 18 2019 *)

Extensions

a(5) corrected and a(6)-a(30) added by Hiroaki Yamanouchi, Sep 05 2014
More terms from Rémy Sigrist, Jul 26 2020

A241173 Start with n; add to it any of its digits; repeat; a(n) = minimal number of steps needed to reach a palindrome.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Apr 23 2014

Keywords

Comments

a(n) = 0 iff n is already a palindrome (A002113).
Is it a theorem that a(n) always exists?
a(n) always exists. Proof: A palindrome can be reached by simply adding the initial digit until a palindrome with the same number of digits as the initial number is reached: If no palindrome is reached by then, this will yield a number with initial digit '1'. Thereafter, this procedure will yield the next larger palindrome - either not larger than 19...91 or, after 19...9 + 1 = 20...0, at 20...02. - M. F. Hasler, Apr 26 2014

Examples

			Examples for a(10) through a(23):
a(10) = 1 via 10 -> 11
a(11) = 0 via 11
a(12) = 3 via 12 -> 13 -> 16 -> 22
a(13) = 2 via 13 -> 16 -> 22
a(14) = 3 via 14 -> 15 -> 16 -> 22
a(15) = 2 via 15 -> 16 -> 22
a(16) = 1 via 16 -> 22
a(17) = 4 via 17 -> 18 -> 19 -> 20 -> 22
a(18) = 3 via 18 -> 19 -> 20 -> 22
a(19) = 2 via 19 -> 20 -> 22
a(20) = 1 via 20 -> 22
a(21) = 1 via 21 -> 22
a(22) = 0 via 22
a(23) = 3 via 23 -> 25 -> 30 -> 33
		

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Apr 20 2014

Crossrefs

Cf. A002113.
A241174 gives the smallest number that takes n steps to reach a palindrome.

Programs

  • Mathematica
    A241173[n_] := Module[{c, nx},
       If[n == IntegerReverse[n], Return[0]];
       c = 1; nx = n;
       While[ ! AnyTrue[nx = Flatten[nx + IntegerDigits[nx]], # == IntegerReverse[#] &], c++];
       Return[c]];
    Table[A241173[i], {i, 0, 100}] (* Robert Price, Mar 17 2019 *)
  • PARI
    a(n,m=0)={ if( m, my(d); for(i=1,#d=vecsort(digits(n),,12), d[i] && if( m>1, a(n+d[i],m-1) /*&& !print1("/*",[n,d[i],m],"* /")*/, is_A002113(n+d[i])) && return(m)), is_A002113(n) || until(a(n,m++),); m)} \\ Memoization should be implemented to improve performance which remains poor esp. for terms just above 10^k+1. - M. F. Hasler, Apr 26 2014
    
  • PARI
    \\ See Corneth link; faster than above. David A. Corneth, Mar 21 2019

Extensions

More terms from M. F. Hasler, Apr 26 2014

A241174 Smallest number requiring n steps to reach a palindrome under the "add a digit" process described in A241173.

Original entry on oeis.org

0, 10, 13, 12, 17, 89, 1072, 1066, 1058, 1049, 1045, 1039, 1036, 1028, 1019, 1017, 1009, 1007, 998, 994, 988, 100953, 100944, 100935, 100926, 100917, 100908, 100899, 100890, 100882, 100874, 100866, 100858, 100849, 100841, 100833, 100825, 100817, 100809, 100801, 100792, 100784, 100777
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2014

Keywords

Comments

Beginning with a(6), the palindromic sinks appear to be, for positive n, (10^n+1)*(10^(n+1)+1):
n=1 a(6)-a(20) 1072 to 988
n=2 a(21)-a(157) 100953 to 99980
n=3 a(158)-a(1461) 10^7+9827 to 10^7-20
n=4 a(1462)-a(14078) 10^9+98720 to 10^9-20
n=5 a(14079)-a(137233) 10^11+988091 to 10^11-20
n=6 a(137234)-a(1346435) 10^13+9885167 to 10^13-20
n=7 a(1346436)-a(13265907) 10^15+98879696 to 10^15-20
etc. - Hans Havermann, Apr 23 2014

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Apr 20 2014

Crossrefs

Programs

  • Mathematica
    A241173[n_] := Module[{c, nx},
       If[n == IntegerReverse[n], Return[0]];
       c = 1; nx = n;
       While[ ! AnyTrue[nx = Union[Flatten[nx + IntegerDigits[nx]]], # == IntegerReverse[#] &], c++];
       Return[c]];
    A241174[n_] := Module[{i = 0},
       While[A241173[i] != n, i++];
       Return[i]];
    Table[A241174[i], {i, 0, 5}] (* Robert Price, Mar 17 2019 *)

Extensions

More terms from Hans Havermann, Apr 23 2014

A241183 Start with n; add to it any of its digits; repeat; a(n) = minimal number of steps needed to reach 2n, or -1 if 2n cannot be reached.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 4, 3, 3, 5, 4, 4, 3, 7, 6, 5, 5, 5, 4, 5, 5, 5, 4, 5, 7, 6, 6, 7, 6, 6, 7, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, -1, 8, 8, 8, 7, 8, 8, 8, 8, 8, 10, 9, 9, 9, 10, 11, 10, 10, 10, 11, 12, 11, 12, 12, 11, 12, 12, 14, 12, 13, 15, 12, 13, 14, 14, 14, 14, 14, 15, 14, 14, 16, 16, 16, 15, 15, 17, 16, 15, 15, 18
Offset: 1

Views

Author

N. J. A. Sloane, Apr 23 2014

Keywords

Comments

Is it a theorem that a(n) always exists?
Does any number take two steps to reach 2n by the shortest path? If the answer is yes, we should add the sequence of the smallest numbers that take n steps to go from k to 2k.
If the answer is no, then the sequence of the smallest numbers that take at least n steps to go from k to 2k.
There cannot be a 2 in this list. The maximum possible increase in two steps is 18 (2 nines) so no number larger than 18 can be doubled in 2 steps by digit addition. Since the minimum number of steps have been found through 18, and since none of them required exactly 2 steps, then there can be no 2s in this sequence. - David Consiglio, Jr., May 12 2014
a(50) does not exist. - Hiroaki Yamanouchi, Sep 05 2014
Except for n=50, 2n can be reached from all n<=10000. - Robert Price, Mar 20 2019

Examples

			Examples (in condensed notation):
1+1=2
2+2=4
...
9+9=18
10+1=11+1=12+2=14+1=15+5=20
11+1=12+1=13+3=16+6=22
12+1=13+3=16+1=17+7=24
13+1=14+4=18+8=26
14+4=18+8=26+2=28
15+5=20+2=22+2=24+4=28+2=30
15+1=16+6=22+2=24...
15+1=16+1=17+7=24...
16+6=22+2=24+2=26+6=32
17+1=18+8=26+6=32+2=34
18+8=26+2=28+8=36
19+1=20+2=22+2=24+2=26+6=32+2=34+4=38
20+2=22+2=24+2=26+6=32+3=35+5=40
...
		

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Apr 20 2014.

Crossrefs

Programs

  • Mathematica
    A241183[n_] := Module[{c=1, nx=n},
       While[ ! AnyTrue[nx =
           Union[Flatten[nx + IntegerDigits[nx]]], # == 2 n &], c++];
       Return[c]];
    Join[Table[A241183[i], {i, 49}], -1, Table[A241183[i], {i, 51, 100}]] (* Robert Price, Mar 18 2019 *)
    (* The following is a program to detect any n that cannot reach 2n *)
    f[n_] := Module[{n2 = 2 n, totest = {2 n}, i},
       While[Length[totest] > 0,
        x = First[totest]; totest = Rest[totest];
        For[i = 1, i <= 9, i++,
         If[MemberQ[IntegerDigits[x - i], i],
          If[! MemberQ[totest, x - i], AppendTo[totest, x - i]]] ];
        If[MemberQ[totest, n], Return[False]]]; Return[True]];
    Select[Range[100], f[#] &] (* Robert Price, Mar 20 2019 *)

Extensions

a(11) corrected (was 5 should be 4) by David Consiglio, Jr., May 12 2014
a(11) corrected in example by David Consiglio, Jr., May 20 2014
a(13) corrected (including the example) and a(23)-a(49) from Hiroaki Yamanouchi, Sep 05 2014
Escape clause added to definition at the suggestion of Robert Price. - N. J. A. Sloane, Mar 18 2019
a(50)-a(100) from Robert Price, Mar 18 2019
Showing 1-10 of 12 results. Next