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

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).

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

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.

A073601 Least k>1 such that n^k and n have equal leading decimal digits.

Original entry on oeis.org

2, 8, 18, 6, 24, 10, 20, 11, 22, 2, 2, 2, 2, 2, 6, 5, 5, 4, 4, 8, 20, 4, 4, 9, 6, 8, 8, 3, 3, 18, 48, 3, 3, 3, 12, 10, 8, 6, 6, 6, 6, 9, 20, 15, 4, 4, 4, 20, 14, 24, 18, 8, 19, 16, 5, 5, 34, 18, 10, 10, 15, 25, 6, 6, 17, 12, 7, 7, 26, 20, 21, 8, 23, 24, 9, 18, 10, 29
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 04 2002

Keywords

Comments

A073600(n) = n^a(n);
A000030(n^a(n)) = A000030(n).

Examples

			a(4)=6, as 4^6=4096=A073600(4) is the least power of 4 with initial digit =4: 4^2=16, 4^3=64, 4^4=256 and 4^5=1024.
		

Crossrefs

Cf. A051248.

Programs

  • Haskell
    a073601 n = 2 + length
       (takeWhile ((a000030 n /=) . a000030) $ iterate (* n) (n^2))
    -- Reinhard Zumkeller, Sep 27 2011
  • Mathematica
    fi[n_] := First[IntegerDigits[n]]; Table[k = 2; While[fi[n^k] != fi[n], k++]; k, {n, 78}] (* Jayanta Basu, Jul 02 2013 *)

A068001 Smallest number whose n-th power (A067457) starts with n.

Original entry on oeis.org

1, 5, 7, 8, 9, 2, 5, 13, 46, 2, 19, 15, 6, 74, 12, 58, 4, 8, 5, 52, 6, 128, 85, 53, 15, 61, 113, 17, 55, 52, 83, 47, 147, 43, 297, 238, 63, 117, 51, 49, 145, 98, 219, 109, 48, 38, 114, 283, 423, 226, 334, 168, 38, 87, 91, 58, 189, 166, 42, 222, 92, 59, 133, 86, 544, 264, 5
Offset: 1

Views

Author

Robert G. Wilson v, Feb 08 2002

Keywords

Examples

			a(3) = 7 because 7^3 = 343 which starts with 3 and there is no number less than 7 with this property.
		

Crossrefs

Programs

  • Mathematica
    Do[k = Floor[ Log[ 10, n] + 1]; While[ FromDigits[ Take[ IntegerDigits [k^n], Floor[ Log[ 10, n] + 1]]] != n, k++ ]; Print[k^n], {n, 1, 100} ]

A177047 Least k>1 such that n^k starts with n in base 2.

Original entry on oeis.org

2, 2, 3, 2, 8, 3, 6, 2, 7, 20, 12, 8, 4, 6, 11, 2, 13, 7, 86, 26, 19, 12, 3, 13, 15, 11, 5, 6, 8, 22, 22, 2, 24, 24, 9, 7, 25, 106, 348, 29, 15, 24, 55, 25, 60, 87, 93, 13, 84, 15, 4, 11, 12, 5, 33, 58, 324, 8, 18, 33, 44, 66, 45, 2, 46, 24, 92, 24, 38, 32, 128, 7, 59, 44, 36, 114, 16, 404
Offset: 1

Views

Author

Vladimir Reshetnikov, May 01 2010

Keywords

Comments

a(639) > 10^5. - Seiichi Manyama, Dec 22 2019

Crossrefs

