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.

Previous Showing 11-13 of 13 results.

A175394 Least nontrivial exponent e > 2 such that n^2 is a substring of n^e (n >= 0).

Original entry on oeis.org

3, 3, 6, 6, 7, 3, 7, 6, 22, 11, 3, 13, 26, 54, 123, 27, 27, 40, 100, 43, 6, 43, 54, 42, 12, 3, 37, 43, 9, 37, 6, 19, 102, 102, 43, 96, 83, 45, 67, 34, 12, 128, 168, 102, 182, 44, 152, 104, 184, 52, 3, 17, 35, 75, 164, 67, 127, 22, 134, 98, 7, 124, 117, 146, 77, 146, 156, 87
Offset: 0

Views

Author

Zak Seidov, Apr 29 2010

Keywords

Examples

			a(2)=6 because 2^2=4 is a substring of 2^6=64
a(4)=7 because 4^2=16 is a substring of 4^7=16384.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local pat,e;
      pat:= sprintf("%d",n^2);
      for e from 3 do if StringTools:-Search(pat, sprintf("%d",n^e))<> 0 then return e fi od:
    end proc:
    map(f, [$0..100]); # Robert Israel, Mar 20 2018
  • Mathematica
    lne[n_]:=Module[{e=3,idn2=IntegerDigits[n^2]},While[!MemberQ[ Partition[ IntegerDigits[n^e], Length[ idn2],1],idn2],e++];e]; Array[lne,70,0] (* Harvey P. Dale, Aug 17 2013 *)

A226219 Least k > 1 not a power of 10 such that n is a substring of k*n.

Original entry on oeis.org

2, 11, 6, 11, 6, 3, 6, 11, 6, 11, 11, 101, 26, 87, 51, 21, 26, 69, 51, 63, 6, 58, 51, 97, 26, 5, 51, 101, 26, 79, 11, 101, 26, 101, 51, 21, 26, 101, 51, 87, 6, 59, 34, 101, 26, 21, 51, 74, 26, 51, 3, 69, 26, 29, 51, 21, 26, 101, 51, 27, 6, 92, 51, 26, 26, 21
Offset: 0

Views

Author

Paul Tek, May 31 2013

Keywords

Crossrefs

Cf. A045537.

Programs

  • Haskell
    import Data.List (isInfixOf, isPrefixOf)
    a226219 n = head [k | k <- [2..],
                          isInfixOf (show n) (show (k*n)), not $ p10 k]
       where p10 = flip isPrefixOf ('1' : repeat '0') . show  :: Int -> Bool
    -- Reinhard Zumkeller, May 31 2013
  • Mathematica
    Table[k = 2; While[IntegerQ[Log[10, k]] || StringPosition[ToString[k*n], ToString[n], 1] == {}, k++]; k, {n, 0, 100}] (* T. D. Noe, May 31 2013 *)
  • Perl
    sub a {
        my $n = shift;
        my $k = 2;
        while (1) {
            if ($k !~ /^10+$/) {
                if (index($k*$n, $n)>=0) {
                    return $k;
                }
            }
            $k++;
        }
    }
    

Formula

a(n) <= 10^A055642(n)+1.

A343594 Numbers k that, when written in all bases from base 2 to base 10, are a substring of k^k when written in the same base.

Original entry on oeis.org

1, 5, 17, 25, 31, 41, 63, 92, 151, 170, 202, 221, 263, 266, 278, 322, 327, 347, 364, 401, 404, 412, 421, 423, 437, 467, 470, 482, 490, 498, 501, 515, 519, 543, 558, 578, 590, 612, 623, 636, 646, 647, 671, 683, 685, 705, 707, 717, 718, 726, 764, 785, 795, 859, 867, 872, 875, 881, 890, 892, 897
Offset: 1

Views

Author

Scott R. Shannon, Apr 21 2021

Keywords

Examples

			5 is a term. See below table:
.
   base  |  5 in base  |  5^5 in base
---------+-------------+-------------
    10          5                3125
     9          5                4252
     8          5                6065
     7          5               12053
     6          5               22245
     5         10              100000
     4         11              300311
     3         12            11021202
     2        101        110000110101
.
5^5 in all bases contains 5 in that base as a substring.
		

Crossrefs

Programs

  • PARI
    str(v) = my(s=""); for (k=1, #v, s = concat(s, Str(v[k]))); s;
    isok(k) = {for (b=2, 10, my(kb = digits(k, b), kkb = digits(k^k, b)); if (#strsplit(str(kkb), str(kb)) <=1 , return (0));); return (1);} \\ Michel Marcus, Apr 26 2021
  • Python
    from sympy.ntheory import digits
    def nstr(n, b): return "".join(map(str, digits(n, b=b)[1:]))
    def ok(k): return all(nstr(k, b) in nstr(k**k, b) for b in range(10, 1, -1))
    print(list(filter(ok, range(900)))) # Michael S. Branicky, Apr 25 2021
    
Previous Showing 11-13 of 13 results.