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

A239134 Smallest k such that n^k contains k as a substring in its decimal representation.

Original entry on oeis.org

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

Views

Author

Derek Orr, Mar 10 2014

Keywords

Comments

It seems very likely a(n) < 10 for all n (even stronger, a(n) < 9 for all n).
It also seems very likely a(n) = {1,2,3} for sufficiently large n.
Counterexample: a(10^d - 2) = 6 for d >= 2. - Robert Israel, Sep 16 2024

Examples

			5^1 = 5 does not contain a 1 but 5^2 = 25 does contain a 2 so a(5) = 2.
7^1 = 7 does not contain a 1, 7^2 = 49 does not contain a 2, but 7^3 = 343 does contain a 3 so a(7) = 3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
      for k from 1 to 9 do
        if member(k,convert(n^k,base,10)) then return k fi
      od;
      FAIL
    end proc:
    map(f, [$1..100]); # Robert Israel, Sep 16 2024
  • Mathematica
    a[n_] := Block[{k=1}, While[{} == StringPosition[ ToString[n^k], ToString[k]], k++]; k]; Array[a, 84] (* Giovanni Resta, Mar 11 2014 *)
    sk[n_]:=Module[{k=1},While[SequenceCount[IntegerDigits[n^k],IntegerDigits[k]] == 0,k++];k]; Array[sk,90] (* Harvey P. Dale, May 12 2022 *)
  • Python
    def Sub(x):
      for n in range(10**3):
        if str(x**n).find(str(n)) > -1:
          return n
    x = 1
    while x < 10**3:
      print(Sub(x))
      x += 1

Formula

a(A011531(k))=1, any k.
a(10*n) = a(n) if a(n) < 10. - Robert Israel, Sep 16 2024

A277079 Least number k for which k^n contains n as a substring and n^k contains k as a substring.

Original entry on oeis.org

1, 35, 7, 61, 5, 6, 3, 7, 5, 10, 11, 15, 6, 36, 7, 16, 17, 33, 16, 44, 6, 48, 36, 3, 5, 9, 31, 8, 32, 69, 8, 5, 8, 5, 2, 2, 9, 8, 6, 6, 5, 8, 7, 6, 6, 9, 8, 6, 2, 7, 2, 8, 6, 5, 5, 5, 3, 8, 9, 6, 4, 3, 6, 6, 6, 25, 5, 6, 3, 6, 3, 3, 2, 6, 5, 6, 3, 7, 8, 7, 4, 2
Offset: 1

Views

Author

Paolo P. Lava, Sep 28 2016

Keywords

Comments

a(n) = n for 1, 5, 6, 10, 11, 16, 17.
Records for a(1) = 1, a(2) = 35, a(4) = 61, a(30) = 69, a(1061) = 84, a(1256) = 91, ...

Examples

			2^35 = 34359738368 and 35 is a substring;
35^2 = 1225 and 2 is a substring.
		

Crossrefs

Cf. A061280.

Programs

  • Maple
    P:=proc(q) local a,b,j,k,n,ok; for n from 1 to q do a:=convert(n,string); ok:=1; for k from 1 to q do if ok=1 then if searchtext(a,convert(k^n,string))>0 then b:=convert(k,string);
    for j from 1 to q do if searchtext(b,convert(n^k,string))>0 then print(k); ok:=0; break; fi; od; fi; fi; od; od; end: P(10^3);
  • Mathematica
    Table[k = 1; While[Or[Length@ SequencePosition[IntegerDigits[k^n], IntegerDigits[n]] == 0, Length@ SequencePosition[IntegerDigits[n^k], IntegerDigits[k]] == 0], k++]; k, {n, 120}] (* Michael De Vlieger, Sep 28 2016, Version 10.1 *)
Showing 1-2 of 2 results.