Programs

  • Haskell
    toBinary 0 = []
    toBinary n = toBinary (n `div` 2) ++ [odd n]
    a = [2 + fromJust (findIndex (isPrefixOf (toBinary n)) [toBinary (n ^ k) | k <- [2..]]) | n <- [1..]]
    
  • Mathematica
    a[n_] := For[k = 2, True, k++, If[ MatchQ[ IntegerDigits[n^k, 2], {Sequence @@ IntegerDigits[n, 2], _}], Return[k]]]; a /@ Range[59] (* Jean-François Alcover, Jun 05 2013 *)
  • PARI
    a(n)=my(b=binary(n),k=1);while(binary(n^k++)[1..#b]!=b,);k \\ Charles R Greathouse IV, Jun 06 2013

Extensions

More terms from Seiichi Manyama, Dec 22 2019

A273007 a(n) is the smallest exponent > 1 such that p^a(n) ends with p, where p is the n-th prime.

Original entry on oeis.org

5, 5, 2, 5, 11, 21, 21, 11, 21, 11, 11, 21, 6, 5, 21, 21, 11, 6, 21, 11, 21, 11, 21, 11, 21, 11, 101, 21, 51, 101, 101, 51, 101, 51, 11, 11, 21, 101, 101, 101, 51, 51, 51, 5, 101, 11, 51, 101, 101, 51, 101, 51, 26, 3, 21, 101, 51, 51, 101, 26, 101, 21, 5, 51
Offset: 1

Views

Author

Paolo P. Lava, May 24 2016

Keywords

Examples

			2^2 = 4, 2^3 = 8, 2^4 = 16, 2^5 = 32;
3^2 = 9, 3^3 = 27, 3^4 = 81, 3^5 = 243.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local d,k,n; for n from 1 to q do if isprime(n) then d:=ilog10(n)+1;
    for k from 2 to q do if n=(n^k mod 10^d) then print(k); break; fi; od; fi; od; end: P(10^3);
  • Mathematica
    Table[Length[NestWhileList[p #&,p^2,Mod[#,10^IntegerLength[p]]!=p&]]+1,{p,Prime[ Range[65]]}] (* Harvey P. Dale, Jul 25 2019 *)

A273527 a(n) is the smallest exponent > 1 such that p^a(n) begins with p, where p is the n-th prime.

Original entry on oeis.org

8, 18, 24, 20, 26, 10, 166, 19, 48, 14, 58, 45, 205, 31, 248, 30, 49, 178, 3054, 122, 140, 294, 174, 80, 152, 233, 79, 920, 295, 359, 107, 308, 257, 8, 180, 96, 98, 34, 230, 921, 527, 164, 428, 901, 344, 88, 627, 1003, 192, 240, 50, 38, 1747, 609, 1028, 432, 122
Offset: 1

Views

Author

Paolo P. Lava, May 24 2016

Keywords

Comments

Subset of A051248.

Examples

			2^2 = 4, 2^3 = 8, 2^4 = 16, 2^5 = 32, 2^6 = 64, 2^7 = 128, 2^8 = 256;
3^2 = 9, 3^3 = 27, 3^4 = 81, 3^5 = 243, ..., 3^18 = 387420489.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local b,d,k,n; for n from 1 to q do if isprime(n) then d:=ilog10(n);
    for k from 2 to q do b:=ilog10(n^k); if n=trunc(n^k/10^(b-d)) then print(k);
    break; fi; od;  fi; od; end: P(10^6);
  • Mathematica
    sep[n_]:=Module[{len=IntegerLength[n],idn=IntegerDigits[n],exp=2}, While[ Take[ IntegerDigits[ n^exp],len] != idn,exp++];exp]; sep/@Prime[ Range[ 60]] (* Harvey P. Dale, Jun 15 2016 *)

Formula

a(n) = A051248(A000040(n)).

A378857 a(n) is the smallest k > 1 such that n^k starts and ends with n, or -1 if there is no such k.

Original entry on oeis.org

2, 21, 41, 11, 24, 10, 33, 73, 153, -1, 171, 241, 361, -1, -1, 6, 461, -1, 471, -1, 12086, -1, 1281, 51, 94, -1, 1181, 701, 1091, -1, 231, 197, 5781, -1, -1, 161, 221, -1, 1231, -1, 236, -1, 61, 1451, -1, -1, 861, 13381, 143, -1, 107, 501, 2761, -1, -1, 136
Offset: 1

Views

Author

Gonzalo Martínez, Feb 10 2025

Keywords

Comments

Given an integer n such that a(n) != -1, it follows that n^A051248(n) starts with n and n^A074250(n) ends with n, and both are the smallest exponents that satisfy these conditions. In this case, n^a(n) starts and ends with n. Due to this condition, larger exponents are required. For example, for n = 21 the smallest exponent satisfying the condition is 12086.

Examples

			2^21 = 2097152 is the smallest power of 2 that starts and ends with 2, so a(2) = 21.
		

Crossrefs

Formula

a(n) >= max{A074250(n), A051248(n)} except that a(n) = -1 when A074250(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
    
Showing 1-10 of 11 results. Next