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

A045537 Least nontrivial exponent e such that n is a substring of n^e.

Original entry on oeis.org

2, 2, 5, 5, 3, 2, 2, 5, 5, 3, 2, 11, 14, 10, 8, 26, 6, 17, 5, 11, 5, 6, 10, 15, 3, 2, 19, 15, 7, 8, 5, 11, 3, 14, 14, 10, 6, 10, 6, 11, 3, 6, 18, 5, 11, 5, 18, 9, 5, 3, 2, 3, 7, 16, 17, 11, 3, 5, 9, 11, 2, 6, 7, 7, 11, 17, 15, 8, 5, 11, 5, 9, 8, 5, 8, 3, 2, 16, 21, 11, 5, 6, 14, 4, 11, 22, 22, 7
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (isInfixOf)
    a045537 n = 2 + length
       (takeWhile (not . ((show n) `isInfixOf`) . show) $ iterate (* n) (n^2))
    -- Reinhard Zumkeller, Sep 29 2011
    
  • Mathematica
    f[n_] := Block[{k = 2}, While[ StringPosition[ ToString[n^k], ToString[n]] == {}, k++ ]; k]; Table[ f[n], {n, 0, 87}] (* Robert G. Wilson v, May 09 2005 *)
  • PARI
    a(n) = my(s = Str(n), k=2); while (#strsplit(Str(n^k), s) == 1, k++); k; \\ Michel Marcus, Jun 04 2024
    
  • Python
    from itertools import count
    def a(n):
        s = str(n)
        return next(e for e in count(2) if s in str(n**e))
    print([a(n) for n in range(88)]) # Michael S. Branicky, Feb 23 2025

Formula

n^a(n) = A104782(n).

A051248 n^a(n) is the smallest power of n (with a(n) > 1) which starts with n.

Original entry on oeis.org

2, 8, 18, 6, 24, 10, 20, 11, 22, 2, 26, 14, 10, 8, 92, 6, 166, 5, 19, 11, 60, 39, 48, 51, 94, 42, 467, 86, 14, 66, 58, 3, 5268, 33, 58, 10, 45, 70, 23, 6, 205, 70, 31, 15, 50, 84, 248, 70, 72, 94, 107, 170, 30, 10139, 182, 136, 87, 318, 49, 10, 178, 237, 295, 99, 17, 206
Offset: 1

Views

Author

Keywords

Comments

A070327(n) = n^a(n) for n > 1. - Reinhard Zumkeller, Sep 29 2011
The largest of the first 10000 terms is a(1955) = 119589011. - Giovanni Resta, May 27 2016

Examples

			2^8 = 256 begins with 2, and 2^k does not begin with 2 for any smaller integer k > 1, so a(2) = 8.
		

Crossrefs

Programs

  • Haskell
    import Data.List (isPrefixOf)
    a051248 n = 2 + length
       (takeWhile (not . (show n `isPrefixOf`) . show) $ iterate (* n) (n^2))
    -- Reinhard Zumkeller, Sep 29 2011
    
  • Mathematica
    f[n_]:=Module[{i=2},While[Take[IntegerDigits[n^i],IntegerLength[n]] != IntegerDigits[n],i++];i]; Array[f,70] (* Harvey P. Dale, Oct 04 2011 *)
  • Python
    from itertools import count
    def a(n):
        s = str(n)
        return next(e for e in count(2) if str(n**e).startswith(s))
    print([a(n) for n in range(1, 33)]) # Michael S. Branicky, Feb 23 2025

Extensions

More terms from Jud McCranie

A104782 Smallest n^e (e>1) containing n in decimal representation.

Original entry on oeis.org

1, 32, 243, 64, 25, 36, 16807, 32768, 729, 100, 285311670611, 1283918464548864, 137858491849, 1475789056, 3787675244106352329254150390625, 16777216, 827240261886336764177, 1889568, 116490258898219, 3200000, 85766121
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 25 2005

Keywords

Comments

a(n) = n^A045537(n).

Crossrefs

Programs

  • Python
    from itertools import count
    def a(n):
        s = str(n)
        return next(n**e for e in count(2) if s in str(n**e))
    print([a(n) for n in range(1, 22)]) # Michael S. Branicky, Feb 23 2025
Showing 1-3 of 3 results.