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-4 of 4 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

A070327 Smallest nontrivial power of n starting with n and greater than n.

Original entry on oeis.org

256, 387420489, 4096, 59604644775390625, 60466176, 79792266297612001, 8589934592, 984770902183611232881, 100, 1191817653772720942460132761, 1283918464548864, 137858491849, 1475789056
Offset: 2

Views

Author

Amarnath Murthy, May 11 2002

Keywords

Comments

a(n) = n ^ A051248(n). - Reinhard Zumkeller, Sep 29 2011

Crossrefs

Programs

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

Formula

f[n_] := Block[{k = 2, s = ToString[n]}, While[ StringPosition[ ToString[n^k], s, 1] != {{1, Integer_}}, k++ ]; n^k]; Table[ f[n], {n, 2, 10}]

Extensions

Edited by Robert G. Wilson v, May 14 2002
The 15th term is too large to include.

A373337 Records in A045537.

Original entry on oeis.org

2, 5, 11, 14, 26, 28, 31, 50, 58, 59, 71, 72, 98, 107, 148, 166, 170, 172, 173, 211, 221, 223, 546, 549, 601, 616, 704, 716, 884, 1152, 1774, 1826, 1847, 1976, 1980, 2213, 2494, 3561, 4587, 4615, 4691, 5110, 5196, 5790, 5810, 6070, 6198, 6255, 6648, 6655, 6697
Offset: 1

Views

Author

Gonzalo Martínez, Jun 01 2024

Keywords

Comments

A045537(n) is the exponent of the least perfect power of n containing n as a substring. As n grows, larger integers are recorded.

Examples

			a(1) = A045537(0) = 2.
a(2) = A045537(2) = 5.
a(3) = A045537(11) = 11.
a(4) = A045537(12) = 14.
a(5) = A045537(15) = 26.
a(6) = A045537(102) = 28.
		

Crossrefs

Extensions

a(33)-a(37) from Michel Marcus, Jun 04 2024
a(38)-a(49) from Michael S. Branicky, Jun 05 2024
a(50)-a(51) from Jinyuan Wang, Jun 17 2025
Showing 1-4 of 4 results.